|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsmbdav.filters.OrFilter
This class chains one or more underlying filters together; a file will be accepted if any subfilters accept the file. This is effectively a logical OR.
Subfilters are installed using a mechanism very similar to the global
filter installation; this filter accepts a fileFilters
parameter containing a list of whitespace-separated subfilter names.
An additional parameter is specified for each name, indicating the filter
class. If the filter class implements the
smbdav.DavenportFileFilter
interface, the instance will be
initialized using a java.util.Properties
object containing
name-value pairs from this filter's properties, scoped by the subfilter's
name. For example:
<init-param> <param-name>fileFilters</param-name> <param-value>myOrFilter</param-value> </init-param> <init-param> <param-name>myOrFilter</param-name> <param-value>smbdav.filters.OrFilter</param-value> </init-param> <init-param> <param-name>myOrFilter.fileFilters</param-name> <param-value>mySubFilter</param-value> </init-param> <init-param> <param-name>myOrFilter.mySubFilter</param-name> <param-value>com.foo.MyFilter</param-value> </init-param> <init-param> <param-name>myOrFilter.mySubFilter.subProperty</param-name> <param-value>subValue</param-value> </init-param>
The fileFilters
parameter declares a single
OrFilter
("myOrFilter"). This filter is passed
its own "fileFilters" property, containing the single subfilter name
"mySubFilter". A corresponding property is provided, specifying
com.foo.MyFilter
as the subfilter class.
This subfilter class is instantiated, and provided its own
set of properties (containing the single property "subProperty" with the
value "subValue"). Note that the subfilter's namespace prefix
("mySubFilter.") will be stripped off when the properties are delivered to
the subfilter instance.
Constructor Summary | |
OrFilter()
|
Method Summary | |
boolean |
accept(jcifs.smb.SmbFile file)
|
void |
destroy()
Destroys the filter instance. |
void |
init(java.util.Properties properties)
Initializes the filter with the provided properties. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OrFilter()
Method Detail |
public void init(java.util.Properties properties) throws java.lang.Exception
DavenportFileFilter
init
in interface DavenportFileFilter
properties
- The filter's initialization properties.
java.lang.Exception
- If an error occurs during initialization.public void destroy()
DavenportFileFilter
destroy
in interface DavenportFileFilter
public boolean accept(jcifs.smb.SmbFile file) throws jcifs.smb.SmbException
accept
in interface jcifs.smb.SmbFileFilter
jcifs.smb.SmbException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |