FTP Predefined Operations

The following predefined FTP operations are available:

getFile

Retrieves a file from a remote FTP server.

Input Parameters

remoteFile String Name of the remote file.
transferType String FTP file transfer mode (ASCII or binary). The default is ASCII.

Output Parameters

contentStream Object A java.io.InputStream object.
statusCode String Standard FTP protocol status code.
statusMessage String Standard FTP protocol status message.

listFiles

Returns a list of file names in a specified remote directory. If path is not specified, the operation retrieves the file listing of the current remote directory. The operation also retrieves additional details such as permissions and ownership information.

Input Parameters

remotePath String Optional. Absolute or relative path of the remote directory. If remotepath is not specified, the listFiles operation 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.
listFilter String Optional. Filter that specifies the names of the files to include in the list (for example, *.txt).

Output Parameters

fileList [] String List List of file names matching listFilter.
statusCode String Standard FTP protocol status code.
statusMessage String Standard FTP protocol status message.

deleteFiles

Delete file(s) from a remote FTP server.

Input Parameters

remotePath String Optional. Absolute or relative path of the remote directory. If remotepath is not specified, the deleteFiles operation deletes 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.
deleteFilter String Optional. Filter that specifies the names of the files to be deleted (for example, *.txt).

Output Parameters

filesDeleted [] String List List of deleted files that match the deleteFilter.
filesNotDeleted [] String List List of files not deleted.
statuscode String Standard FTP protocol status code.
statusmsg String Standard FTP protocol status message.

putFile

Transfers a file to a remote FTP server.

Input Parameters

remoteFile String The name of the remote file.
transferType String FTP file transfer mode (ascii or binary). The default is ascii.
writeOption String Optional. Indicates whether to send a STOR or a STOU (Store as Unique File) command to the remote FTP server. Set to:
true to send a STOU (Store as Unique File) command.
false to send a STOR command. This is the default.
contentStream java.io.InputStream, byte[ ], or String Data to be transferred to the remote file.

Output Parameters

statusCode String Standard FTP protocol status code.
statusMessage String Standard FTP protocol status message.

Usage Notes

Some FTP servers do not support “putting” a unique file. When using the putFile operation to put a unique file to an FTP server that does not support putting a unique file, you may encounter the following error:com.wm.app.b2b.server.ServiceException: 500 'STOU': command not understood.

renameFile

Renames a file on a remote FTP server.

Input Parameters

oldFileName String Fully qualified name of the file you want to rename (for example, temp/oldfilename.txt).
newFileName String Fully qualified name of the new file (for example, temp/newfilename.txt).

Output Parameters

StatusCode String Standard FTP protocol status code.
StatusMessage String Standard FTP protocol status message.