1 18 package net.sf.drftpd.master.config; 19 20 import java.util.Collection ; 21 22 import net.sf.drftpd.remotefile.LinkedRemoteFileInterface; 23 24 import org.apache.oro.text.regex.Pattern; 25 import org.apache.oro.text.regex.Perl5Matcher; 26 27 31 public class PatternPathPermission extends PathPermission { 32 Pattern _pat; 33 public PatternPathPermission(Pattern pat, Collection users) { 34 super(users); 35 _pat = pat; 36 } 37 38 public boolean checkPath(LinkedRemoteFileInterface file) { 39 String path = file.getPath(); 40 if(file.isDirectory()) path = path.concat("/"); 41 Perl5Matcher m = new Perl5Matcher(); 42 return m.matches(path, _pat); 43 } 44 } 45 | Popular Tags |