Package org.springmodules.lucene.index.document.handler

Examples of org.springmodules.lucene.index.document.handler.DocumentMatching


   
    //Indexer
    DefaultDirectoryIndexer indexer = new DefaultDirectoryIndexer(indexFactory);

    //Register a document handler
    DocumentMatching matching = new DocumentMatching() {
      public boolean match(String name) {
        return name.equals("test");
      }
    };
View Full Code Here


   
    //Indexer
    DefaultDirectoryIndexer indexer=new DefaultDirectoryIndexer(indexFactory);

    //Register a document handler
    DocumentMatching matching=new DocumentMatching() {
      public boolean match(String name) {
        return name.equals("test");
      }
    };
View Full Code Here

import org.springmodules.lucene.index.document.handler.DocumentMatching;

public class ExtensionDocumentMatchingTests extends TestCase {
  public void testMatch() throws Exception {
    DocumentMatching documentMatching1 = new ExtensionDocumentMatching("txt");
    assertTrue(documentMatching1.match("test.txt"));

    DocumentMatching documentMatching2 = new ExtensionDocumentMatching("txt");
    assertTrue(documentMatching2.match("test.test.txt"));
  }
View Full Code Here

    DocumentMatching documentMatching2 = new ExtensionDocumentMatching("txt");
    assertTrue(documentMatching2.match("test.test.txt"));
  }

  public void testNotMatch() throws Exception {
    DocumentMatching documentMatching1 = new ExtensionDocumentMatching("doc");
    assertFalse(documentMatching1.match("test.txt"));

    DocumentMatching documentMatching2 = new ExtensionDocumentMatching("doc");
    assertFalse(documentMatching2.match("doc"));
  }
View Full Code Here

import org.springmodules.lucene.index.document.handler.DocumentMatching;

public class MimeTypeDocumentMatchingTests extends TestCase {
  public void testMatch() throws Exception {
    DocumentMatching documentMatching1 = new MimeTypeDocumentMatching("text/plain");
    assertTrue(documentMatching1.match("test.txt"));

    DocumentMatching documentMatching2 = new MimeTypeDocumentMatching("text/plain");
    assertTrue(documentMatching2.match("test.test.txt"));
  }
View Full Code Here

    DocumentMatching documentMatching2 = new MimeTypeDocumentMatching("text/plain");
    assertTrue(documentMatching2.match("test.test.txt"));
  }

  public void testNotMatch() throws Exception {
    DocumentMatching documentMatching1 = new MimeTypeDocumentMatching("doc");
    assertFalse(documentMatching1.match("test.txt"));

    DocumentMatching documentMatching2 = new MimeTypeDocumentMatching("doc");
    assertFalse(documentMatching2.match("doc"));
  }
View Full Code Here

TOP

Related Classes of org.springmodules.lucene.index.document.handler.DocumentMatching

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.