本文整理汇总了Java中org.apache.lucene.index.IndexFileNameFilter类的典型用法代码示例。如果您正苦于以下问题:Java IndexFileNameFilter类的具体用法?Java IndexFileNameFilter怎么用?Java IndexFileNameFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IndexFileNameFilter类属于org.apache.lucene.index包,在下文中一共展示了IndexFileNameFilter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.apache.lucene.index.IndexFileNameFilter; //导入依赖的package包/类
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);
}
示例2: list
import org.apache.lucene.index.IndexFileNameFilter; //导入依赖的package包/类
/** Returns an array of strings, one for each Lucene index file in the directory. */
public String[] list() {
ensureOpen();
return directory.list(IndexFileNameFilter.getFilter());
}
示例3: LuceneIndexFileNameFilter
import org.apache.lucene.index.IndexFileNameFilter; //导入依赖的package包/类
private LuceneIndexFileNameFilter() {
luceneFilter = IndexFileNameFilter.getFilter();
}