1 package de.uni_hamburg.eggink.autojar; 2 3 19 20 import java.io.*; 21 import java.util.*; 22 23 28 29 public class OSFilter 30 implements FilenameFilter 31 { 32 private String expr; 33 private ArrayList excludes; 34 35 37 41 42 public OSFilter(String expr) 43 { 44 this.expr = expr; 45 } 46 47 49 public void setExcludes(ArrayList excludes) 50 { 51 this.excludes = excludes; 52 } 53 54 56 public boolean accept(File dir, String path) 57 { 58 boolean ok = Utils.patternMatches(expr, path); 59 60 if (! ok) 61 return false; 62 63 if (excludes != null) 64 for (Iterator it = excludes.iterator(); it.hasNext(); ) 65 if (Utils.patternMatches((String )it.next(), path)) 66 return false; 67 68 return true; 69 70 } 174 175 } 176 177 | Popular Tags |