Java Code Examples for org.apache.lucene.index.IndexFileNameFilter

The following examples show how to use org.apache.lucene.index.IndexFileNameFilter. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private void create() throws IOException {
  if (directory.exists()) {
    String[] files = directory.list(IndexFileNameFilter.getFilter());            // clear old files
    if (files == null)
      throw new IOException("cannot read directory " + directory.getAbsolutePath() + ": list() returned null");
    for (int i = 0; i < files.length; i++) {
      File file = new File(directory, files[i]);
      if (!file.delete())
        throw new IOException("Cannot delete " + file);
    }
  }
  lockFactory.clearLock(IndexWriter.WRITE_LOCK_NAME);
}
 
Example 2
/** Returns an array of strings, one for each Lucene index file in the directory. */
public String[] list() {
  ensureOpen();
  return directory.list(IndexFileNameFilter.getFilter());
}
 
Example 3
Source Project: RDFS   Source File: LuceneIndexFileNameFilter.java    License: Apache License 2.0 4 votes vote down vote up
private LuceneIndexFileNameFilter() {
  luceneFilter = IndexFileNameFilter.getFilter();
}
 
Example 4
Source Project: hadoop-gpu   Source File: LuceneIndexFileNameFilter.java    License: Apache License 2.0 4 votes vote down vote up
private LuceneIndexFileNameFilter() {
  luceneFilter = IndexFileNameFilter.getFilter();
}