All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cookercucumber_parser.flatFileParser.PlainParser Maven / Gradle / Ivy

Go to download

Derives smallest Feature File, Allows Data from Excel(xls and xlsx) and Also provides a clear and concise reporting

There is a newer version: 3.1.0
Show newest version
package cookercucumber_parser.flatFileParser;

import common.fileFactory.FileUtility;
import org.apache.commons.io.FilenameUtils;

import java.io.IOException;

/**
 * @author Manjunath Prabhakar (Manjunath-PC)
 * @created 23/09/2020
 * @project cookercucumber-maven-plugin
 */
public class PlainParser {

    /**
     * Read the Plain File and Convert that into Examples Format for Scenario Outline
     * 
Author : Manjunath Prabhakar ([email protected])
* * @param filePath Folder Path Only * @param fileName FileName with Extension (txt) * @return Txt Data in Examples Format * @throws IOException If Any */ public static String readPlain(String filePath, String fileName) throws Exception { if (!FilenameUtils.getExtension(fileName).equalsIgnoreCase("txt")) { throw new Exception("Invalid Extension. Accepted(txt)"); } return "Examples:\n" + FileUtility.readAndGetFileContent(filePath + "\\" + fileName); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy