* {@inheritDoc}
*/
@Override
public IdentificationResultCollection matchExtensions(
IdentificationRequest request, boolean allExtensions) {
IdentificationResultCollection results = new IdentificationResultCollection(request);
results.setRequestMetaData(request.getRequestMetaData());
String fileExtension = request.getExtension();
if (fileExtension != null && !fileExtension.isEmpty()) {
List<FileFormat> fileFormats;
if (allExtensions) {
fileFormats = sigFile.getFileFormatsForExtension(fileExtension);
} else {
fileFormats = sigFile.getTentativeFormatsForExtension(fileExtension);
}
if (fileFormats != null) {
for (FileFormat format : fileFormats) {
IdentificationResultImpl result = new IdentificationResultImpl();
result.setName(format.getName());
result.setVersion(format.getVersion());
result.setPuid(format.getPUID());
result.setMimeType(format.getMimeType());
result.setMethod(IdentificationMethod.EXTENSION);
results.addResult(result);
}
}
}
results.setFileLength(request.size());
results.setRequestMetaData(request.getRequestMetaData());
return results;
}