FTP Predefined Operations

The following predefined FTP operations are available:

getFile

Retrieves a file from a remote FTP server.

Input parameters
Name Description
remoteFile (String) Name of the remote file.
transferType (String) FTP file transfer mode (ASCII or binary). The default is ASCII.
Output parameters
Name Description
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 other details such as permissions and ownership information.

Input parameters
Name Description
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
Name Description
fileList [] (String) List of file names matching listFilter.
statusCode (String) Standard FTP protocol status code.
statusMessage (String) Standard FTP protocol status message.

deleteFiles

Delete the files from a remote FTP server.

Input parameters
Name Description
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
Name Description
filesDeleted [] (String) List of deleted files that match the deleteFilter.
filesNotDeleted [] (String) 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
Name Description
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.
true to send a STOU (Store as Unique File) command.
false to send a STOR command. This is the default.
contentStream 9java.io.InputStream, byte[ ], or String) Data to be transferred to the remote file.
Output parameters
Name Description
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
Name Description
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
Name Description
StatusCode (String) Standard FTP protocol status code.
StatusMessage (String) Standard FTP protocol status message.