IBM Support

Configuring Custom parser class name property to parse the FTP server file listing output

Troubleshooting


Problem

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.

Symptom

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.
[{"Product":{"code":"SSMKUK","label":"WebSphere Adapters Family"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Adapter for FTP","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"7.0;6.2;6.1","Edition":"","Line of Business":{"code":"","label":""}}]

Product Synonym

WebSphere Adapter for FTP

Document Information

More support for:
WebSphere Adapters Family

Software version:
7.0, 6.2, 6.1

Operating system(s):
AIX, HP-UX, Linux, Solaris, Windows, z/OS

Document number:
131489

Modified date:
23 June 2018

UID

swg21410699

Manage My Notification Subscriptions