diff --git a/AH MAM Migration/src/com/bayer/edam/migration/EntryProcessor.java b/AH MAM Migration/src/com/bayer/edam/migration/EntryProcessor.java index 7c40e36..1de0328 100644 --- a/AH MAM Migration/src/com/bayer/edam/migration/EntryProcessor.java +++ b/AH MAM Migration/src/com/bayer/edam/migration/EntryProcessor.java @@ -23,17 +23,21 @@ public class EntryProcessor { private ObjectMapper jsonMapper = new ObjectMapper(); public EntryProcessor() throws IOException { + log.info("Starting up"); + LineIterator iter = FileUtils.lineIterator(entriesFile, "UTF-8"); // skip header iter.next(); HashSet orgSet = new HashSet(); - + int count = 0; + while (iter.hasNext()) { String line = iter.next(); line = line.substring(line.lastIndexOf(fieldSeparator) + fieldSeparator.length()); Entry entry = jsonMapper.readValue(line, Entry.class); + if (entry.copyright == null || entry.copyright.organization == null || !entry.copyright.organization.get("id").equals("3740")) { String orgId = null; @@ -44,13 +48,44 @@ public class EntryProcessor { } - log.warn("Entry " + entry.id + ": License Holder is not set to 'Bayer Animal Health GmbH' " + orgId); + log.warn("Entry " + entry.id + ": License Holder is not set to 'Bayer Animal Health GmbH' " + orgId + ", status: " + entry.stateId); } + + + +// for (Download download : entry.downloadListPublicFolder) { +// +// } + +// boolean originalFound = false; +// long largest = 0; +// long originalSize = 0; +// for (Download download : entry.downloadList) { +// if (largest < download.size) +// largest = download.size; +// +// if (download.entryFileVariation.equals("ORIGINAL")) { +// originalFound = true; +// originalSize = download.size; +// } +// } +// +// if (!originalFound) { +// log.info(entry.id + " - no original - " + entry.stateId); +// count++; +// } +// else if (largest > originalSize) { +// log.info(entry.id + " - original is not largest file - " + entry.stateId); +// count++; +// } + } for (String orgId : orgSet) { log.info(orgId); } + + log.info("Count: " + count); }