use of org.kuali.kfs.sys.batch.FlatFileInformation in project cu-kfs by CU-CommunityApps.
the class AdvanceDepositServiceImpl method copyAllMessage.
private void copyAllMessage(Object parsedObject, PhysicalFlatFileInformation physicalFlatFileInformation) {
List<AchIncomeFile> achIncomeFiles = (List<AchIncomeFile>) parsedObject;
for (AchIncomeFile achIncomeFile : achIncomeFiles) {
FlatFileInformation fileInformation = new FlatFileInformation();
FlatFileTransactionInformation information = achIncomeFile.getFlatFileTransactionInformation();
fileInformation.getOrAddFlatFileData(achIncomeFile.getInterchangeControlNumber(), information);
fileInformation.addFileInfoMessage(achIncomeFile.getEmailMessageText());
physicalFlatFileInformation.getFlatFileInfomationList().add(fileInformation);
}
}
use of org.kuali.kfs.sys.batch.FlatFileInformation in project cu-kfs by CU-CommunityApps.
the class AdvanceDepositServiceImpl method loadFile.
public boolean loadFile(String fileName, PhysicalFlatFileInformation physicalFlatFileInformation) {
boolean valid = true;
byte[] fileByteContent = safelyLoadFileBytes(fileName);
if (LOG.isInfoEnabled()) {
LOG.info("Attempting to parse the file ");
}
Object parsedObject;
try {
parsedObject = batchInputFileService.parse(batchInputFileType, fileByteContent);
} catch (org.kuali.kfs.sys.exception.ParseException e) {
LOG.error("Error parsing batch file: " + e.getMessage());
FlatFileInformation fileInformation = new FlatFileInformation();
fileInformation.addFileInfoMessage("Unable to process file" + StringUtils.substringAfterLast(fileName, "\\") + "." + e.getMessage());
physicalFlatFileInformation.getFlatFileInfomationList().add(fileInformation);
return false;
}
if (parsedObject != null) {
valid = validate(parsedObject);
copyAllMessage(parsedObject, physicalFlatFileInformation);
if (valid) {
loadAchIncomeTransactions(parsedObject);
}
}
return valid;
}
Aggregations