Delete one or several files or directories.
Task package: | org.schmant.task.base |
Java package: | org.schmant.task.io |
Category: | I/O tasks |
Since: | 0.5 |
EntityFS-aware? | Yes* |
Implements: | ActionTaskFactory |
See also: | RecursiveActionTF TreeDeleteTF |
Description:
Delete one or several files or directories. Directories are not deleted recursively.
Often it is easier to call Entities.delete directly. This can be used if a build script wants to schedule a task for deleting an entity that does not exist yet, or together with a RecursiveActionTF to delete files recursively. (In the latter case, TreeDeleteTF is probably more useful.)
Required properties
Properties
logFooter | top |
The message that is logged to info
level
after the task has been successfully run.
- Setter method:
setLogFooter(String s)
parameters:s
– The footer message.- Default value:
- Empty (no footer message is logged.)
- See also:
- logHeader
logHeader | top |
The message that is logged to info
level
before the task is run.
- Setter method:
setLogHeader(String s)
parameters:s
– The header message.- Default value:
- A task class specific message.
- See also:
- logFooter
reportLevel | top |
This property is used to change the Report level for all task created by this task factory. The report level is changed for the thread running the task when the it is run, and is restored to its previous level when the it is done.
- Setter method:
setReportLevel(Level l)
Set the report levelparameters:l
– The new report level.
sources (required) | top |
A collection of files and/or directories to delete.
- Setter method:
addSource(Object o)
Add one or several sources.parameters:o
– One source object or an array or collection of source objects.
Interpreted byInterpretAsEntityStrategy
.- Setter method:
addSources(Object o)
Add one or several sources.parameters:o
– One source object or an array or collection of source objects.
Interpreted byInterpretAsEntityStrategy
.- Setter method:
clearSources()
Discard all sources.- Setter method:
setSource(Object o)
Set one or several sources and discard previously set sources.parameters:o
– One source object or an array or collection of source objects.
Interpreted byInterpretAsEntityStrategy
.- Setter method:
setSources(Object o)
Set one or several sources and discard previously set sources.parameters:o
– One source object or an array or collection of source objects.
Interpreted byInterpretAsEntityStrategy
.
traceLogging | top |
If trace logging is enabled for a task, it reports its configuration before it is run.
Trace logging may also be enabled globally for all tasks by calling TraceMode.setTraceMode(boolean).
- Setter method:
setTraceLogging(boolean b)
Enable or disable trace logging.parameters:b
– Enable trace logging?
Examples
* An EntityFS-aware task is implemented using EntityFS. This means that it uses the filter settings of DirectoryView:s and also that it often can work with other file system implementations than File-based, such as the RAM file system.