FileDocumentFactory { public boolean isFileSupported(final VFSLeaf leaf) { final String fileName = leaf.getName(); if (fileName != null && fileName.startsWith(".")) { return false; } String suffix; try { suffix = getSuffix(fileName); } catch (final DocumentNotImplementedException e) { return false; } if (fileBlackList.contains(fileName)) { return false; } if (checkFileSizeSuffixes.contains(suffix)) { if ((maxFileSize != 0) && (leaf.getSize() > maxFileSize)) { log.info("File too big, exlude from search index. filename=" + fileName); excludedFileSizeCount++; return false; } } return true; } FileDocumentFactory(final SearchModule searchModule, MimeTypeProvider mimeTypeProvider);  FileDocumentFactory(final SearchModule searchModule); static Document createDocument(final SearchResourceContext leafResourceContext, final VFSLeaf leaf); boolean isFileSupported(final VFSLeaf leaf); int getExcludedFileSizeCount(); void resetExcludedFileSizeCount();  }
@Test public void testIsFileSupported() { assertTrue("html must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.html")))); assertTrue("htm must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.htm")))); assertTrue("HTML must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.HTML")))); assertTrue("HTM must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.HTM")))); assertTrue("HTM must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.xhtml")))); assertTrue("HTM must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.XHTML")))); assertTrue("pdf must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.pdf")))); assertTrue("PDF must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.PDF")))); assertTrue("DOC must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.DOC")))); assertTrue("doc must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.doc")))); assertTrue("TXT must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.TXT")))); assertTrue("txt must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.txt")))); assertTrue("txt must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.readme")))); assertTrue("txt must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.README")))); assertTrue("txt must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.csv")))); assertTrue("txt must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.CSV")))); assertTrue("XML must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.XML")))); assertTrue("xml must be supported", fileDocumentFactory.isFileSupported(new LocalFileImpl(new File("test.xml")))); }