1 4 package net.sourceforge.pmd.cpd; 5 6 import net.sourceforge.pmd.SourceFileSelector; 7 8 import java.io.File ; 9 import java.io.FilenameFilter ; 10 11 14 public class SourceFileOrDirectoryFilter implements FilenameFilter { 15 16 private SourceFileSelector fileSelector; 17 18 private static final String fileSeparator = System.getProperty("file.separator"); 19 20 25 public SourceFileOrDirectoryFilter(SourceFileSelector fileSelector) { 26 this.fileSelector = fileSelector; 27 } 28 29 public boolean accept(File dir, String filename) { 30 return (fileSelector.isWantedFile(filename) || (new File (dir.getAbsolutePath() + fileSeparator + filename).isDirectory())) && !filename.equals("SCCS"); 31 } 33 } | Popular Tags |