Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

File Endpoint Reference

File-Endpoint-48x32

File Endpoint Reference

Overview

The File endpoint implements a transport channel so that your Mule application can exchange files with a file system. You can implement the File Endpoint as an inbound endpoint (i.e., a message source), or as an outbound endpoint. This endpoint implements a one-way exchange pattern only.

Configuration

File endpoint configuration consists of two stages:

  1. Place the File endpoint within the Mule flow you are developing:

    1. If you place the File endpoint at the beginning of the flow, it will act as an inbound endpoint (i.e., message source), triggering the flow whenever it receives an incoming file. (You can also use the Composite Source scope to wrap the File endpoint along with other, similar endpoints (such as FTP, SFTP, or UDP) so that your flow can receive files through multiple transport channels).

    2. If you place the File building block in the middle or at the end of the flow, it will serve as an outbound endpoint, passing files to the connected file system.

  2. Configure the File endpoint by providing values for the fields on the various tabs on the Properties pane.

Open the File Endpoint Properties pane by double-clicking the File icon on the Message Flow canvas. The Properties pane has four tabs:

General Tab

FileEndpointGen

Property Description

Display Name

Defaults to the generic endpoint name. Change the display name, which must be alpha-numeric, to reflect the endpoint’s specific role, i.e. Order Entry Endpoint

Path

The target directory on the connected file system. If File is implemented as an inbound endpoint, this would be the location within the connected file system of the file being transferred into the flow. For an outbound File endpoint, this would be the directory on the connected file system to which the file currently in the flow will be written.

Move to Pattern

The pattern to be used when moving a file according to the Move to Directory property. It can use the patterns specified by the filename parser configured (often through a Connector template) for this particular File endpoint.

Move to Directory

(Applies to inbound File endpoints only). Typically, the file being received is simply read by the inbound endpoint and dispatched to the next building block in the flow. To save a copy on the Mule host machine, specify a path in this field.

Polling Frequency

(Applies to inbound File endpoints only). Specify how often the endpoint should check for incoming messages. The default value is 1000 ms.

File Age

(Applies to inbound File endpoints only). Sets a minimum period a file must wait before it is processed. This helps ensure that long files are received in their entirety before processing starts. However, Mule and the connected file system must be on synchronized time for this feature to work properly.

File Name Regex Filter

(Applies to inbound File endpoints only). Configure a filter to restrict the files being processed.

Output Pattern

(Applies to outbound File endpoint only). Specify a pattern for naming files that get sent from the File endpoint to the connected file system. If this is not set, the File endpoint uses the same file-naming pattern used for incoming files.

Advanced Tab

FileEndpointAdv

Property Description

Address

Enter the address for this endpoint, i.e. http://localhost:8081/file.

Response Timeout

Specify how long (in ms) the endpoint waits for a response from the connected file system.

Encoding

Choose from a drop-down list the character set used for message data. (i.e. UTF-8).

Disable Transport Transformer

Check this box if you do not want to use the endpoint’s default response transport.

MIME Type

Select from the dropdown list one of the formats this endpoint supports.

Comparator

Specify the comparator used to sort incoming files, as in org.mule.transport.file.comparator. If you write your own comparator, it must implement the java.util.Comparator interface.

Reverse Order

Check this box to reverse the normal comparator sort order.

References Tab

FileEndpointRef

Property Description

Endpoint Reference

Use the dropdown list to select a previously configured global endpoint reference. If you have not created a global element for this type of endpoint, you can do so from this window by clicking Add. Click Edit to modify a previously created global element.

Connector Reference

Use the dropdown list to select a previously configured connector for this endpoint. If you have not created a connector for this type of endpoint, you can do so from this window by clicking Add. Click Edit to modify a previously created global element.

Request Transformer References

Enter a list of synchronous transformers that will be applied to the request before it is sent to the transport.

Response Transformer References

Enter a list of synchronous transformers that will be applied to the response before it is returned from the transport.

Documentation Tab

The Documentation tab lets you add optional descriptive documentation for an endpoint. Every endpoint component has a Documentation tab and optional Description field.

FileEndpointDoc

Property Description

Documentation

Enter all relevant information regarding this File endpoint. This information is displayed in Studio when you hover over the endpoint icon on the Message Flow canvas.

Reference Documentation

See the File Transport Reference for details on setting the properties for a File endpoint using an XML editor.