Class FilenameMaskFilter

java.lang.Object
com.twelvemonkeys.io.FilenameMaskFilter
All Implemented Interfaces:
FilenameFilter

@Deprecated public class FilenameMaskFilter extends Object implements FilenameFilter
Deprecated.
A Java Bean used for approving file names which are to be included in a java.io.File listing. The mask is given as a well-known DOS filename format, with '*' and '?' as wildcards. All other characters counts as ordinary characters.

The file name masks are used as a filter input and is given to the class via the string array property:

filenameMasksForInclusion
Filename mask for exclusion of files (default if both properties are defined).
filenameMasksForExclusion
Filename mask for exclusion of files.

A recommended way of doing this is by referencing to the component which uses this class for file listing. In this way all properties are set in the same component and this utility component is kept in the background with only initial configuration necessary.

See Also:
  • Field Details

    • filenameMasksForInclusion

      private String[] filenameMasksForInclusion
      Deprecated.
    • filenameMasksForExclusion

      private String[] filenameMasksForExclusion
      Deprecated.
    • inclusion

      private boolean inclusion
      Deprecated.
  • Constructor Details

    • FilenameMaskFilter

      public FilenameMaskFilter()
      Deprecated.
      Creates a FilenameMaskFilter
    • FilenameMaskFilter

      public FilenameMaskFilter(String pFilenameMask)
      Deprecated.
      Creates a FilenameMaskFilter
      Parameters:
      pFilenameMask - the filename mask
    • FilenameMaskFilter

      public FilenameMaskFilter(String[] pFilenameMasks)
      Deprecated.
      Creates a FilenameMaskFilter
      Parameters:
      pFilenameMasks - the filename masks
    • FilenameMaskFilter

      public FilenameMaskFilter(String pFilenameMask, boolean pExclusion)
      Deprecated.
      Creates a FilenameMaskFilter
      Parameters:
      pFilenameMask - the filename masks
      pExclusion - if true, the masks will be excluded
    • FilenameMaskFilter

      public FilenameMaskFilter(String[] pFilenameMasks, boolean pExclusion)
      Deprecated.
      Creates a FilenameMaskFilter
      Parameters:
      pFilenameMasks - the filename masks
      pExclusion - if true, the masks will be excluded
  • Method Details

    • setFilenameMasksForInclusion

      public void setFilenameMasksForInclusion(String[] pFilenameMasksForInclusion)
      Deprecated.
      Parameters:
      pFilenameMasksForInclusion - the filename masks to include
    • getFilenameMasksForInclusion

      public String[] getFilenameMasksForInclusion()
      Deprecated.
      Returns:
      the current inclusion masks
    • setFilenameMasksForExclusion

      public void setFilenameMasksForExclusion(String[] pFilenameMasksForExclusion)
      Deprecated.
      Parameters:
      pFilenameMasksForExclusion - the filename masks to exclude
    • getFilenameMasksForExclusion

      public String[] getFilenameMasksForExclusion()
      Deprecated.
      Returns:
      the current exclusion masks
    • accept

      public boolean accept(File pDir, String pName)
      Deprecated.
      This method implements the java.io.FilenameFilter interface.
      Specified by:
      accept in interface FilenameFilter
      Parameters:
      pDir - the directory in which the file was found.
      pName - the name of the file.
      Returns:
      true if the file pName should be included in the file list; false otherwise.
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object
      Returns:
      a string representation for debug purposes