Configuring Java CAPS Project Components for Communication Adapters

Creating User Defined Heuristic Directory Listing Styles

You can create user defined heuristic configurations that allow you to interface with other platforms that are not listed in the Directory Listing Styles. The Batch Adapter includes a mechanism that allows you to configure a set of heuristic properties so that the underlying parser can parse the LIST command result correctly. These properties are described under FTP Heuristics Configuration Parameters.

The Batch Adapter Heuristic Properties include the following section:

There are two methods for creating custom user defined directory listing styles:

ProcedureTo Create a Custom Heuristics Configuration File

  1. Using a text editor, create a user defined configuration file containing the property settings required to interface with your target platform. You can do this by copying a section (style) from the FtpHeuristics.cfg file that is similar to the style (platform parameter settings) that you are creating, or you can copy the format provided under Heuristics Configuration File Format.

  2. Save your user defined configuration, as a CFG file, to a safe location on the application server.

  3. From the BatchFTP Environment properties, select the FTP ⇒ User Defined Heuristics Configuration File property, and enter the location and name of your user defined heuristics configuration file (for example C:\USER_DEFINED_HEURISTICS\UDH.cfg).

  4. From the BatchFTP Connectivity Map properties, select FTP ⇒ User Defined Directory Listing Style, and enter the name of your user-named style (for example MY AS400-UNIX). You are allowed to list one user-named style. This style is now the configured Directory Listing Style, superseding the value of the Directory Listing Style property.

    You can use this method to create multiple user-named styles by adding the styles to your user defined configuration file, and entering the different user defined style names in the Connectivity Map properties for each of your various FTPBatch component Adapters.

    You can also create multiple user defined configuration files if necessary, but this requires the creation of additional BatchFTP External Systems in the Environment. If you chose this method, you must copy your Environment components (drag-and-drop) to the correct BatchFTP External System before applying Automap.

Considerations

If you decide to use this method for creating custom user defined heuristic configurations, take note of the following:

ProcedureTo Modify the FTP Heuristics Configuration File

To modify the FtpHeuristics.cfg file to include your user defined heuristic configuration styles, do the following:

  1. The FtpHeuristics.cfg file is contained by the stcbatch.jar file, which is found in the following location:


    <JavaCAPS6>\netbeans\usrdir\modules\ext\batcheway\
    stcbatch.jar

    where JavaCAPS6 is the Sun Java Composite Application Platform Suite install directory.

  2. Unzip stcbatch.jar and locate the FtpHeuristics.cfg file.

  3. Open FtpHeuristics.cfg with a text editor and add your user defined heuristic configuration styles.

ProcedureTo Add User Defined Heuristic Configuration Styles

  1. Copy the User Defined section (or any other section), and paste it to the bottom of FtpHeuristics.cfg.

  2. Rename the section and each property name with your user-defined name or one of the available listings (User Defined1, User Defined2, and so forth). See the example provided under Heuristics Configuration File Format. In this example, the user defined name is MY AS400-UNIX). Only one style with a user-defined name can be specified, but 10 configuration styles can be named as User Defined1-10.

  3. Modify the new section’s properties for your target platform. See FTP Heuristics Configuration Parameters for property descriptions.

  4. Repeat steps 2-4 above to create additional User Defined configurations.

ProcedureTo Repackage the FtpHeuristics.cfg File

  1. Zip the stcbatch.jar file (including the updated FtpHeuristics.cfg file) and copy stcbatch.jar back to it’s original location.

  2. From the BatchFTP Configuration Map properties, select FTP ⇒ User Defined ⇒ Directory Listing Style, and enter the name of your user-named style (for example MY AS400-UNIX), or you can select any one of the 10 User Defined properties from the Directory Listing Style dropdown list (see Creating User Defined Heuristic Directory Listing Styles).

  3. Your configuration changes will be applied to any Projects that are built and deployed with this Netbeans IDE.

Heuristics Configuration File Format

This example includes two user-named styles (MY AS400-UNIX, and UDH NT 4.0).


#

# --------------------------------------------------------------------------

#   Section:    MY AS400-UNIX

# --------------------------------------------------------------------------

#

MY AS400-UNIX!Commands Supported By FTP 
Server!value=APPE%CWD%DELE%LIST%MKD%NOOP%PASS%QUIT%RETR%RNFR%RNTO
%SITE%STOR%TYPE%USER!set=APPE%CWD%DELE%LIST%MKD%NOOP%PASS%QUIT%RETR
%RNFR%RNTO%SITE%STOR%TYPE%USER

