@Test public void should_detect_new_xls_format() throws Exception { try (InputStream inputStream = this.getClass().getResourceAsStream("xls/test_new.xlsx")) { Format actual = formatDetector.detect(inputStream); assertTrue(actual.getFormatFamily() instanceof XlsFormatFamily); assertEquals("UTF-8", actual.getEncoding()); } }
@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);  }