if (context != null && context.getArchiveHandler() != null) {
// first check the current context for the current archive type
return type.equals(context.getArchiveHandler().getArchiveType());
}
try {
ArchiveDetector detector = locator.getService(ArchiveDetector.class, type);
if (detector == null) {
return false;
}
return detector.handles(archive);
} catch (IOException ioe) {
LogRecord lr = new LogRecord(Level.WARNING, EXCEPTION_CAUGHT);
Object args[] = { ioe.getMessage() };
lr.setParameters(args);
lr.setThrown(ioe);