Show TOC

Configuring the Extended File/FTP AdapterLocate this document in the navigation structure

Use

The extended file/FTP adapter is based on the file/FTP adapter in Adapter Engine (Java SE).

Note

The file/FTP adapter is referred to as standard file/FTP adapter in the following.

The extended file/FTP adapter provides the following additional functions (with regard to the standard file/FTP adapter):

  • You can process files from multiple directories with the same interface and namespace by using indexes.

  • You can configure the adapter in a way that inbound files are not overwritten, unless specifically required.

  • The adapter supports pre- and post processing.

  • You can apply extended file name definition patterns.

  • You can process files in order of creation time across directories.

  • You can identify the message type based on the message content.

  • You can make sure that empty files are not processed.

File Processing from Multiple Directories with the Same Interface and Namespace

The standard file/FTP adapter handles a single directory per each message type and does not support EOIO serialization across multiple directories or different data structures.

In addition to that, the extended file/FTP adapter supports indexed configuration parameters in order to create virtual sections.

However, note the following:

  • You need to configure the same polling and retry interval for all directories.

  • The Quality of Service has to be set to EOIO.

  • The maximum number of indices is 100.

  • There is no index in the first section.

    Entries in the sections from 2 to 10 have an index of a single digit starting from 1 (1 to 9). Entries in the sections from 11 to 99 have a two digits index (10 to 99).

Never Overwrite Inbound Files

Using the standard file/FTP adapter, with the parameter file.overWrite you can specify if inbound files are to be overwritten or not.

The extended file/FTP adapter checks whether a file with same file name exists in the inbound directory before writing the message into it. If it does, the receiver adapter logs an error and behaves according to the configured Quality of Service. If the Quality of Service is specified as EO, the adapter continues with the processing of the next file. If the Quality of Service is EOIO, the adapter stops processing of the next file.

Support of Pre- and Post-Processing

Using the standard file/FTP adapter, with parameter file.execute you can configure if an operating system command has to be executed after the file processing has been performed successfully for both inbound and outbound scenarios.

The extended file/FTP adapter enables configuration of both pre processing and post processing scripts and provides API for writing custom specific pre/post processing modules, which are called before/after message processing.

Extended File Name Definition Patterns

The extended file/FTP adapter provides more flexible file name generation patterns for file.writeMode parameter than the standard J2SE File adapter. Values when using the standard file/FTP adapter: Append, addTimeStamp, addMessageId, addCounter New possible values when using the extended file/FTP adapter: see the following table

Values for the file.writeMode Parameter

Option

Description

File Name

name.uxt

Base file name + Unique 3 character long extension

name.uxt

name.cnt

Free text to be given in file.xfileName + Three digit counter

name.cnt

timestamp.uxt

Timestamp + Identifier in the range of 0-9 and A-Z + Unique 3 character long extension

YYYYMMDD_hhmmss_SSSX.uxt

timestamp.ext

Timestamp + Identifier in the range of 0-9 and A-Z + Extension given in file.xfileEXT

YYYYMMDD_hhmmss_SSSX.ext

timeStamp@value.uxt

Timestamp + Identifier in the range of 0-9 and A-Z + Value given in file.xfileValue + Unique 3 character long extension

YYYYMMDD_hhmmss_SSSX_value.uxt

timeStamp@value.ext

Timestamp + Identifier in the range of 0-9 and A-Z + Value given in file.xfileValue + Extension given in file.xfileEXT

YYYYMMDD_hhmmss_SSSX_value.ext

fromHeader.uxt

Value from http://sap.com/xi/XI/System/File/FileName header + Unique 3 character long extension

<value from header>.uxt

fromHeader.ext

Value from http://sap.com/xi/XI/System/File/FileName header + Extension given in file.xfileEXT

<value from header>.ext

fromHeader@value.uxt

Value from http://sap.com/xi/XI/System/File/FileName header + Value given in file.xfileValue + Unique 3 character long extension

<value from header>_value.uxt

fromHeader@value.ext

Value from http://sap.com/xi/XI/System/File/FileName header + Value given in file.xfileValue + Extension given in file.xfileEXT

<value from header>_value.ext

first17Chars.cnt

First 17 Bytes of data from the message payload + Three digit counter

<value from content>_value.cnt

first17Chars.timestamp.ext

First 17 Bytes of data from the message payload + Timestamp + Extension given in file.xfileEXT

<value from content>.YYYYMMDD_hhmmss_SSS.ext

Variable

Description

%message_content:0,17%

First 17 characters from the payload

Note that 0 and 17 are constants.

%message_header:filename%

Source file name without extension from message header

%message_header:filename.extension%

Source file name with extension from message header

%counter:3%

Generate a 3-digit incremental counter.

Note that 3 is a constant

%timestamp:yyyyMMdd_HHmmss_SSS%

Take the current timestamp.

Note that the format is a constant.

%random_numc:3%

Take a 3-digit random alphanumeric string.

Note that 3 is a constant.

%message_id%

Take the message ID.

%unique_numc:8%

Generate a unique and increasing 8-digit alphanumerical value.

Processing Files in Order of Creation Time

The standard file/FTP adapter processes files in alphabetical order or by modification date only.

The extended file/FTP adapter allows processing files by creation time by loading a custom JNI implementation. In one polling interval the adapter scans the configured directories and sorts the files found in order of their creation time. Processing is continued based on the creation time. If the adapter detects that a file is still being written by the producer, the adapter waits until the file is completely written before processing it.