org.oddjob.io
Class RenameJob

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

public class RenameJob
extends Object
implements Runnable, Serializable

Description

Rename a file or directory.

This is a simple wrapper for Java's File.rename method and so is very limited.

Example

Rename a file and rename it back.
<oddjob>
    <job>
        <folder>
            <jobs>
                <rename id="from" name="Rename" from="${work.dir}/a.txt" to="${work.dir}/b.txt"/>
                <rename id="back" name="Rename Back" from="${work.dir}/b.txt" to="${work.dir}/a.txt"/>
            </jobs>
        </folder>
    </job>
</oddjob>
See Also:
Serialized Form
Author:
rob

Constructor Summary
RenameJob()
           
 
Method Summary
 File getFrom()
          Get the from file.
 String getName()
          Get the name.
 File getTo()
          Get the to file.
 void run()
           
 void setFrom(File file)
          Set the from file.
 void setName(String name)
          Set the name
 void setTo(File file)
          Set the to file.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RenameJob

public RenameJob()
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.

getFrom

public File getFrom()
Get the from file.

Returns:
The from file.

setFrom

public void setFrom(File file)
Set the from file.

Parameters:
The - from file.

getTo

public File getTo()
Get the to file.

Returns:
The to file.

setTo

public void setTo(File file)
Set the to file.

Parameters:
The - to file.

run

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

toString

public String toString()
Overrides:
toString in class Object