@Override
    public String probeContentType(Path path) throws IOException {
        // Try to detect based on the file name only for efficiency
        String fileNameDetect = tika.detect(path.toString());
        if (!fileNameDetect.equals(MimeTypes.OCTET_STREAM)) {
            return fileNameDetect;
        }

        // Then check the file content if necessary
        String fileContentDetect = tika.detect(path);
        if (!fileContentDetect.equals(MimeTypes.OCTET_STREAM)) {
            return fileContentDetect;
        }

        // Specification says to return null if we could not 
        // conclusively determine the file type
        return null;
    }
@Test
    public final void testDirectAccess() throws Exception {
        String contentType =
                new TikaFileTypeDetector().probeContentType(testDirectory.resolve(TEST_HTML));
        assertNotNull(contentType);
        assertEquals("text/html", contentType);
    }