org.apache.tools.ant.taskdefs

Class Rename

Implemented Interfaces:
Cloneable

public class Rename
extends Task

Renames a file.
Since:
Ant 1.1

Field Summary

Fields inherited from class org.apache.tools.ant.Task

target, taskName, taskType, wrapper

Fields inherited from class org.apache.tools.ant.ProjectComponent

description, location, project

Method Summary

void
execute()
Renames the file src to dest
void
setDest(File dest)
Sets the new name of the file.
void
setReplace(String replace)
Sets whether an existing file should be replaced.
void
setSrc(File src)
Sets the file to be renamed.

Methods inherited from class org.apache.tools.ant.Task

bindToOwner, execute, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

Methods inherited from class org.apache.tools.ant.ProjectComponent

clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject

Method Details

execute

public void execute()
            throws BuildException
Renames the file src to dest
Overrides:
execute in interface Task
Throws:
BuildException - The exception is thrown, if the rename operation fails.

setDest

public void setDest(File dest)
Sets the new name of the file.
Parameters:
dest - the new name of the file.

setReplace

public void setReplace(String replace)
Sets whether an existing file should be replaced.
Parameters:
replace - on, if an existing file should be replaced.

setSrc

public void setSrc(File src)
Sets the file to be renamed.
Parameters:
src - the file to rename