Clover Coverage Report
Coverage timestamp: Fri May 9 2008 10:54:27 EST
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
10   44   6   10
10   15   0.6   1
1     6  
1    
 
  IndexFileNameFilter       Line # 28 10 6 100% 1.0
 
  (12)
 
1    package org.apache.lucene.index;
2   
3    /**
4    * Copyright 2005 The Apache Software Foundation
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10    * http://www.apache.org/licenses/LICENSE-2.0
11    *
12    * Unless required by applicable law or agreed to in writing, software
13    * distributed under the License is distributed on an "AS IS" BASIS,
14    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15    * See the License for the specific language governing permissions and
16    * limitations under the License.
17    */
18   
19    import java.io.File;
20    import java.io.FilenameFilter;
21   
22    /**
23    * Filename filter that accept filenames and extensions only created by Lucene.
24    *
25    * @author Daniel Naber / Bernhard Messer
26    * @version $rcs = ' $Id: Exp $ ' ;
27    */
 
28    public class IndexFileNameFilter implements FilenameFilter {
29   
30    /* (non-Javadoc)
31    * @see java.io.FilenameFilter#accept(java.io.File, java.lang.String)
32    */
 
33  1226 toggle public boolean accept(File dir, String name) {
34  14581 for (int i = 0; i < IndexFileNames.INDEX_EXTENSIONS.length; i++) {
35  13572 if (name.endsWith("."+IndexFileNames.INDEX_EXTENSIONS[i]))
36  217 return true;
37    }
38  1009 if (name.equals(IndexFileNames.DELETABLE)) return true;
39  850 else if (name.equals(IndexFileNames.SEGMENTS)) return true;
40  690 else if (name.matches(".+\\.f\\d+")) return true;
41  665 return false;
42    }
43   
44    }