Examples of Detector


Examples of kilim.mirrors.Detector

     */
    public List<ClassInfo> weave(List<ClassInfo> classes) throws KilimException {
        // save the detector attached to this thread, if any. It will be restored
        // later.
        ArrayList<ClassInfo> ret = new ArrayList<ClassInfo>(classes.size());
        Detector origDetector = Detector.getDetector();
        Detector.setDetector(detector); // / set thread local detector.
        try {
            // First cache all the method signatures from the supplied classes to allow
            // the weaver to lookup method signatures from mutually recursive classes.
            for (ClassInfo cl : classes) {
View Full Code Here

Examples of kilim.mirrors.Detector

public class ClassWriter extends org.objectweb.asm.ClassWriter {
  private final Detector detector;
 
  public ClassWriter(final int flags, final ClassLoader classLoader) {
    super(flags);
    this.detector = new Detector(new RuntimeClassMirrors(classLoader));
  }
View Full Code Here

Examples of net.paoding.analysis.dictionary.support.detection.Detector

 
  public synchronized void startDetecting(int interval, DifferenceListener l) {
    if (detector != null || interval < 0) {
      return;
    }
    Detector detector = new Detector();
    detector.setHome(dicHome);
    detector.setFilter(new ExtensionFileFilter(".dic"));
    detector.setLastSnapshot(detector.flash());
    detector.setListener(l);
    detector.setInterval(interval);
    detector.start(true);
    this.detector = detector;
  }
View Full Code Here

Examples of net.paoding.analysis.dictionary.support.detection.Detector

  public synchronized void startDetecting(int interval, DifferenceListener l) {
    if (detector != null || interval < 0) {
      return;
    }
    Detector detector = new Detector();
    detector.setHome(dicHome);
    detector.setFilter(null);
    detector.setFilter(new FileFilter() {
      public boolean accept(File pathname) {
        return pathname.getPath().endsWith(".dic.compiled")
            || pathname.getPath().endsWith(".metadata");
      }
    });
    detector.setLastSnapshot(detector.flash());
    detector.setListener(l);
    detector.setInterval(interval);
    detector.start(true);
    this.detector = detector;
  }
View Full Code Here

Examples of net.paoding.analysis.dictionary.support.detection.Detector

  public synchronized void startDetecting(int interval, DifferenceListener l) {
    if (detector != null || interval < 0) {
      return;
    }
    Detector detector = new Detector();
    detector.setHome(dicHome);
    detector.setFilter(null);
    detector.setFilter(new FileFilter() {
      public boolean accept(File pathname) {
        return pathname.getPath().endsWith(".dic.compiled")
            || pathname.getPath().endsWith(".metadata");
      }
    });
    detector.setLastSnapshot(detector.flash());
    detector.setListener(l);
    detector.setInterval(interval);
    detector.start(true);
    this.detector = detector;
  }
View Full Code Here

Examples of net.paoding.analysis.dictionary.support.detection.Detector

 
  public synchronized void startDetecting(int interval, DifferenceListener l) {
    if (detector != null || interval < 0) {
      return;
    }
    Detector detector = new Detector();
    detector.setHome(dicHome);
    detector.setFilter(new ExtensionFileFilter(".dic"));
    detector.setLastSnapshot(detector.flash());
    detector.setListener(l);
    detector.setInterval(interval);
    detector.start(true);
    this.detector = detector;
  }
View Full Code Here

Examples of net.paoding.analysis.dictionary.support.detection.Detector

 
  public synchronized void startDetecting(int interval, DifferenceListener l) {
    if (detector != null || interval < 0) {
      return;
    }
    Detector detector = new Detector();
    detector.setHome(dicHome);
    detector.setFilter(new ExtensionFileFilter(".dic"));
    detector.setLastSnapshot(detector.flash());
    detector.setListener(l);
    detector.setInterval(interval);
    detector.start(true);
    this.detector = detector;
  }
View Full Code Here

Examples of org.apache.tika.detect.Detector

    }

    if (mediaType !=null) {
      metadata.add(org.apache.tika.metadata.HttpHeaders.CONTENT_TYPE, mediaType.toString());

      final Detector detector = parser.getDetector();

      parser.setDetector(new Detector() {
        public MediaType detect(InputStream inputStream, Metadata metadata) throws IOException {
          String ct = metadata.get(org.apache.tika.metadata.HttpHeaders.CONTENT_TYPE);

          if (ct!=null) {
            return MediaType.parse(ct);
          } else {
            return detector.detect(inputStream, metadata);
          }
        }
      });
    }
  }
View Full Code Here

Examples of org.apache.tika.detect.Detector

       ForkParser parser = new ForkParser(
             ForkParserIntegrationTest.class.getClassLoader(),
             tika.getParser());
      
       ParseContext context = new ParseContext();
       context.set(Detector.class, new Detector() {
          public MediaType detect(InputStream input, Metadata metadata) {
             return MediaType.OCTET_STREAM;
          }
       });
View Full Code Here

Examples of org.apache.tika.detect.Detector

   private static final String file = "testWINMAIL.dat";
  
   @Test
   public void testBasics() throws Exception {
      TikaInputStream stream = getTestFile(file);
      Detector detector = new DefaultDetector();
      try {
         assertEquals(
                 MediaType.application("vnd.ms-tnef"),
                 detector.detect(stream, new Metadata()));
     } finally {
         stream.close();
     }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.