1 package cve.util; 2 3 import java.io.File ; 4 import javax.swing.filechooser.*; 5 6 import org.apache.log4j.Logger; 7 import cve.staticLayout.Cve; 8 9 public class ClassFileFilter extends FileFilter 10 { 11 12 private String typeFile, description; 13 14 public ClassFileFilter(String typeF, String desc){ 15 Cve.errLog.debug(""); 16 this.typeFile = typeF; 17 this.description = desc; 18 } 19 20 public boolean accept( File f ) { 21 Cve.errLog.debug(""); 22 if( f.isDirectory() ) 23 return true; 24 25 String ext = f.getName(); 26 int i = ext.lastIndexOf('.'); 27 if( i>0 && i<ext.length()-1 ){ 28 ext = ext.substring(i+1).toLowerCase(); 29 } 30 return ext.equals(typeFile); 31 } 32 33 public String getDescription() 34 { 35 Cve.errLog.debug(""); 36 return description; 37 } 38 39 } | Popular Tags |