private String getContainerFormat(IdentificationResultCollection results) { final List<IdentificationResult> theResults = results.getResults(); final int numResults = theResults.size(); // use an indexed loop to reduce garbage, don't allocate an iterator. for (int i = 0; i < numResults; i++) { final IdentificationResult result = theResults.get(i); final String format = containerFormatResolver.forPuid(result.getPuid()); if (format != null) { return format; } } return null; }
containerIdentifierFactory.addContainerIdentifier(containerType, this); final String puid = triggerPuid.getPuid(); containerFormatResolver.registerPuid(puid, containerType);
containerIdentifierFactory.addContainerIdentifier(containerType, this); final String puid = triggerPuid.getPuid(); containerFormatResolver.registerPuid(puid, containerType);
private String getContainerFormat(IdentificationResultCollection results) { final List<IdentificationResult> theResults = results.getResults(); final int numResults = theResults.size(); // use an indexed loop to reduce garbage, don't allocate an iterator. for (int i = 0; i < numResults; i++) { final IdentificationResult result = theResults.get(i); final String format = containerFormatResolver.forPuid(result.getPuid()); if (format != null) { return format; } } return null; }
/** * @param results A previous identification of an archival format. * @return format or null */ private String getArchiveFormat(IdentificationResultCollection results) { final List<IdentificationResult> theResults = results.getResults(); final int numResults = theResults.size(); // use an indexed loop to reduce garbage, don't allocate an iterator. for (int i = 0; i < numResults; i++) { final IdentificationResult result = theResults.get(i); String format = archiveFormatResolver.forPuid(result.getPuid()); if (format != null) { // exit on the first non-null format met if (processArchives && !processWebArchives && isWebArchiveFormat(format)) { format = null; } else if (!processArchives && processWebArchives && !isWebArchiveFormat(format)) { format = null; } return format; } } return null; }
/** * @param results A previous identification of an archival format. * @return format or null */ private String getArchiveFormat(IdentificationResultCollection results) { final List<IdentificationResult> theResults = results.getResults(); final int numResults = theResults.size(); // use an indexed loop to reduce garbage, don't allocate an iterator. for (int i = 0; i < numResults; i++) { final IdentificationResult result = theResults.get(i); String format = archiveFormatResolver.forPuid(result.getPuid()); if (format != null) { // exit on the first non-null format met if (processArchives && !processWebArchives && isWebArchiveFormat(format)) { format = null; } else if (!processArchives && processWebArchives && !isWebArchiveFormat(format)) { format = null; } return format; } } return null; }
String format = containerFormatResolver.forPuid(identificationResult.getPuid()); if (format != null) { try {