<delete>
Purpose/Function
Delete files and/or directories. One or more URIs can be added. Alternatively, one can indicate a directory or a pattern, which will force an ls-
operation first.
Attributes
NAME |
TYPE |
DEFAULT VALUE |
DESCRIPTION |
---|---|---|---|
cleanup |
|
true |
delete the cache(s) upon termination of the operation |
copyCache |
|
|
delete the source entries in this cache |
copyCacheFile |
|
|
delete the source entries in this cache |
dir |
|
|
delete this entire directory |
listCache |
|
|
delete the entries in this cache |
listCacheFile |
|
|
delete the entries in this cache |
Listener control attributes
NAME |
TYPE |
DEFAULT VALUE |
DESCRIPTION |
---|---|---|---|
event |
|
true |
if listener is a |
log4j |
|
false |
if listener is a |
stdout |
|
false |
if listener is a |
Elements
TAG |
TYPE |
COUNT |
DESCRIPTION |
---|---|---|---|
|
|
0:1 |
configuration with additional non-default settings |
|
|
0:1 |
pattern to use with ls-operation |
|
|
0:N |
locations of files to delete |
Listener elements
TAG |
TYPE |
COUNT |
DESCRIPTION |
---|---|---|---|
|
|
0:N |
generic tag, must be used in conjunction with xmlns:absoluteTag namespace |
|
|
0:N |
built-in type; see listeners |
|
|
0:N |
built-in type; see listeners |
|
|
0:N |
built-in type; see listeners |
|
|
0:N |
built-in type; see listeners |
ReturnValues
DEFAULT NAME |
TYPE |
---|---|
delete |
|
NOTES
- For a given task, added URIs must all have the same scheme and endpoint.
- Cleanup defaults to true, so caches that are used will be deleted unless otherwise indicated. The operation is returned only if cleanup is false.
- includeAncestors is always false for this task; the ancestors of individually added
<uri>
elements cannot be deleted (more systematic deletion requires either the directory URI or a pattern). - If directories which remain empty after the deletion should also be deleted,
delete-all-empty-dirs
must be explicitly set to true in the configuration (see example below). - It is possible to by-pass adding either URIs or a
UriPattern
by pointing the task at pre-existing caches, either as objects in the environment or as files. - Any additional settings passed in using the configuration object will be added to the default settings (the latter must be explicitly overridden if they are not desired).
- An
Ls-
operation done in conjunction with<delete>
by adding a<pattern>
or setting dir will automatically set the list-recursive property to true.
Examples
<ogrescript> <delete uri="file:/tmp/dir0/file-0"/> <delete> <configuration> <property name="delete-all-empty-dirs" value="true" type="boolean"/> </configuration> <pattern base="file:/tmp/dir0/"> <include>**/file-1</include> </pattern> </delete> <delete> <uri>file:/tmp/dir1/file-3</uri> <uri>file:/tmp/dir1/file-7</uri> </delete> <delete dir="file:/tmp/dir2"/> ... </ogrescript>