MY AS400-UNIX!Header Lines To Skip!value=0!set=0

MY AS400-UNIX!Header Indication Regex Expression!value=!set=

MY AS400-UNIX!Trailer Lines To Skip!value=0!set=0

MY AS400-UNIX!Trailer Indication Regex Expression!value=!set=

MY AS400-UNIX!Directory Indication Regex Expression!value=!set=

MY AS400-UNIX!File Link Real Data Available!value=No!set=No%Yes

MY AS400-UNIX!File Link Indication Regex Expression!value=!set=

MY AS400-UNIX!File Link Symbol Regex Expression!value=!set=

MY AS400-UNIX!List Line Format!value=Fixed!set=Blank Delimited%Fixed

MY AS400-UNIX!Valid File Line Minimum Position!value=52!set=52

MY AS400-UNIX!File Name Is Last Entity!value=Yes!set=No%Yes

MY AS400-UNIX!File Name Position!value=52!set=52

MY AS400-UNIX!File Name Length!value=0!set=0

MY AS400-UNIX!File Extension Position!value=0!set=0

MY AS400-UNIX!File Extension Length!value=0!set=0

MY AS400-UNIX!File Size Verifiable!value=No!set=No%Yes

MY AS400-UNIX!File Size Position!value=0!set=0

MY AS400-UNIX!File Size Length!value=0!set=0

MY AS400-UNIX!Special Envelope For Absolute Pathname!value=!set=’’

MY AS400-UNIX!Listing Directory Yields Absolute Pathnames!value=No!set=No%Yes

MY AS400-UNIX!Absolute Pathname Delimiter Set!value=///!set=///

MY AS400-UNIX!Change Directory Before Listing!value=Yes!set=No%Yes

MY AS400-UNIX!Directory Name Requires Terminator!value=No!set=No%Yes

#

#

# --------------------------------------------------------------------------

#   Section:   UDH NT 4.0

# --------------------------------------------------------------------------

#

UDH NT 4.0!Commands Supported By FTP
 Server!value=APPE%CWD%DELE%LIST%MKD%NOOP%PASS%QUIT%RETR%RNFR%RNTO%SITE%
STOR%TYPE%USER!set=APPE%CWD%DELE%LIST%MKD%NOOP%PASS%QUIT%RETR%RNFR%RNTO%SITE%
STOR%TYPE%USER

UDH NT 4.0!Header Lines To Skip!value=0!set=0

UDH NT 4.0!Header Indication Regex Expression!value=!set=

UDH NT 4.0!Trailer Lines To Skip!value=0!set=0

UDH NT 4.0!Trailer Indication Regex Expression!value=!set=

UDH NT 4.0!Directory Indication Regex Expression!value=<DIR>!set=<DIR>

UDH NT 4.0!File Link Real Data Available!value=No!set=No%Yes

UDH NT 4.0!File Link Indication Regex Expression!value=\.lnk$!set=\.lnk$

UDH NT 4.0!File Link Symbol Regex Expression!value=!set=

UDH NT 4.0!List Line Format!value=Blank Delimited!set=Blank Delimited%Fixed

UDH NT 4.0!Valid File Line Minimum Position!value=4!set=4

UDH NT 4.0!File Name Is Last Entity!value=Yes!set=No%Yes

UDH NT 4.0!File Name Position!value=4!set=4

UDH NT 4.0!File Name Length!value=0!set=0

UDH NT 4.0!File Extension Position!value=0!set=0

UDH NT 4.0!File Extension Length!value=0!set=0

UDH NT 4.0!File Size Verifiable!value=Yes!set=No%Yes

UDH NT 4.0!File Size Position!value=3!set=3

UDH NT 4.0!File Size Length!value=0!set=0

UDH NT 4.0!Special Envelope For Absolute Pathname!value=!set=

UDH NT 4.0!Listing Directory Yields Absolute Pathnames!value=No!set=No%Yes

UDH NT 4.0!Absolute Pathname Delimiter Set!value=\\\\\\!set=\\\\\\

UDH NT 4.0!Change Directory Before Listing!value=No!set=No%Yes

UDH NT 4.0!Directory Name Requires Terminator!value=No!set=No%Yes

Where to Go Next

FTP Heuristics Configuration Parameters.

Related Topics