License Holder identification
This commit is contained in:
@@ -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<String> orgSet = new HashSet<String>();
|
||||
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,14 +48,45 @@ 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);
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Reference in New Issue
Block a user