1 12 13 package com.openedit.util.strainer; 14 15 import com.openedit.WebPageRequest; 16 17 18 23 public class PathFilter implements Filter 24 { 25 protected String fieldPath; 26 27 32 public PathFilter() 33 { 34 super(); 35 } 36 37 42 public PathFilter(String inPermission) 43 { 44 setPath(inPermission); 45 } 46 47 52 public void setPath(String permission) 53 { 54 fieldPath = permission; 55 } 56 57 62 public String getPath() 63 { 64 return fieldPath; 65 } 66 67 70 public boolean passes(Object inObj) throws FilterException, ClassCastException 71 { 72 WebPageRequest req = (WebPageRequest) inObj; 73 74 return (getPath() == null) || req.getPage().getPath().startsWith(getPath()); 75 } 76 77 public void accept( FilterVisitor inFilterVisitor ) throws FilterException 78 { 79 81 } 82 83 public Filter[] getFilters() 84 { 85 return null; 87 } 88 } 89 | Popular Tags |