SFTP Predefined Operations

The following predefined SFTP operations are available:

cd

Changes the working directory on the remote SFTP server.

Input Parameters

path String Absolute or relative path of the directory that you want as the working directory on the remote SFTP server.

Output Parameters

returnCode String Standard SFTP protocol return code.
returnMsg String Text message describing the return code.

chgrp

Changes the group ownership of one or more remote files.

Input Parameters

groupId String Numeric group identifier of the group to which you want to transfer ownership of the remote files.
path String Absolute or relative path of the remote files.

Output Parameters

returnCode String Standard SFTP protocol return code.
returnMsg String Text message describing the return code.

chmod

Changes permissions of one or more remote files.

Input Parameters

mode String The permission mode to apply to the remote file (for example, 777).
path String Absolute or relative path of the remote files.

Output Parameters

returnCode String Standard SFTP protocol return code.
returnMsg String Text message describing the return code.

chown

Changes the owning user of one or more remote files.

Input Parameters

uid String Numeric user ID of the new owning user of the file.
path String Absolute or relative path of the remote files.

Output Parameters

returnCode String Standard SFTP protocol return code.
returnMsg String Text message describing the return code.

get

Retrieves a file from a remote SFTP server.

Input Parameters

remoteFile String Absolute or relative path of the remote file.

Output Parameters

returnCode String Standard SFTP protocol return code.
returnMsg String Text message describing the return code.
contentStream Object A java.io.InputStream object.

ls

Retrieves the remote directory listing of the specified path. If path is not specified, the ls service retrieves the file listing of the current remote directory. The ls service also retrieves additional details such as permissions and ownership information.

Input Parameters

path String Optional. Absolute or relative path of the remote directory. If no path is specified, the ls service retrieves the directory listing of the current remote directory. You can use the wildcard characters asterisk (*) and question mark (?) after the last slash mark (/) to view all remote directories that match the specified path.

Output Parameters

returnCode String Standard SFTP protocol return code.
returnMsg String Text message describing the return code.
dirList Document List of directories matching the pattern specified in the path parameter. This document has the following parameters:
fileName: String Specifies the name of the remote file.
fileSize: String Specifies the size of the remote file.
permissions: String Specifies the access permission of the file (read, write, or execute).
lastAccessTime: String Specifies the time when the file was last accessed.
lastModifiedTime: String Specifies the time when the file was last modified.
uid: String Specifies the user ID of the file owner.
gid: String Specifies the group ID associated with the file.
longName: String Specifies the long name of the ls entry. It contains all the parameters separated by a space.

mkdir

Creates a new remote directory.

Input Parameters

path String Absolute or relative path of the remote directory where you want to create a new directory.

Output Parameters

returnCode String Standard SFTP protocol return code.
returnMsg String Text message describing the return code.

put

Transfers a file to a remote SFTP server.

Input Parameters

contentStream java.io.InputStream Data to be transferred to the remote file.
remoteFile String Absolute or relative path of the remote file to which the contentStream would be written based on the mode.
mode String Optional. Specifies how the local file is to be transferred to the remote SFTP server. Set to:
overwrite to overwrite the contents of the remote file with the contents of the contentStream. This is the default.
append to append the entire contents of the contentStream to the remote file.
resume to resume writing the contents of the contentStream to the remote file from the point the writing was stopped during previous SFTP sessions.

Output Parameters

returnCode String Standard SFTP protocol return code.
returnMsg String Text message describing the return code.

pwd

Displays the remote working directory in the SFTP server.

Input Parameters

None.

Output Parameters

returnCode String Standard SFTP protocol return code.
returnMsg String Text message describing the return code.
path String Absolute or relative path of the working directory on the remote SFTP server.

rename

Renames a file or directory on a remote SFTP server.

Input Parameters

oldPath String Fully qualified name of the file you want to rename (for example, temp/oldname.txt).
newPath String New fully qualified name for the file (for example, temp/newname.txt).

Output Parameters

returnCode String Standard SFTP protocol return code.
returnMsg String Text message describing the return code.

rm

Deletes one or more remote files on the SFTP server.

Input Parameters

path String Absolute or relative path of the file you want to delete.

Output Parameters

returnCode String Standard SFTP protocol return code.
returnMsg String Text message describing the return code.

rmdir

Deletes one or more remote directories on the SFTP server.

Input Parameters

path String Absolute or relative path of the directory you want to delete.

Output Parameters

returnCode String Standard SFTP protocol return code.
returnMsg String Text message describing the return code.

Usage Notes

The remote directories that you want to delete must be empty.