Skip to content

Commit

Permalink
0004252: File Sync Writer to handle non numeric values for numeric
Browse files Browse the repository at this point in the history
fields
  • Loading branch information
jumpmind-josh committed Jan 20, 2020
1 parent f264f10 commit 9cf21b7
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,16 @@ public void write(CsvData data) {
FileSnapshot snapshot = new FileSnapshot();
snapshot.setTriggerId(columnData.get("TRIGGER_ID"));
snapshot.setRouterId(columnData.get("ROUTER_ID"));
snapshot.setFileModifiedTime(Long.parseLong(columnData.get("FILE_MODIFIED_TIME")));
snapshot.setCrc32Checksum(Long.parseLong(columnData.get("CRC32_CHECKSUM")));
try {
snapshot.setFileModifiedTime(Long.parseLong(columnData.get("FILE_MODIFIED_TIME")));
} catch (NumberFormatException nfe) {
log.info("File modified time was not a number : " + columnData.get("FILE_MODIFIED_TIME") + " for file " + columnData.get("FILE_NAME"));
}
try {
snapshot.setCrc32Checksum(columnData.get("CRC32_CHECKSUM") == null ? 0 : Long.parseLong(columnData.get("CRC32_CHECKSUM")));
} catch (NumberFormatException nfe) {
log.info("Checksum was not a number : " + columnData.get("CRC32_CHECKSUM") + " for file " + columnData.get("FILE_NAME"));
}
String oldChecksum = oldColumnData.get("CRC32_CHECKSUM");
if (StringUtils.isNotBlank(oldChecksum)) {
snapshot.setOldCrc32Checksum(Long.parseLong(oldChecksum));
Expand Down

0 comments on commit 9cf21b7

Please sign in to comment.