Class AbstractSimplePatternFileListFilter<F>

Type Parameters:
F - the file type.
All Implemented Interfaces:
FileListFilter<F>
Direct Known Subclasses:
FtpSimplePatternFileListFilter, SftpSimplePatternFileListFilter, SimplePatternFileListFilter, SmbSimplePatternFileListFilter

public abstract class AbstractSimplePatternFileListFilter<F> extends AbstractDirectoryAwareFileListFilter<F>
Base class for filters that support ant style path expressions, which are less powerful but more readable than regular expressions. This filter only filters on the name of the file, the rest of the path is ignored.
Since:
2.0
Author:
Iwein Fuld, Mark Fisher
See Also:
  • Constructor Details

    • AbstractSimplePatternFileListFilter

      public AbstractSimplePatternFileListFilter(String path)
  • Method Details

    • accept

      public final boolean accept(F file)
      Accept the given file if its name matches the pattern.
      Specified by:
      accept in interface FileListFilter<F>
      Specified by:
      accept in class AbstractFileListFilter<F>
      Parameters:
      file - The file.
      Returns:
      true if the file passes the filter.
      See Also:
    • getFilename

      protected abstract String getFilename(F file)
      Subclasses must implement this method to extract the file's name.
      Parameters:
      file - The file.
      Returns:
      The file name.