File.rename

Overview | Methods | This Package | All Packages

File.rename

Renames an existing file or directory.

Syntax

public static void rename( String curPath, String newPath )

Parameters

curPath

The path of the file or directory to rename.

newPath

The new path of the file or directory.

Exceptions

WinIOException thrown if an error occurs.

Remarks

The curPath parameter must refer to an existing file or directory. The newPath parameter specifies the new file name or directory name. The new name must not exist. A new file can be on a different file system or drive. A new directory must be on the same drive.