@ComponentProfile(summary="Wraps a FileFilter instance for filtering remote blobs", since="3.9.2") public class RemoteBlobFilterWrapper extends java.lang.Object implements RemoteBlobFilter
FileFilter
instance and allows you to use that as your filter.
The file filter implementation is configured as a classname, and is expected to have a String constructor (the filter-expression is used as that parameter); this is because not all FileFilter implementations will have aliases and configuration that are appropriate for marshalling
Apache commons-io filters such as SizeBasedFilter
only provide a numeric constructor, so
these cannot yet be supported via this wrapper; however, you have other options available in the
com.adaptris.core.fs
package.
Since a RemoteBlob
does not expose all the possible methods of File
, it
is wrapped as a RemoteFile
. If your filter uses anything other than the filename
/ size / lastmodified, then results will be undefined.
In the adapter configuration file this class is aliased as remote-blob-filter-wrapper which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
RemoteBlobFilterWrapper() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(RemoteBlob blob)
Whether the given file is accepted by this filter.
|
java.lang.String |
getFileFilterImp() |
java.lang.String |
getFilterExpression() |
void |
setFileFilterImp(java.lang.String fileFilterImp)
Specify the file filter classname that will be used.
|
void |
setFilterExpression(java.lang.String filterExpression)
Specify the file filter expression that will be used.
|
RemoteBlobFilterWrapper |
withFilterExpression(java.lang.String expression) |
RemoteBlobFilterWrapper |
withFilterImp(java.lang.String s) |
public boolean accept(RemoteBlob blob)
RemoteBlobFilter
accept
in interface RemoteBlobFilter
public java.lang.String getFileFilterImp()
public void setFileFilterImp(java.lang.String fileFilterImp)
fileFilterImp
- the classname; may not be null.public RemoteBlobFilterWrapper withFilterImp(java.lang.String s)
public java.lang.String getFilterExpression()
public void setFilterExpression(java.lang.String filterExpression)
filterExpression
- the expression; may not be null.public RemoteBlobFilterWrapper withFilterExpression(java.lang.String expression)