public class FileSetManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String[] |
EMPTY_STRING_ARRAY |
private org.apache.maven.shared.io.logging.MessageHolder |
messages |
private boolean |
verbose |
Constructor and Description |
---|
FileSetManager()
Create a new manager instance with an empty messages.
|
FileSetManager(org.apache.maven.plugin.logging.Log log)
Create a new manager instance with the supplied log instance.
|
FileSetManager(org.apache.maven.plugin.logging.Log log,
boolean verbose)
Create a new manager instance with the supplied log instance and flag for whether to output verbose messages.
|
FileSetManager(org.codehaus.plexus.logging.Logger log)
Create a new manager instance with the supplied log instance.
|
FileSetManager(org.codehaus.plexus.logging.Logger log,
boolean verbose)
Create a new manager instance with the supplied log instance and flag for whether to output verbose messages.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
delete(java.io.File f)
Delete a file
|
void |
delete(FileSet fileSet)
Delete the matching files and directories for the given file-set definition.
|
void |
delete(FileSet fileSet,
boolean throwsError)
Delete the matching files and directories for the given file-set definition.
|
private void |
excludeParentDirectoriesOfExcludedPaths(java.util.List<java.lang.String> excludedPaths,
java.util.Set<java.lang.String> deletablePaths)
Removes all parent directories of the already excluded files/directories from the given set of deletable
directories.
|
private java.util.Set<java.lang.String> |
findDeletableDirectories(FileSet fileSet) |
private java.util.Set<java.lang.String> |
findDeletableFiles(FileSet fileSet,
java.util.Set<java.lang.String> deletableDirectories) |
private java.util.Set<java.lang.String> |
findDeletablePaths(FileSet fileSet) |
java.lang.String[] |
getExcludedDirectories(FileSet fileSet)
Get all the directory names which have been excluded by the rules in this fileset.
|
java.lang.String[] |
getExcludedFiles(FileSet fileSet)
Get all the filenames which have been excluded by the rules in this fileset.
|
java.lang.String[] |
getIncludedDirectories(FileSet fileSet)
Get all the directory names which have been included by the rules in this fileset.
|
java.lang.String[] |
getIncludedFiles(FileSet fileSet)
Get all the filenames which have been included by the rules in this fileset.
|
private boolean |
isSymlink(java.io.File file) |
java.util.Map<java.lang.String,java.lang.String> |
mapIncludedFiles(FileSet fileSet) |
private void |
removeDir(java.io.File dir,
boolean followSymlinks,
boolean throwsError,
java.util.List<java.lang.String> warnMessages)
Delete a directory
|
private org.apache.maven.shared.utils.io.DirectoryScanner |
scan(FileSet fileSet) |
private static final java.lang.String[] EMPTY_STRING_ARRAY
private final boolean verbose
private org.apache.maven.shared.io.logging.MessageHolder messages
public FileSetManager(org.apache.maven.plugin.logging.Log log, boolean verbose)
log
- The mojo log instanceverbose
- Whether to output verbose messagespublic FileSetManager(org.apache.maven.plugin.logging.Log log)
log
- The mojo log instancepublic FileSetManager(org.codehaus.plexus.logging.Logger log, boolean verbose)
log
- The mojo log instanceverbose
- Whether to output verbose messagespublic FileSetManager(org.codehaus.plexus.logging.Logger log)
log
- The mojo log instancepublic FileSetManager()
public java.util.Map<java.lang.String,java.lang.String> mapIncludedFiles(FileSet fileSet) throws MapperException
fileSet
- FileSet
MapperException
- if anygetIncludedFiles(FileSet)
public java.lang.String[] getIncludedFiles(FileSet fileSet)
fileSet
- The fileset defining rules for inclusion/exclusion, and base directory.public java.lang.String[] getIncludedDirectories(FileSet fileSet)
fileSet
- The fileset defining rules for inclusion/exclusion, and base directory.public java.lang.String[] getExcludedFiles(FileSet fileSet)
fileSet
- The fileset defining rules for inclusion/exclusion, and base directory.public java.lang.String[] getExcludedDirectories(FileSet fileSet)
fileSet
- The fileset defining rules for inclusion/exclusion, and base directory.public void delete(FileSet fileSet) throws java.io.IOException
fileSet
- The file-set matching rules, along with search base directoryjava.io.IOException
- If a matching file cannot be deletedpublic void delete(FileSet fileSet, boolean throwsError) throws java.io.IOException
fileSet
- The file-set matching rules, along with search base directory.throwsError
- Throw IOException when errors have occurred by deleting files or directories.java.io.IOException
- If a matching file cannot be deleted and throwsError=true
, otherwise print
warning messages.private boolean isSymlink(java.io.File file) throws java.io.IOException
java.io.IOException
private java.util.Set<java.lang.String> findDeletablePaths(FileSet fileSet)
private java.util.Set<java.lang.String> findDeletableDirectories(FileSet fileSet)
private java.util.Set<java.lang.String> findDeletableFiles(FileSet fileSet, java.util.Set<java.lang.String> deletableDirectories)
private void excludeParentDirectoriesOfExcludedPaths(java.util.List<java.lang.String> excludedPaths, java.util.Set<java.lang.String> deletablePaths)
excludedPaths
- The relative paths of the files/directories which are excluded from deletion, must not be
null
.deletablePaths
- The relative paths to files/directories which are scheduled for deletion, must not be
null
.private void removeDir(java.io.File dir, boolean followSymlinks, boolean throwsError, java.util.List<java.lang.String> warnMessages) throws java.io.IOException
dir
- the directory to deletefollowSymlinks
- whether to follow symbolic links, or simply delete the linkthrowsError
- Throw IOException when errors have occurred by deleting files or directories.warnMessages
- A list of warning messages used when throwsError=false
.java.io.IOException
- If a matching file cannot be deleted and throwsError=true
.private boolean delete(java.io.File f)
f
- a fileprivate org.apache.maven.shared.utils.io.DirectoryScanner scan(FileSet fileSet)