2 * Copyright 2005 The Apache Software Foundation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 namespace Lucene
.Net
.Index
22 /// <summary> Filename filter that accept filenames and extensions only created by Lucene.
25 /// <author> Daniel Naber / Bernhard Messer
27 /// <version> $rcs = ' $Id: IndexFileNameFilter.cs,v 1.2 2006/10/02 17:08:52 joeshaw Exp $ ' ;
29 public class IndexFileNameFilter
// : FilenameFilter {{Aroush-1.9}}
33 * @see java.io.FilenameFilter#accept(java.io.File, java.lang.String)
35 public virtual bool Accept(System
.IO
.FileInfo dir
, System
.String name
)
37 for (int i
= 0; i
< IndexFileNames
.INDEX_EXTENSIONS
.Length
; i
++)
39 if (name
.EndsWith("." + IndexFileNames
.INDEX_EXTENSIONS
[i
]))
42 if (name
.Equals(IndexFileNames
.DELETABLE
))
44 else if (name
.Equals(IndexFileNames
.SEGMENTS
))
46 else if (true) // else if (name.Matches(".+\\.f\\d+")) // {{Aroush-1.9}}