org.oddjob.io
Class DeleteJob

java.lang.Object
  extended by org.oddjob.io.DeleteJob
All Implemented Interfaces:
Serializable, Runnable

public class DeleteJob
extends Object
implements Runnable, Serializable

Description

Delete a file or directory, or files and directories.

Unless the force property is set, this job will cause an exception if an attempt is made to delete a non empty directory.

Example

Delete all files from a directory. The directory is the first of Oddjob's arguments.
<oddjob id="this">
    <job>
        <delete>
            <files>
                <files files="${this.args[0]}/*"/>
            </files>
        </delete>
    </job>
</oddjob>
See Also:
Serialized Form
Author:
Rob Gordon

Constructor Summary
DeleteJob()
           
 
Method Summary
 File[] getFiles()
          Get the files.
 boolean getForce()
          Geter for force property.
 String getName()
          Get the name.
 void run()
           
 void setFiles(File[] files)
          Set the files.
 void setForce(boolean force)
          Setter for force property.
 void setName(String name)
          Set the name
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeleteJob

public DeleteJob()
Method Detail

getName

public String getName()
Get the name.

Returns:
The name.

setName

public void setName(String name)
Set the name

Parameters:
name - The name.

getFiles

public File[] getFiles()
Get the files.

Returns:
The files.

setFiles

public void setFiles(File[] files)
Set the files.

Parameters:
The - files.

getForce

public boolean getForce()
Geter for force property.

Returns:
The force property.

setForce

public void setForce(boolean force)
Setter for force property.

Parameters:
force - The force property.

run

public void run()
Specified by:
run in interface Runnable

toString

public String toString()
Overrides:
toString in class Object