IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > FTP > Plan for adapter implementation

Adapter customization with Custom Parser Class

The WebSphere Adapter for FTP uses Apache Commons Net API v2.0 to connect to the FTP server. The adapter works with the servers that provide standard listing format such as most UNIX or Linux built-in servers do. If the FTP server ls -l output is different from the standard format, use the CustomParserClassname property and set an appropriate class name to parse the output. The CustomParserClassName property, which is in the activation specification and in the managed connection factory, must contain the complete path of the class.

Commons Net API provides an interface, org.apache.commons.net.ftp.FTPFileEntryParser, that you can implement to parse the long list (ls -l) output. By using the class that implements this interface, the adapter can work with FTP servers that do not provide standard listing. The adapter provides a basic implementation of this interface. The class name is com.ibm.j2ca.ftp.util.FTPLongListEntryParser.

The following methods are in the Java™ interface:

package org.apache.commons.net.ftp;
public interface FTPFileEntryParser{
FTPFile parseFTPEntry(String listEntry);
String readNextEntry(BufferedReader reader) throws IOException;
List preparse(List original);} 

For more information about each of the methods in the Apache Commons Net API v2.0 documentation, see http://commons.apache.org/net/

If the FTP server generates MS-DOS type listing (such as the format returned by Windows built-in Internet Information Services (IIS) FTP server configured in MS-DOS directory listing style), you need to implement a class based on org.commons.apache.net.ftp.parser.NTFTPEntryParser. The NTFTPEntryParser is provided by Apache Commons Net API.

For any other format of the directory listing, implement the appropriate parser class and provide the class name in the Custom Parser Class Name property.

Plan for adapter implementation