| | |
| | | import static com.megatim.generatetxt.utilities.Utilities.getCharset; |
| | | import com.megatim.typefichier.validator.Validator; |
| | | import com.megatim.typefichier.validator.model.ConfigStreamValidator; |
| | | import com.megatim.validator.parser.ValidatorParser; |
| | | import com.megatim.validator.parser.pojo.TableDefinition; |
| | | import java.io.BufferedReader; |
| | | import java.io.BufferedWriter; |
| | | import java.io.File; |
| | |
| | | public class ParseData { |
| | | |
| | | public File validateCsvFile(FileToValidateDescription fileDescription, boolean headerPresent, Set<AlphaNumeriqueField> alphaNumeriqueToBeTruncated, int nbreThreads) throws Exception { |
| | | File fileToValidate = parseCsvFile(fileDescription, headerPresent, alphaNumeriqueToBeTruncated); |
| | | File fileToValidate = fileDescription.getFile(); |
| | | TableDefinition tableDefinition = ValidatorParser.retrieveFieldsFromValidator(new File(fileDescription.getValidatorPath()), fileDescription.getCodeTypeFichier()); |
| | | |
| | | if (tableDefinition.getHeaderPresent() == null || tableDefinition.getColumnDelimiter() == null || tableDefinition.getLineDelimiter() == null) { |
| | | fileToValidate = parseCsvFile(fileDescription, headerPresent, alphaNumeriqueToBeTruncated); |
| | | } |
| | | |
| | | byte[] targetArray = IOUtils.toByteArray(ParseData.class.getClassLoader().getResourceAsStream("predicatelogic-engine.xml")); |
| | | ConfigStreamValidator configValidator = new ConfigStreamValidator( |