Unless the force property is set, this job will cause an exception if an attempt is made to delete a non empty directory.
dirCount | Count of the directories deleted. |
errorCount | Count of the errors. |
fileCount | Count of the files deleted. |
files | The file, directory, or files and directories to delete. |
force | Forceably delete non empty directories. |
logEvery | Logs the number of files and directories deleted every n number of items. |
maxErrors | The maximum number of errors to allow before failing. |
name | A name, can be any text. |
reallyRoot | Flag to indicate that it is the intention to delete files at the root level. |
Example 1 | Delete all files from a directory. |
Access | READ_ONLY |
Count of the directories deleted.
Access | READ_ONLY |
Count of the errors.
Access | READ_ONLY |
Count of the files deleted.
Configured By | ELEMENT |
Access | READ_WRITE |
Required | Yes. |
The file, directory, or files and directories to delete. Note the files must be valid file name, they can not contain wildcard characters. This will be the case by default if the files is used to specify the files.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No, defaults to false. |
Forceably delete non empty directories.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No, defaults to 0. |
Logs the number of files and directories deleted every n number of items. If this property is 1 then the file or directory path is logged every delete. If this property is less than one then the counts are logged only at the end.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No, defaults to 0. |
The maximum number of errors to allow before failing. Sometimes when deleting a large number of files, it is not desirable to have one or two locked files from stopping all the other files from being deleted.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
A name, can be any text.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No, defaults to false. |
Flag to indicate that it is the intention to
delete files at the root level. This is to catch the situation
where variable substitution is used to specify the file path but
the variable doesn't exists - e.g. The file specification is
${some.dir}/*
but some.dir
has not been
defined.
Delete all files from a directory. The directory is the first of Oddjob's arguments.
<oddjob id="this"> <job> <delete id="delete"> <files> <files files="${this.args[0]}/*"/> </files> </delete> </job> </oddjob>