/** * Get the extensions for the underlying detectory * * @return DOCUMENT ME! */ public String[] getDetectorExtensions() { log.debug("testDetector()"); String detectorClass = new String(match.getTest().array()); try { log.debug("loading class: " + detectorClass); Class c = Class.forName(detectorClass); MagicDetector detector = (MagicDetector) c.newInstance(); return detector.getHandledTypes(); } catch (ClassNotFoundException e) { log.error("failed to load detector: " + detectorClass, e); } catch (InstantiationException e) { log.error("specified class is not a valid detector class: " + detectorClass, e); } catch (IllegalAccessException e) { log.error("specified class cannot be accessed: " + detectorClass, e); } return new String[0]; }
String[] types = detector.process(data.array(), match.getOffset(), match.getLength(), match.getBitmask(), match.getComparator(), match.getMimeType(), match.getProperties());
String[] types = detector.process(data.array(), match.getOffset(), match.getLength(), match.getBitmask(), match.getComparator(), match.getMimeType(), match.getProperties());
/** * Get the extensions for the underlying detectory * * @return DOCUMENT ME! */ public String[] getDetectorExtensions() { log.debug("testDetector()"); String detectorClass = new String(match.getTest().array()); try { log.debug("loading class: " + detectorClass); Class<?> c = Class.forName(detectorClass); MagicDetector detector = (MagicDetector) c.newInstance(); return detector.getHandledTypes(); } catch (ClassNotFoundException e) { log.error("failed to load detector: " + detectorClass, e); } catch (InstantiationException e) { log.error("specified class is not a valid detector class: " + detectorClass, e); } catch (IllegalAccessException e) { log.error("specified class cannot be accessed: " + detectorClass, e); } return new String[0]; }