@Test public void should_detect_at_least_a_format() throws IOException { Format actual = formatDetector.detect(new ByteArrayInputStream(new byte[1])); Assert.assertNotNull(actual); assertTrue(actual.getFormatFamily() instanceof UnsupportedFormatFamily); }
@Override public Format detect(Metadata metadata, TikaInputStream inputStream) throws IOException { Format result = null; for (Detector detector : detectors) { result = detector.detect(metadata, inputStream); if (result != null) break; } if (result == null) { result = new Format(unsupportedFormatFamily, FormatUtils.DEFAULT_ENCODING); } return result; }
CompositeFormatDetector implements Detector { @Override public Format detect(Metadata metadata, TikaInputStream inputStream) throws IOException { Format result = null; for (Detector detector : detectors) { result = detector.detect(metadata, inputStream); if (result != null) break; } if (result == null) { result = new Format(unsupportedFormatFamily, FormatUtils.DEFAULT_ENCODING); } return result; } }
CompositeFormatDetector implements Detector { @Override public Format detect(Metadata metadata, TikaInputStream inputStream) throws IOException { Format result = null; for (Detector detector : detectors) { result = detector.detect(metadata, inputStream); if (result != null) break; } if (result == null) { result = new Format(unsupportedFormatFamily, FormatUtils.DEFAULT_ENCODING); } return result; }  }
CompositeFormatDetector implements Detector { @Override public Format detect(Metadata metadata, TikaInputStream inputStream) throws IOException { Format result = null; for (Detector detector : detectors) { result = detector.detect(metadata, inputStream); if (result != null) break; } if (result == null) { result = new Format(unsupportedFormatFamily, FormatUtils.DEFAULT_ENCODING); } return result; }  @Override Format detect(Metadata metadata, TikaInputStream inputStream); }
CompositeFormatDetector implements Detector { @Override public Format detect(Metadata metadata, TikaInputStream inputStream) throws IOException { Format result = null; for (Detector detector : detectors) { result = detector.detect(metadata, inputStream); if (result != null) break; } if (result == null) { result = new Format(unsupportedFormatFamily, FormatUtils.DEFAULT_ENCODING); } return result; }  @Override Format detect(Metadata metadata, TikaInputStream inputStream);  }