Class FileSetManager

java.lang.Object
org.apache.maven.shared.model.fileset.util.FileSetManager

public class FileSetManager extends Object
Provides operations for use with FileSet instances, such as retrieving the included/excluded files, deleting all matching entries, etc.
Author:
jdcasey
  • Constructor Details

    • FileSetManager

      public FileSetManager(org.slf4j.Logger logger, boolean verbose)
      Create a new manager instance with the supplied log instance and flag for whether to output verbose messages.
      Parameters:
      logger - the logger instance
      verbose - whether to output verbose messages
    • FileSetManager

      public FileSetManager(org.slf4j.Logger logger)
      Create a new manager instance with the supplied log instance. Verbose flag is set to false.
      Parameters:
      logger - The log instance
    • FileSetManager

      public FileSetManager()
      Create a new manager instance with an own logger. Verbose flag is set to false.
  • Method Details

    • mapIncludedFiles

      public Map<String,String> mapIncludedFiles(FileSet fileSet) throws MapperException
      Parameters:
      fileSet - FileSet
      Returns:
      the included files as map
      Throws:
      MapperException - if any
      See Also:
    • getIncludedFiles

      public String[] getIncludedFiles(FileSet fileSet)
      Get all the filenames which have been included by the rules in this fileset.
      Parameters:
      fileSet - The fileset defining rules for inclusion/exclusion, and base directory.
      Returns:
      the array of matching filenames, relative to the basedir of the file-set.
    • getIncludedDirectories

      public String[] getIncludedDirectories(FileSet fileSet)
      Get all the directory names which have been included by the rules in this fileset.
      Parameters:
      fileSet - The fileset defining rules for inclusion/exclusion, and base directory.
      Returns:
      the array of matching dirnames, relative to the basedir of the file-set.
    • getExcludedFiles

      public String[] getExcludedFiles(FileSet fileSet)
      Get all the filenames which have been excluded by the rules in this fileset.
      Parameters:
      fileSet - The fileset defining rules for inclusion/exclusion, and base directory.
      Returns:
      the array of non-matching filenames, relative to the basedir of the file-set.
    • getExcludedDirectories

      public String[] getExcludedDirectories(FileSet fileSet)
      Get all the directory names which have been excluded by the rules in this fileset.
      Parameters:
      fileSet - The fileset defining rules for inclusion/exclusion, and base directory.
      Returns:
      the array of non-matching dirnames, relative to the basedir of the file-set.
    • delete

      public void delete(FileSet fileSet) throws IOException
      Delete the matching files and directories for the given file-set definition.
      Parameters:
      fileSet - The file-set matching rules, along with search base directory
      Throws:
      IOException - If a matching file cannot be deleted
    • delete

      public void delete(FileSet fileSet, boolean throwsError) throws IOException
      Delete the matching files and directories for the given file-set definition.
      Parameters:
      fileSet - The file-set matching rules, along with search base directory.
      throwsError - Throw IOException when errors have occurred by deleting files or directories.
      Throws:
      IOException - If a matching file cannot be deleted and throwsError=true, otherwise print warning messages.