Integration Server 10.11 | Built-In Services Reference Guide | Client Folder | Summary of Elements in this Folder | pub.client.ftp:get
 
pub.client.ftp:get
WmPublic. Retrieves a file from a remote FTP server. (This service corresponds to the standard FTP command get.)
Input Parameters
sessionkey
String Unique key for the current FTP session. The sessionkey is returned by the pub.client.ftp:login service.
transfermode
String FTP file transfer mode (ascii or binary). The default is ascii.
localfile
String Optional. Name of a local file where the retrieved file is to be saved.
remotefile
String Name of the remote file.
encoding
String Optional. Character set in which the file is encoded. This variable is required to convert the file to bytes correctly. Specify an IANA-registered character set (for example: ISO-8859-1).
If this variable is null, the encoding currently set for the FTP session is used. If encoding was never set for this FTP session, the default JVM encoding is used.
largefilethreshold
String Optional. Defines the size (in bytes) of a "large" file. For more information, see the Usage Notes.
If you...
Then...
Set to 0
All files will be considered large files. This means:
*The output parameter islargefile will always be true.
*The file content will be returned in the output parameter contentstream (as a java.io.InputStream object).
*The output parameter content will be null.
Set to any value greater than 0
Any file larger than the value you specify will be considered large. This means:
*The output parameter islargefile will be true.
*The file content will be returned in the output parameter contentstream (as a java.io.InputStream object).
*The output parameter content will be null.
Leave blank
No file is considered large. This means:
*The output parameter islargefile will always be false.
*The file content will be returned in the output parameter content.
*The output parameter contentstream will be null.
cleanlinefeeds
String Optional. Indicates whether the service should retain or remove carriage return characters at the end of each line of text. Set to:
*true to remove carriage returns.
*false to retain carriage returns. This is the default.
Output Parameters
content
byte[ ] Data retrieved from the remote file.
returncode
String Standard FTP protocol return code.
returnmsg
String Standard FTP protocol return message.
logmsg
String FTP log messages for the entire user session.
islargefile
String Indicates whether the file is considered to be large (as specified by the input parameter largefilethreshold). A value of:
*true indicates that the file is larger than the value of largethreshold.
*false indicates that the file is not larger than the value of largethreshold (or largethreshold is blank).
contentstream
Object An java.io.InputStream object.
Usage Notes
The largefilethreshold parameter improves the ability of pub.client.ftp:get to retrieve larger files. If a retrieved file is larger than the size specified in the largefilethreshold parameter, and the localfile parameter is empty (which means the retrieved file is retrieved to memory, not to a file on disk), the Integration Server streams the large file to a temporary file. While this will improve the scalability of pub.client.ftp:get, it will also reduce the throughput of the operation because the retrieved file will be written to a temporary file.
Tip:
Due to the impact to the throughput of pub.client.ftp:get when streaming is enabled, you should set the value for largefilethreshold to a sufficiently large value so that it causes only minimal degradation to throughput and yet allows the service to retrieve large files without encountering an OutOfMemory exception.
See Also
pub.io:close