Class AndFilter

  extended bysmbdav.filters.AndFilter
All Implemented Interfaces:
DavenportFileFilter, jcifs.smb.SmbFileFilter

public class AndFilter
extends java.lang.Object
implements DavenportFileFilter

This class chains one or more underlying filters together; a file will be accepted by the filter only if all subfilters accept the file. This is effectively a logical AND.

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:


The fileFilters parameter declares a single AndFilter ("myAndFilter"). This filter is passed its own "fileFilters" property, containing the single subfilter name "mySubFilter". A corresponding property is provided, specifying 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.

Eric Glass

Constructor Summary
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 AndFilter()
Method Detail


public void init(java.util.Properties properties)
          throws java.lang.Exception
Description copied from interface: DavenportFileFilter
Initializes the filter with the provided properties.

Specified by:
init in interface DavenportFileFilter
properties - The filter's initialization properties.
java.lang.Exception - If an error occurs during initialization.


public void destroy()
Description copied from interface: DavenportFileFilter
Destroys the filter instance.

Specified by:
destroy in interface DavenportFileFilter


public boolean accept(jcifs.smb.SmbFile file)
               throws jcifs.smb.SmbException
Specified by:
accept in interface jcifs.smb.SmbFileFilter

Copyright © 2004 Eric Glass