Rename File

The Rename File activity is a synchronous activity that is used to rename or move files. This activity can also rename directories. However, you cannot use this activity to move the directory to a new location.

General

The General tab consists of the following fields.

Field Literal Value/Process Property/Module Property Description
Name None The name to be displayed as a label of the activity in the process.
From Filename Yes The path and name of the file to rename or move, or the path and name of the directory to rename.

The value in this element must be an absolute path.

To Filename Yes The new name and location of the file or directory. The files can be moved to a new location, but the directory location remains unchanged.

The value of this element must be an absolute path.

Overwrite None Select this check box to overwrite the existing file with the same name when renaming or moving.

If not selected, the activity raises an exception, if the specified file or directory exists.

Create Non-Existing Directories None When this check box is selected, the activity creates all directories in the specified path, if they do not already exist.

If not selected and one or more directories in the specified path do not exist, it throws an exception.

Include Timestamp None Select the check box to display timestamp, in addition to the date.

Description

Provide a short description for the activity.

Input

The following is the input for the activity.

Input Item Datatype Description
fromFileName string The path and name of the file to rename or move, or the path and name of the directory to rename.

The value in this element must be an absolute path.

toFileName string The new name and location of the file or directory. The files can be moved to a new location, but the directory location remains unchanged.

The value of this element must be an absolute path.

Output

The following is the output for the activity.

Output Item Datatype Description
fileInfo complex This element contains the fullName, fileName, location, type, readProtected, writeProtected, size, and lastModified data.
fullName string The name of the file (or directory) including the path information.
fileName string The name of the file (or directory) without the path information.
location string The path to the file or the directory.
configuredFileName string An optional element. This element is not populated by this activity.
type string The file type.
readProtected boolean Signifies whether the file or directory is protected from reading
writeProtected boolean Signifies whether the file or directory is protected from writing
size integer The size of file in bytes.
lastModified string The timestamp indicating when the file was last modified.

Fault

The Fault tab lists the possible exceptions generated by this activity. For more information about error codes and the corrective action to take, see the TIBCO ActiveMatrix BusinessWorks™ Error Codes guide.

Fault Generated When..
FileNotFoundException The file does not exist.
IllegalRenameException The destination file exists and its type is different than the type of the source file.
FileAlreadyExistsException The file already exists.
FileIOException An input/output exception occurred when trying to rename the file or directory.

This exception is also encountered while attempting to move a directory.