Package org.apache.tools.ant.taskdefs

# Class Rename

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.Rename

All Implemented Interfaces:
  `Cloneable`

@Deprecated public class Rename extends Task
Deprecated.
The rename task is deprecated since Ant 1.2. Use move instead.
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`

## Constructor Summary

Constructors
Constructor
Description
`Rename()`
Deprecated.

## Method Summary

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

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

`bindToOwner, 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, setDescription, setLocation, setProject`

### Methods inherited from class java.lang.Object

`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Rename

public Rename()
Deprecated.

## Method Details

### setSrc

public void setSrc(File src)
Deprecated.
Sets the file to be renamed.

Parameters:
  `src` - the file to rename

### setDest

public void setDest(File dest)
Deprecated.
Sets the new name of the file.

Parameters:
  `dest` - the new name of the file.

### setReplace

public void setReplace(String replace)
Deprecated.
Sets whether an existing file should be replaced.

Parameters:
  `replace` - `on`, if an existing file should be replaced.

### execute

public void execute() throws BuildException
Deprecated.
Renames the file `src` to `dest`

Overrides:
  `execute` in class `Task`
Throws:
  `BuildException` - if the rename operation fails