controller.runFileFormatAnalysis();
Iterator<IdentificationFile> iterator = controller.getFileCollection()
.getIterator();
// We identify one file only:
if (iterator.hasNext()) {
IdentificationFile file = iterator.next();
waitFor(file);
URI[] uris = new URI[file.getNumHits()];
log.info("Looking at results: #" + file.getNumHits());
// Retrieve the results:
try {
for (int hitCounter = 0; hitCounter < file.getNumHits(); hitCounter++) {
FileFormatHit formatHit = file.getHit(hitCounter);
uris[hitCounter] = new URI("info:pronom/"
+ formatHit.getFileFormatPUID());
}
} catch (URISyntaxException e) {
e.printStackTrace();
}
List<URI> result = Arrays.asList(uris);
this.classificationText = file.getClassificationText();
return result;
}
return null;
}