}
}
}
path = "";
ResultPrinter resultPrinter =
new ResultPrinter(binarySignatureIdentifier, containerSignatureDefinitions,
path, slash, slash1, archives);
String fileName = null;
for (File file : matchedFiles) {
try {
fileName = file.getCanonicalPath();
} catch (IOException e) {
throw new CommandExecutionException(e);
}
URI uri = file.toURI();
RequestMetaData metaData =
new RequestMetaData(file.length(), file.lastModified(), fileName);
RequestIdentifier identifier = new RequestIdentifier(uri);
identifier.setParentId(1L);
InputStream in = null;
IdentificationRequest request = new FileSystemIdentificationRequest(metaData, identifier);
try {
in = new FileInputStream(file);
request.open(in);
IdentificationResultCollection results =
binarySignatureIdentifier.matchBinarySignatures(request);
resultPrinter.print(results, request);
} catch (FileNotFoundException fnfe) {
log.error("error processing files", fnfe);
throw new CommandExecutionException(fnfe);
} catch (IOException e) {
throw new CommandExecutionException(e);