Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs

public Class Rename

extends Task
Class Inheritance
Annotations
@Deprecated
Imports
java.io.File, .IOException, org.apache.tools.ant.BuildException, .Project, .Task, org.apache.tools.ant.util.FileUtils

Deprecated

The rename task is deprecated since Ant 1.2. Use move instead.

Renames a file.
Since
Ant 1.1

Field Summary

Modifier and TypeField and Description
private File
private static final FileUtils
private boolean
private File
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Renames the file src to dest
public void
setDest(File
the new name of the file.
dest
)

Sets the new name of the file.

public void
setReplace(String
on, if an existing file should be replaced.
replace
)

Sets whether an existing file should be replaced.

public void
setSrc(File
the file to rename
src
)

Sets the file to be renamed.

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

destback to summary
private File dest
FILE_UTILSback to summary
private static final FileUtils FILE_UTILS
replaceback to summary
private boolean replace
srcback to summary
private File src

Constructor Detail

Renameback to summary
public Rename()

Method Detail

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Renames the file src to dest

Exceptions
BuildException:
if the rename operation fails
setDestback to summary
public void setDest(File dest)

Sets the new name of the file.

Parameters
dest:File

the new name of the file.

setReplaceback to summary
public void setReplace(String replace)

Sets whether an existing file should be replaced.

Parameters
replace:String

on, if an existing file should be replaced.

setSrcback to summary
public void setSrc(File src)

Sets the file to be renamed.

Parameters
src:File

the file to rename