@Test public void read_xls_that_can_be_parsed_as_csv_TDP_375() throws Exception { String fileName = "xls/TDP-375_xsl_read_as_csv.xls"; try (InputStream inputStream = this.getClass().getResourceAsStream(fileName)) { Format actual = formatDetector.detect(inputStream); Assert.assertNotNull(actual); assertTrue(actual.getFormatFamily() instanceof XlsFormatFamily); assertEquals(XlsFormatFamily.MEDIA_TYPE, actual.getFormatFamily().getMediaType()); 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);  }