Configuring Custom parser class name property to parse the FTP server file listing output
FTP servers running on various platforms provide different listing output. The WebSphere Adapter for FTP works fine with the FTP servers that provide a standard listing format such as most UNIX platform built-in FTP servers.
The Adapter throws runtime error while working with FTP servers whose file listing output differs from the standard UNIX style format.
The Adapter throws permission related error while connecting to the FTP server to perform inbound or outbound operation.
Resolving the problem
The WebSphere Adapter for FTP can be configured to work with FTP servers whose file listing output differs from the standard UNIX style format.
WebSphere Adapter for FTP allows the user to customize the adapter to work with FTP servers with different listing formats.
The following steps needs to be performed :
1) User should provide a Java™ class implementation implementing the interface org.apache.commons.net.ftp.FTPFileEntryParser provided by the Commons Net API to handle the parsing of the listing output provided by the FTP server.
The following methods should be implemented by the Java class :
FTPFile parseFTPEntry(String listEntry);
String readNextEntry(BufferedReader reader) throws IOException;
List preparse(List original);
Additionally, In the parseFTPEntry(String listEntry) implementation, make sure that all the necessary file permissions are set on the FTPFile object.
For more information about each of the methods in the Apache Commons Net API , see http://commons.apache.org/proper/commons-net/javadocs/api-1.4.1/index.html
By default, WebSphere Adapter for FTP provides a parser class com.ibm.j2ca.ftp.util.FTPLongListEntryParser that works with FTP servers with UNIX style listing format.
2) Include the Java implementation in the build path of the Adapter module.
3) While running external service wizard for configuring the WebSphere Adapter for FTP, set the Custom parser class name property in Managed connection factory properties / Activation Specification properties to the complete path name of the class created to handle the file listing format.
The Adapter will use the implementation provided by the custom parser class to parse the file listing output from the FTP server.
WebSphere Adapter for FTP
More support for:
WebSphere Adapters Family
Adapter for FTP
Software version: 6.1, 6.2, 7.0
Operating system(s): AIX, HP-UX, Linux, Solaris, Windows, z/OS
Reference #: 1410699
Modified date: 11 October 2010