com.armatiek.infofuze.stream.filesystem.filefilter
Class MimeTypeFileFilter

java.lang.Object
  extended by com.armatiek.infofuze.stream.filesystem.filefilter.MimeTypeFileFilter
All Implemented Interfaces:
IOFileFilter, java.io.Serializable

public class MimeTypeFileFilter
extends java.lang.Object
implements IOFileFilter, java.io.Serializable

Filters files for certain mime types.

See Also:
Serialized Form

Constructor Summary
MimeTypeFileFilter(java.util.List<java.lang.String> mimeTypes)
          Constructs a new mime type file filter for a list of mime types.
MimeTypeFileFilter(java.lang.String mimeType)
          Constructs a new mime type file filter for a single mime type.
MimeTypeFileFilter(java.lang.String[] mimeTypes)
          Constructs a new mime type file filter for an array of mime types.
 
Method Summary
 boolean accept(FileIf file)
          Checks to see if the filename matches.
 java.lang.String toString()
          Provide a String representaion of this file filter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MimeTypeFileFilter

public MimeTypeFileFilter(java.lang.String mimeType)
Constructs a new mime type file filter for a single mime type.

Parameters:
mimeType - the mime type to allow, must not be null
Throws:
java.lang.IllegalArgumentException - if the mimeType is null

MimeTypeFileFilter

public MimeTypeFileFilter(java.lang.String[] mimeTypes)
Constructs a new mime type file filter for an array of mime types.

The array is not cloned, so could be changed after constructing the instance. This would be inadvisable however.

Parameters:
mimeTypes - the mime types to allow, must not be null
Throws:
java.lang.IllegalArgumentException - if the names array is null

MimeTypeFileFilter

public MimeTypeFileFilter(java.util.List<java.lang.String> mimeTypes)
Constructs a new mime type file filter for a list of mime types.

Parameters:
mimeTypes - the mimeTypes to allow, must not be null
Throws:
java.lang.IllegalArgumentException - if the name list is null
java.lang.ClassCastException - if the list does not contain Strings
Method Detail

accept

public boolean accept(FileIf file)
Checks to see if the filename matches.

Specified by:
accept in interface IOFileFilter
Parameters:
file - the File to check
Returns:
true if the filename matches

toString

public java.lang.String toString()
Provide a String representaion of this file filter.

Overrides:
toString in class java.lang.Object
Returns:
a String representaion