|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.ProjectComponent | +--org.apache.tools.ant.Task | +--org.apache.tools.ant.taskdefs.MatchingTask | +--org.apache.tools.ant.taskdefs.Delete
Deletes a file or directory, or set of files defined by a fileset. The original delete task would delete a file, or a set of files using the include/exclude syntax. The deltree task would delete a directory tree. This task combines the functionality of these two originally distinct tasks.
Currently Delete extends MatchingTask. This is intend only to provide backwards compatibility for a release. The future position is to use nested filesets exclusively.
Field Summary | |
protected java.io.File |
dir
|
protected java.io.File |
file
|
protected java.util.Vector |
filesets
|
protected boolean |
includeEmpty
|
protected boolean |
usedMatchingTask
|
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
fileset, useDefaultExcludes |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
Delete()
|
Method Summary | |
void |
addFileset(FileSet set)
Adds a set of files to be deleted. |
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(java.io.File d)
|
protected void |
removeFiles(java.io.File d,
java.lang.String[] files,
java.lang.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 |
setDefaultexcludes(boolean useDefaultExcludes)
Sets whether default exclusions should be used or not. |
void |
setDir(java.io.File dir)
Set the directory from which files are to be deleted |
void |
setExcludes(java.lang.String excludes)
Sets the set of exclude patterns. |
void |
setExcludesfile(java.io.File excludesfile)
Sets the name of the file containing the includes patterns. |
void |
setFailOnError(boolean failonerror)
If false, note errors but continue. |
void |
setFile(java.io.File file)
Set the name of a single file to be removed. |
void |
setIncludeEmptyDirs(boolean includeEmpty)
If true, delete empty directories. |
void |
setIncludes(java.lang.String includes)
Sets the set of include patterns. |
void |
setIncludesfile(java.io.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. |
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
addAnd, addContains, addCustom, addDate, addDepend, addDepth, addFilename, addMajority, addNone, addNot, addOr, addPresent, addSelector, addSize, appendSelector, getDirectoryScanner, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setFollowSymlinks, setProject, XsetIgnore, XsetItems |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.io.File file
protected java.io.File dir
protected java.util.Vector filesets
protected boolean usedMatchingTask
protected boolean includeEmpty
Constructor Detail |
public Delete()
Method Detail |
public void setFile(java.io.File file)
file
- the file to be deletedpublic void setDir(java.io.File dir)
dir
- the directory path.public void setVerbose(boolean verbose)
verbose
- "true" or "on"public void setQuiet(boolean quiet)
quiet
- "true" or "on"public void setFailOnError(boolean failonerror)
failonerror
- true or falsepublic void setIncludeEmptyDirs(boolean includeEmpty)
public void addFileset(FileSet set)
public PatternSet.NameEntry createInclude()
createInclude
in class MatchingTask
public PatternSet.NameEntry createIncludesFile()
createIncludesFile
in class MatchingTask
public PatternSet.NameEntry createExclude()
createExclude
in class MatchingTask
public PatternSet.NameEntry createExcludesFile()
createExcludesFile
in class MatchingTask
public PatternSet createPatternSet()
createPatternSet
in class MatchingTask
public void setIncludes(java.lang.String includes)
setIncludes
in class MatchingTask
includes
- the string containing the include patternspublic void setExcludes(java.lang.String excludes)
setExcludes
in class MatchingTask
excludes
- the string containing the exclude patternspublic void setDefaultexcludes(boolean useDefaultExcludes)
setDefaultexcludes
in class MatchingTask
useDefaultExcludes
- "true"|"on"|"yes" when default exclusions
should be used, "false"|"off"|"no" when they
shouldn't be used.public void setIncludesfile(java.io.File includesfile)
setIncludesfile
in class MatchingTask
includesfile
- A string containing the filename to fetch
the include patterns from.public void setExcludesfile(java.io.File excludesfile)
setExcludesfile
in class MatchingTask
excludesfile
- A string containing the filename to fetch
the include patterns from.public void execute() throws BuildException
execute
in class Task
BuildException
- if something goes wrong with the buildprotected void removeDir(java.io.File d)
protected void removeFiles(java.io.File d, java.lang.String[] files, java.lang.String[] dirs)
d
- directory to work fromfiles
- array of files to delete; can be of zero lengthdirs
- array of directories to delete; can of zero length
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |