Package org.apache.tika.detect

Examples of org.apache.tika.detect.ContainerAwareDetector


    private Parser parser;
  
    @Override
    protected void setUp() throws Exception {
       TikaConfig config = TikaConfig.getDefaultConfig();
       ContainerAwareDetector detector = new ContainerAwareDetector(
             config.getMimeRepository()
       );
       parser = new AutoDetectParser(detector);
    }
View Full Code Here


            displayMetModels();
        } else if(arg.equals("--list-supported-types")){
            pipeMode = false;
            displaySupportedTypes();
        } else if(arg.equals("--container-aware") || arg.equals("--container-aware-detector")) {
           detector = new ContainerAwareDetector(detector);
           initParser();
        } else if (arg.startsWith("-e")) {
            encoding = arg.substring("-e".length());
        } else if (arg.startsWith("--encoding=")) {
            encoding = arg.substring("--encoding=".length());
View Full Code Here

public class OOXMLContainerExtractionTest extends AbstractPOIContainerExtractionTest {
    private ContainerExtractor extractor;
   
    @Override
    protected void setUp() throws Exception {
       ContainerAwareDetector detector = new ContainerAwareDetector(
             (new TikaConfig()).getMimeRepository()
       );
       extractor = new ParserContainerExtractor(
             new AutoDetectParser(detector), detector
       );
View Full Code Here

public class TNEFParserTest extends AbstractPOIContainerExtractionTest {
   private static final String file = "testWINMAIL.dat";
  
   public void testBasics() throws Exception {
      TikaInputStream stream = getTestFile(file);
      ContainerAwareDetector detector =
         new ContainerAwareDetector(MimeTypes.getDefaultMimeTypes());
     
      try {
         assertEquals(
                 MediaType.application("vnd.ms-tnef"),
                 detector.detect(stream, new Metadata()));
     } finally {
         stream.close();
     }
   }
View Full Code Here

    private Parser parser;
  
    @Override
    protected void setUp() throws Exception {
       TikaConfig config = TikaConfig.getDefaultConfig();
       ContainerAwareDetector detector = new ContainerAwareDetector(
             config.getMimeRepository()
       );
       parser = new AutoDetectParser(detector);
    }
View Full Code Here

    private Parser parser;
  
    @Override
    protected void setUp() throws Exception {
       TikaConfig config = TikaConfig.getDefaultConfig();
       ContainerAwareDetector detector = new ContainerAwareDetector(
             config.getMimeRepository()
       );
       parser = new AutoDetectParser(detector);
    }
View Full Code Here

public class OOXMLContainerExtractionTest extends AbstractPOIContainerExtractionTest {
    private ContainerExtractor extractor;
   
    @Override
    protected void setUp() throws Exception {
       ContainerAwareDetector detector = new ContainerAwareDetector(
               MimeTypes.getDefaultMimeTypes());
       extractor = new ParserContainerExtractor(
             new AutoDetectParser(detector), detector
       );
    }
View Full Code Here

TOP

Related Classes of org.apache.tika.detect.ContainerAwareDetector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.