org.apache.tools.ant.taskdefs
Class Rename

java.lang.Object
  |
  +--org.apache.tools.ant.Task
        |
        +--org.apache.tools.ant.taskdefs.Rename

public class Rename
extends Task

Renames a file.

Author:
haas@softwired.ch

Fields inherited from class org.apache.tools.ant.Task
description, location, project, target
 
Constructor Summary
Rename()
           
 
Method Summary
 void execute()
          Renames the file src to dest
 void setDest(java.lang.String dest)
          Sets the new name of the file.
 void setReplace(java.lang.String replace)
          Sets wheter an existing file should be replaced.
 void setSrc(java.lang.String src)
          Sets the file to be renamed.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, init, setDescription, setLocation, setTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rename

public Rename()
Method Detail

setSrc

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

setDest

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

setReplace

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

execute

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


Copyright © 2000 Apache Software Foundation. All Rights Reserved.