org.apache.tools.ant.taskdefs
public class Delete extends MatchingTask
Currently Delete extends MatchingTask. This is intended only to provide backwards compatibility for a release. The future position is to use nested filesets exclusively.
Since: Ant 1.2
UNKNOWN: category="filesystem"
Field Summary | |
---|---|
protected File | dir |
protected File | file |
protected Vector | filesets |
protected boolean | includeEmpty |
protected boolean | usedMatchingTask |
Method Summary | |
---|---|
void | add(ResourceCollection rc)
Add an arbitrary ResourceCollection to be deleted. |
void | add(FileSelector selector)
add an arbitrary selector |
void | addAnd(AndSelector selector)
add an "And" selector entry on the selector list |
void | addContains(ContainsSelector selector)
add a contains selector entry on the selector list |
void | addContainsRegexp(ContainsRegexpSelector selector)
add a regular expression selector entry on the selector list |
void | addCustom(ExtendSelector selector)
add an extended selector entry on the selector list |
void | addDate(DateSelector selector)
add a selector date entry on the selector list |
void | addDepend(DependSelector selector)
add a depends selector entry on the selector list |
void | addDepth(DepthSelector selector)
add a depth selector entry on the selector list |
void | addFilename(FilenameSelector selector)
add a selector filename entry on the selector list |
void | addFileset(FileSet set)
Adds a set of files to be deleted. |
void | addMajority(MajoritySelector selector)
add a majority selector entry on the selector list |
void | addModified(ModifiedSelector selector)
add the modified selector |
void | addNone(NoneSelector selector)
add a "None" selector entry on the selector list |
void | addNot(NotSelector selector)
add a "Not" selector entry on the selector list |
void | addOr(OrSelector selector)
add an "Or" selector entry on the selector list |
void | addPresent(PresentSelector selector)
add a present selector entry on the selector list |
void | addSelector(SelectSelector selector)
add a "Select" selector entry on the selector list |
void | addSize(SizeSelector selector)
add a selector size entry on the selector list |
PatternSet.NameEntry | createExclude()
add a name entry on the exclude list |
PatternSet.NameEntry | createExcludesFile()
add a name entry on the include files list |
PatternSet.NameEntry | createInclude()
add a name entry on the include list |
PatternSet.NameEntry | createIncludesFile()
add a name entry on the include files list |
PatternSet | createPatternSet()
add a set of patterns |
void | execute()
Delete the file(s). |
protected void | removeDir(File d)
Delete a directory
|
protected void | removeFiles(File d, String[] files, String[] dirs)
remove an array of files in a directory, and a list of subdirectories
which will only be deleted if 'includeEmpty' is true |
void | setCaseSensitive(boolean isCaseSensitive)
Sets case sensitivity of the file system
|
void | setDefaultexcludes(boolean useDefaultExcludes)
Sets whether default exclusions should be used or not.
|
void | setDeleteOnExit(boolean deleteOnExit)
If true, on failure to delete, note the error and set
the deleteonexit flag, and continue
|
void | setDir(File dir)
Set the directory from which files are to be deleted
|
void | setExcludes(String excludes)
Sets the set of exclude patterns. |
void | setExcludesfile(File excludesfile)
Sets the name of the file containing the includes patterns.
|
void | setFailOnError(boolean failonerror)
If false, note errors but continue.
|
void | setFile(File file)
Set the name of a single file to be removed.
|
void | setFollowSymlinks(boolean followSymlinks)
Sets whether or not symbolic links should be followed.
|
void | setIncludeEmptyDirs(boolean includeEmpty)
If true, delete empty directories. |
void | setIncludes(String includes)
Sets the set of include patterns. |
void | setIncludesfile(File includesfile)
Sets the name of the file containing the includes patterns.
|
void | setQuiet(boolean quiet)
If true and the file does not exist, do not display a diagnostic
message or modify the exit status to reflect an error.
|
void | setVerbose(boolean verbose)
If true, list all names of deleted files.
|
Parameters: rc the filesystem-only ResourceCollection.
Parameters: selector the selector to be added
Since: Ant 1.6
Parameters: selector the selector to be added
Parameters: selector the selector to be added
Parameters: selector the selector to be added
Parameters: selector the selector to be added
Parameters: selector the selector to be added
Parameters: selector the selector to be added
Parameters: selector the selector to be added
Parameters: selector the selector to be added
Parameters: set the set of files to be deleted
Parameters: selector the selector to be added
Parameters: selector the selector to add
Since: ant 1.6
Parameters: selector the selector to be added
Parameters: selector the selector to be added
Parameters: selector the selector to be added
Parameters: selector the selector to be added
Parameters: selector the selector to be added
Parameters: selector the selector to be added
Returns: an NameEntry object to be configured
Returns: an NameEntry object to be configured
Returns: a NameEntry object to be configured
Returns: an NameEntry object to be configured
Returns: PatternSet object to be configured
Throws: BuildException if an error occurs
Parameters: d the directory to delete
Parameters: d directory to work from files array of files to delete; can be of zero length dirs array of directories to delete; can of zero length
Parameters: isCaseSensitive "true"|"on"|"yes" if file system is case sensitive, "false"|"off"|"no" when not.
Parameters: useDefaultExcludes "true"|"on"|"yes" when default exclusions should be used, "false"|"off"|"no" when they shouldn't be used.
Parameters: deleteOnExit true or false
Parameters: dir the directory path.
Parameters: excludes the string containing the exclude patterns
Parameters: excludesfile A string containing the filename to fetch the include patterns from.
Parameters: failonerror true or false
Parameters: file the file to be deleted
Parameters: followSymlinks whether or not symbolic links should be followed
Parameters: includeEmpty if true delete empty directories (only for filesets). Default is false.
Parameters: includes the string containing the include patterns
Parameters: includesfile A string containing the filename to fetch the include patterns from.
Parameters: quiet "true" or "on"
Parameters: verbose "true" or "on"