---
schema_version: "1"
id: bd194678af6b9ba9026f9cda2337042d46f3276736c46e1b47d9c86a5736077a
title: Using Anypoint Code Builder to Configure File Connector
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/file-connector/latest/file-acb-configuration.md
canonical_url: https://docs.mulesoft.com/file-connector/latest/file-acb-configuration
source_site: docs.mulesoft.com
content_type: documentation
content_hash: b1deb0b97225eaecfe76c33c55bfb58db9bf3c2949acd153eb77e3192d0f7bbf
description: MuleSoft Documentation Site
release: "1.5"
latest: true
---
---
product: File Connector
version: 1.5
is-latest-version: true
---

# Using Anypoint Code Builder to Configure File Connector

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Cloud IDE (Beta) is scheduled for retirement on August 31, 2026. August 30, 2026 is the last day you
can access Cloud IDE (Beta). Download your projects to work from Desktop IDE. Learn more in
[Migrate a Project from Cloud IDE to Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project#migrate-cloud-to-desktop).

To use Anypoint Code Builder to configure a connector or module, create a basic integration project
in Anypoint Code Builder, add connectors and other components to your Mule application to process
your business logic, and configure the attributes.

## Before You Begin

Before creating an integration project, you must:

- [Set up and access the Anypoint Code Builder web or desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb)

- Have credentials to access the connector’s API

- Ensure that the Visual Studio Code Extension Pack for Java is installed.

To use this connector, you must be familiar with:

- The connector’s API

- Anypoint Connectors

- Mule runtime engine (Mule)

## Creating a New Integration Project

To create a new integration project:

1.  In the activity bar of the IDE, click the
    ![Anypoint Code Builder icon](/mulesoft/current/en-us/connectors/_images/acb-icon-ms-logo.png) (**Anypoint Code
    Builder**) icon.

2.  From **Quick Actions**, click **Develop an Integration**:

    ![Develop an Integration link highlighted in the Getting started section](/mulesoft/current/en-us/anypoint-code-builder/_images/develop-integration-option-mat.png)

3.  Complete the following in the **Develop an Integration** form:

    <table><colgroup><col> <col></colgroup><thead><tr><th>Attribute</th><th>Value</th></tr></thead><tbody><tr><td><div><div><p><strong>Project Name</strong></p></div></div></td><td><div><div><p>Unique name for your project.</p></div><div><p>This name is used as the title and name of the integration project file. For example, if the project name is "Salesforce Integration," the project file name is <code>salesforce-integration</code>.</p></div></div></td></tr><tr><td><div><div><p><strong>Project Location</strong></p></div></div></td><td><div><div><p>Your home directory or another directory you create. Click <strong>Browse</strong> to select a different directory for the integration project.</p></div><div><p>Don’t create the project within another project directory.</p></div><div><p>See <a href="https://docs.mulesoft.com/anypoint-code-builder/start-add-folders">Adding Folders to Your Home Directory</a>.</p></div></div></td></tr></tbody></table>

4.  Select the type of project to create by selecting either the **Empty Project** or **Template or
    Example** card.

5.  Select the **Mule runtime** and **Java Version** for your app.

6.  Click **Create Project**.

## Adding the Connector to Your Integration Project

Anypoint Connectors provide operations for retrieving, modifying, and sending data to and from
systems.

In addition to the
[built-in connectors](https://docs.mulesoft.com/anypoint-code-builder/acb-reference#builtin-connectors) that Anypoint
Code Builder provides, you can download many other connectors from Anypoint Exchange.

To import a connector from Exchange and add it to your configuration:

1.  In the Explorer view, open the configuration XML file for your project, such as
    `my-project-name.xml`.

2.  Click the
    ![Show Mule graphical mode icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-tree-view.png) (**Show
    Mule graphical mode**) icon in the activity bar to open the canvas UI if it doesn’t open
    automatically.

3.  Add the connector the same way you added other components from the canvas UI:

    1.  In the canvas UI, click the
        ![Add component icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**)
        icon.

    2.  In the **Add Component** panel, click **Connectors**.

    3.  Click the connector name and then click the operation to add, such as **Publish**:

        ![Add Publish operation from Anypoint MQ Connector](/mulesoft/current/en-us/anypoint-code-builder/_images/int-add-connector-operation.png)

        If the connector is not available locally, click the
        ![Search in Exchange icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-search-exchange.png)
        (**Search in Exchange**) toggle:

        ![Search in Exchange toggle](/mulesoft/current/en-us/anypoint-code-builder/_images/int-connector-search-exchange.png)

        <table><tbody><tr><td><i data-value="1"></i><b>1</b></td><td>Search locally</td></tr><tr><td><i data-value="2"></i><b>2</b></td><td>Search in Exchange</td></tr></tbody></table>

    4.  Select the connector to add to your project.

    5.  Select the operation from the **Add Component** panel.

Adding a connector to an integration project does not make that connector available to other
projects in your Anypoint Code Builder workspace.

## Configuring the Trigger For the Flow

A trigger (source) initiates a flow when a specified condition is met. You can configure one of
these triggers to use with File Connector:

- **On New or Upated File**

  Triggers a flow for a newly created or modified file

- **HTTP > Listener**

  Initiates a flow each time it receives a request on the configured host and port

- **Scheduler**

  Initiates a flow when a time-based condition is met

  For more information, see
  [Scheduler (<scheduler/>)](https://docs.mulesoft.com/anypoint-code-builder/acb-component-scheduler).

For example, to configure the **On New or Updated** trigger:

1.  Add the **On New or Updated** operation to the canvas UI.

2.  Click the **On New or Updated** operation on the canvas UI.

3.  In the **General** tab, configure the following attributes:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Directory</p></td><td><p>Directory where polled files are located.</p></td><td><p>No</p></td></tr><tr><td><p>Recursive</p></td><td><p>If selected, uses files contained in sub-directories.</p></td><td><p>No</p></td></tr><tr><td><p>Matcher</p></td><td><p>Matcher used to filter events on files that don’t meet the matcher’s criteria.</p></td><td><p>No</p></td></tr><tr><td><p>Watermark mode</p></td><td><div><div><p>If selected, picks only files that were created or updated after the last poll was executed.</p></div><div><p>Options include:</p></div><div><ul><li><p>DISABLED</p></li><li><p>MODIFIED_TIMESTAMP</p></li><li><p>CREATED_TIMESTAMP</p></li></ul></div></div></td><td><p>No</p></td></tr><tr><td><p>Time between size check</p></td><td><p>Wait time, in milliseconds, between size checks to determine if a file is ready to read. This allows a file write to complete before processing. Mule runtime performs two size checks and waits the specified amount of time between calls. If both checks return the same value, the file is ready to read.</p></td><td><p>No</p></td></tr><tr><td><p>Time between size check unit</p></td><td><p>Time unit for <strong>Time between size check</strong>.</p></td><td><p>No</p></td></tr><tr><td><p>Scheduling strategy</p></td><td><p>Triggers the flow’s execution based on a time-based condition. This field is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="#scheduling-strategy">Configuring the Scheduling Strategy in XML</a>.</p></td><td><p>Yes</p></td></tr><tr><td colspan="3"><p><strong>Post processing action</strong></p></td></tr><tr><td><p>Auto delete</p></td><td><p>If selected, deletes each processed file after it’s processed, which causes all files obtained in the next poll to be treated as new files.</p></td><td><p>No</p></td></tr><tr><td><p>Move to directory</p></td><td><p>Directory path to which to send each processed file after it processes. This is an alternative to <strong>Auto delete</strong> if you don’t want to delete the file.</p></td><td><p>No</p></td></tr><tr><td><p>Rename to</p></td><td><p>Renames a file to this value when it is moved. This attribute works in tandem with <strong>Move to directory</strong>. The connector retains the original file name if you don’t configure this field.</p></td><td><p>No</p></td></tr><tr><td><p>Apply post action when failed</p></td><td><p>If selected, applies any of the post actions (<strong>Auto delete</strong> and <strong>Move to directory</strong>) in case the file processing fails. If you de-select this option, no failed files are moved or deleted.</p></td><td><p>No</p></td></tr><tr><td><p>Overwrite</p></td><td><p>Overwrites the target file when the destination file has the same name.</p></td><td><p>No</p></td></tr></tbody></table>

## Adding Components to Your Project

Add components to your integration project to build a flow:

1.  In the **Explorer** view, open the XML file for your project, such as `my-project-name.xml`.

2.  Select **Build a Flow** from the start card to create an empty flow:

    ![Anypoint Code Builder canvas with starting cards with the options to start from scratch, build a flow, or build a subflow](/mulesoft/current/en-us/connectors/_images/acb-build-flow.png)

3.  Change the name of the flow:

    1.  Click **Flow**.

    2.  Click the edit icon.

        ![Arrow pointing to the flow name edit pencil icon](/mulesoft/current/en-us/connectors/_images/acb-change-flow-name.png)

    3.  Enter the flow name, and click the checkmark.

    4.  In the canvas UI, click the
        ![Add component icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**)
        icon.

    5.  In the **Add Component** panel, search for and select your component from the results. The
        following example shows the **Listener** component from the **HTTP** search results:

        ![Listener component highlighted in the Add Component section](/mulesoft/current/en-us/anypoint-code-builder/_images/main-tutorial-add-first-listener.png)

        The configuration XML file now includes the XML for the HTTP Listener into the `<flow/>`
        element, for example:

        ```XML
        <flow name="getFlights" >
          <http:listener path="" config-ref="" doc:name="Listener" doc:id="ojzfry" />
        </flow>
        ```

## Adding a Global Configuration

Add another component, this time using the XML configuration menu. For example, add the
`<http:listener-config/>` component from a snippet.

For more information about snippets, see
[Configuring Components](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components).

1.  In the configuration XML, place your cursor before the `<flow/>` element and type `http`.

    Ensure that the cursor is not inside the `<flow/>` element.

2.  Type `http`, and select the `http:listener-config` snippet:

    ![http:listener-config snippet highlighted in the configuration XML menu](/mulesoft/current/en-us/anypoint-code-builder/_images/add-http-config-snippet.png)

    The snippet adds the following code:

```xml
<http:listener-config name="HTTP_Listener_config" >
  <http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
```

## Configuring Component Attributes

After you add components to your integration project, configure the attributes in the component UI,
or configure the attributes directly in the XML code editor.

Connector XML tags start with a namespace followed by an operation, following the syntax
`namespace:operation`, such as `<db:select/>` for a **Select** operation in Anypoint Connector for
Database (Database Connector).

You can use autocomplete from an expression (**fx**) field for a component to select DataWeave
functions from the Core module and other values accepted in this field.

### Configuring the Copy Operation

The **Copy** operation copies the file or directory specified in **Source Path** into the **Target
Path**. The source path can be either a file or directory. If **Source Path** points to a directory,
then the directory is copied recursively.

1.  Click the **Copy** operation on the canvas UI to configure the following attributes in the
    **General** tab:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Source path</p></td><td><p>Path to the file or directory to perform the operation on.</p></td><td><p>Yes</p></td></tr><tr><td><p>Target path</p></td><td><p>Path to the directory to place the file in.</p></td><td><p>Yes</p></td></tr><tr><td><p>Create parent directories</p></td><td><div><div><p>If selected, a parent folder is created if the target path or its parent don’t exist. If unselected, a <code>FILE:ILLEGAL_PATH</code> error is thrown when you try to perform the operation.</p></div></div></td><td><p>No</p></td></tr><tr><td><p>Overwrite</p></td><td><p>If selected, overwrites the target file if a file already exists. If <strong>Overwrite</strong> isn’t selected, a <code>FILE:FILE_ALREADY_EXISTS</code> error is thrown when you try to perform the operation.</p></td><td><p>No</p></td></tr><tr><td><p>Rename to</p></td><td><p>New name for the file. If a new name isn’t provided, the original file name is kept.</p></td><td><p>No</p></td></tr></tbody></table>

2.  Click the **Advanced** tab to configure the following attributes:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Error Mappings</p></td><td><div><div><p>Creates custom error types that you map to Mule error types. The mappings can help you further differentiate and group errors in your app. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/mule-runtime/latest/mule-error-concept">Mule Errors</a>.</p></div></div></td><td><p>No</p></td></tr><tr><td colspan="3"><p>Connection</p></td></tr><tr><td><p>Reconnection strategy</p></td><td><div><div><p>When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect">Reconnect</a> and <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect-forever">Reconnect Forever</a>, and <a href="#configuring-reconnection-strategy">Configuring the Reconnection Strategy in XML</a>.</p></div></div></td><td><p>No</p></td></tr></tbody></table>

### Configuring the Create Directory Operation

The **Create Directory** operation creates a directory in the specified **Directory path**.

1.  Click the **Create Directory** operation on the canvas UI to configure the following attributes
    in the **General** tab:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Directory path</p></td><td><p>New directory’s path name, for example <code>~/newFolder</code>.</p></td><td><p>Yes</p></td></tr></tbody></table>

2.  Click the **Advanced** tab to configure the following attributes:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Error Mappings</p></td><td><div><div><p>Creates custom error types that you map to Mule error types. The mappings can help you further differentiate and group errors in your app. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/mule-runtime/latest/mule-error-concept">Mule Errors</a>.</p></div></div></td><td><p>No</p></td></tr><tr><td colspan="3"><p>Connection</p></td></tr><tr><td><p>Reconnection strategy</p></td><td><div><div><p>When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect">Reconnect</a> and <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect-forever">Reconnect Forever</a>, and <a href="#configuring-reconnection-strategy">Configuring the Reconnection Strategy in XML</a>.</p></div></div></td><td><p>No</p></td></tr></tbody></table>

### Configuring the Delete Operation

The **Delete** operation deletes the file specified in the **Directory path**, as long as the file
isn’t locked. This operation doesn’t delete directories.

1.  Click the **Delete** operation on the canvas UI to configure the following attributes in the
    **General** tab:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Directory path</p></td><td><p>Path to the file to delete.</p></td><td><p>Yes</p></td></tr></tbody></table>

2.  Click the **Advanced** tab to configure the following attributes:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Error Mappings</p></td><td><div><div><p>Creates custom error types that you map to Mule error types. The mappings can help you further differentiate and group errors in your app. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/mule-runtime/latest/mule-error-concept">Mule Errors</a>.</p></div></div></td><td><p>No</p></td></tr><tr><td colspan="3"><p>Connection</p></td></tr><tr><td><p>Reconnection strategy</p></td><td><div><div><p>When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect">Reconnect</a> and <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect-forever">Reconnect Forever</a>, and <a href="#configuring-reconnection-strategy">Configuring the Reconnection Strategy in XML</a>.</p></div></div></td><td><p>No</p></td></tr></tbody></table>

### Configuring the List Operation

Use the **List** operation to list all files in the specified **Directory path**.

1.  Click the **List** operation on the canvas UI to configure the following attributes in the
    **General** tab:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Directory path</p></td><td><p>Path to the directory with the files to list.</p></td><td><p>Yes</p></td></tr><tr><td><p>Recursive</p></td><td><p>If selected, the contents of sub-directories are also listed in the output.</p></td><td><p>No</p></td></tr><tr><td><p>File Matching Rules</p></td><td><div><div><p>Filters files based on the matching criteria that you use for accepting or rejecting a file. For an example of file matching rules, see <a href="https://docs.mulesoft.com/file-connector/latest/file-list#file-matcher">Filter Files by Matching Criteria</a>.</p></div></div></td><td><p>No</p></td></tr></tbody></table>

2.  Click the **Advanced** tab to configure the following attributes:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Time between size check</p></td><td><p>Wait time, in milliseconds, between size checks to determine if a file is ready to read. This allows a file write to complete before processing. Mule runtime performs two size checks and waits the specified amount of time between calls. If both checks return the same value, the file is ready to read.</p></td><td><p>No</p></td></tr><tr><td><p>Time between size check unit</p></td><td><p>Time unit for <strong>Time between size check</strong>.</p></td><td><p>No</p></td></tr><tr><td><p>Subset</p></td><td><p>Limits and sorts the number of files returned.</p></td><td><p>No</p></td></tr><tr><td><p>Streaming strategy</p></td><td><p>Configures the way data streams are consumed in Mule apps. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="#configuring-streaming-strategy">Configuring the Streaming Strategy in XML</a>.</p></td><td><p>No</p></td></tr><tr><td><p>Target Variable</p></td><td><p>Name of the variable on which the operation’s output is placed.</p></td><td><p>No</p></td></tr><tr><td><p>Target Value</p></td><td><p>Expression that’s evaluated against the operation’s output. The outcome of this expression is stored in the target variable.</p></td><td><p>No</p></td></tr><tr><td><p>Error Mappings</p></td><td><div><div><p>Creates custom error types that you map to Mule error types. The mappings can help you further differentiate and group errors in your app. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/mule-runtime/latest/mule-error-concept">Mule Errors</a>.</p></div></div></td><td><p>No</p></td></tr><tr><td><p>Reconnection strategy</p></td><td><div><div><p>When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect">Reconnect</a> and <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect-forever">Reconnect Forever</a>, and <a href="#configuring-reconnection-strategy">Configuring the Reconnection Strategy in XML</a>.</p></div></div></td><td><p>No</p></td></tr></tbody></table>

### Configuring the Move Operation

The **Move** operation moves the file or directory from the **Source path** to the **Target Path**.
If the **Source path** points to a directory, then the directory is moved recursively.

1.  Click the **Move** operation on the canvas UI to configure the following attributes in the
    **General** tab:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Source path</p></td><td><p>Path to the file or directory to perform the operation on.</p></td><td><p>Yes</p></td></tr><tr><td><p>Target path</p></td><td><p>Path to the directory to place the file in.</p></td><td><p>Yes</p></td></tr><tr><td><p>Create parent directories</p></td><td><div><div><p>If selected, a parent folder is created if the target path or its parent don’t exist. If unselected, a <code>FILE:ILLEGAL_PATH</code> error is thrown when you try to perform the operation.</p></div></div></td><td><p>No</p></td></tr><tr><td><p>Overwrite</p></td><td><p>If selected, overwrites the target file if a file already exists. If <strong>Overwrite</strong> isn’t selected, a <code>FILE:FILE_ALREADY_EXISTS</code> error is thrown when you try to perform the operation.</p></td><td><p>No</p></td></tr><tr><td><p>Rename to</p></td><td><p>New name for the file. If a new name isn’t provided, the original file name is kept.</p></td><td><p>No</p></td></tr></tbody></table>

2.  Click the **Advanced** tab to configure the following attributes:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Error Mappings</p></td><td><div><div><p>Creates custom error types that you map to Mule error types. The mappings can help you further differentiate and group errors in your app. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/mule-runtime/latest/mule-error-concept">Mule Errors</a>.</p></div></div></td><td><p>No</p></td></tr><tr><td colspan="3"><p>Connection</p></td></tr><tr><td><p>Reconnection strategy</p></td><td><div><div><p>When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect">Reconnect</a> and <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect-forever">Reconnect Forever</a>, and <a href="#configuring-reconnection-strategy">Configuring the Reconnection Strategy in XML</a>.</p></div></div></td><td><p>No</p></td></tr></tbody></table>

### Configuring the Read Operation

The **Read** operation reads the contents and metadata of a file at the specified path and returns a
message whose payload is an input stream containing the file’s contents. The metadata is represented
as a `LocalFileAttributes` object that’s expressed as message attributes
(`Message#getAttributes()`).

The file’s MIME type is based on the file’s extension. You can force the output encoding and MIME
type by using the optional **Output MIME type** and **Output encoding** parameters.

1.  Click the **Read** operation on the canvas UI to configure the following attributes in the
    **General** tab:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>File Path</p></td><td><p>Path to the file to read.</p></td><td><p>Yes</p></td></tr></tbody></table>

2.  Click the **Advanced** tab to configure the following attributes:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Lock</p></td><td><p>If selected, places a file system-level lock on the file until the input stream that the operation returns is closed or fully consumed. The lock is provided by the host file system, so its behavior might change depending on the mounted drive and the operation system on which Mule runtime is running.</p></td><td><p>No</p></td></tr><tr><td><p>Time between size check</p></td><td><p>Wait time, in milliseconds, between size checks to determine if a file is ready to read. This allows a file write to complete before processing. Mule runtime performs two size checks and waits the specified amount of time between calls. If both checks return the same value, the file is ready to read.</p></td><td><p>No</p></td></tr><tr><td><p>Time between size check unit</p></td><td><p>Time unit for <strong>Time between size check</strong>.</p></td><td><p>No</p></td></tr><tr><td><p>Output MIME type</p></td><td><p>MIME type of the payload that this operation outputs.</p></td><td><p>No</p></td></tr><tr><td><p>Parameters</p></td><td><p>One or more key-value pairs to append to the value of the <strong>Output MIME type</strong> attribute. Multiple key-value pairs are allowed. These key-value pairs enable you to store data in a variable so that any component in the flow can use it.</p></td><td><p>No</p></td></tr><tr><td><p>Output encoding</p></td><td><p>Encoding of the payload that this component outputs.</p></td><td><p>No</p></td></tr><tr><td><p>Streaming Strategy</p></td><td><p>Configure the way data streams are consumed in Mule apps. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="#configuring-streaming-strategy">Configuring the Streaming Strategy in XML</a>.</p></td><td><p>No</p></td></tr><tr><td><p>Target Variable</p></td><td><p>Name of the variable on which the operation’s output is placed.</p></td><td><p>No</p></td></tr><tr><td><p>Target Value</p></td><td><p>Expression that’s evaluated against the operation’s output. The outcome of this expression is stored in the target variable.</p></td><td><p>No</p></td></tr><tr><td><p>Error Mappings</p></td><td><div><div><p>Creates custom error types that you map to Mule error types. The mappings can help you further differentiate and group errors in your app. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/mule-runtime/latest/mule-error-concept">Mule Errors</a>.</p></div></div></td><td><p>No</p></td></tr><tr><td><p>Reconnection strategy</p></td><td><div><div><p>When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect">Reconnect</a> and <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect-forever">Reconnect Forever</a>, and <a href="#configuring-reconnection-strategy">Configuring the Reconnection Strategy in XML</a>.</p></div></div></td><td><p>No</p></td></tr></tbody></table>

### Configuring the Rename Operation

The **Rename** operation renames the file specified in the **Path** field to the name provided in
the `to` parameter. If the `to` parameter contains path separators, a `FILE:ILLEGAL_PATH` is thrown.

1.  Click the **Rename** operation on the canvas UI to configure the following attributes in the
    **General** tab:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Path</p></td><td><p>Path to the file to rename.</p></td><td><p>Yes</p></td></tr><tr><td><p>New Name</p></td><td><p>New name for the file.</p></td><td><p>Yes</p></td></tr><tr><td><p>Overwrite</p></td><td><p>If selected, overwrites the target file if a file already exists with the name you specified in <strong>New Name</strong>.</p></td><td><p>No</p></td></tr></tbody></table>

2.  Click the **Advanced** tab to configure the following attributes:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Error Mappings</p></td><td><div><div><p>Creates custom error types that you map to Mule error types. The mappings can help you further differentiate and group errors in your app. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/mule-runtime/latest/mule-error-concept">Mule Errors</a>.</p></div></div></td><td><p>No</p></td></tr><tr><td colspan="3"><p>Connection</p></td></tr><tr><td><p>Reconnection strategy</p></td><td><div><div><p>When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect">Reconnect</a> and <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect-forever">Reconnect Forever</a>, and <a href="#configuring-reconnection-strategy">Configuring the Reconnection Strategy in XML</a>.</p></div></div></td><td><p>No</p></td></tr></tbody></table>

### Configuring the Write Operation

The **Write** operation writes content into the file specified in **Path**.

1.  Click the **Write** operation on the canvas UI to configure the following attributes in the
    **General** tab:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Path</p></td><td><p>Path to the directory that contains the file to write content to.</p></td><td><p>Yes</p></td></tr><tr><td><p>Content</p></td><td><p>Content to write to the file. Defaults to the <strong>Content</strong> payload.</p></td><td><p>No</p></td></tr><tr><td><p>Create parent directories</p></td><td><div><div><p>If selected, a parent folder is created if the target path or its parent don’t exist. If unselected, a <code>FILE:ILLEGAL_PATH</code> error is thrown when you try to perform the operation.</p></div></div></td><td><p>No</p></td></tr><tr><td><p>Write Mode</p></td><td><div><div><p>What to do if the file already exists. The options include:</p></div><div><ul><li><p>OVERWRITE (Default)</p></li><li><p>APPEND</p></li><li><p>CREATE_NEW</p></li></ul></div></div></td><td><p>No</p></td></tr></tbody></table>

2.  Click the **Advanced** tab to configure the following attributes:

    <table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><p>Error Mappings</p></td><td><div><div><p>Creates custom error types that you map to Mule error types. The mappings can help you further differentiate and group errors in your app. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/mule-runtime/latest/mule-error-concept">Mule Errors</a>.</p></div></div></td><td><p>No</p></td></tr><tr><td colspan="3"><p>Connection</p></td></tr><tr><td><p>Reconnection strategy</p></td><td><div><div><p>When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation. This attribute is not currently enabled in the configuration UI. Configure it in the XML editor. See <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect">Reconnect</a> and <a href="https://docs.mulesoft.com/file-connector/latest/file-documentation#reconnect-forever">Reconnect Forever</a>, and <a href="#configuring-reconnection-strategy">Configuring the Reconnection Strategy in XML</a>.</p></div></div></td><td><p>No</p></td></tr></tbody></table>

3.  Select **Lock** to place a file-system-level lock on the file until the input stream that the
    operation returns is closed or fully consumed.

## Configuring the Scheduling Strategy in XML

### Fixed Frequency

This is an example of the fixed frequency scheduling strategy XML using the default values:

```xml
<flow name="db-connector-acbFlow" doc:id="1c863ef7-d9e6-48ab-be8e-f1465d2b619d" >
	<db:listener doc:name="On Table Row" doc:id="81d4cf34-bb0d-497c-bc3f-316f4e79ad85" >
		<scheduling-strategy >
			<fixed-frequency frequency="1000" startDelay="0" timeUnit="MILLISECONDS"/>
		</scheduling-strategy>
	</db:listener>
</flow>
```

### Cron

For more complex scheduling strategies, you can use a cron expression:

```xml
<flow name="db-connector-acbFlow" doc:id="1c863ef7-d9e6-48ab-be8e-f1465d2b619d" >
	<db:listener doc:name="On Table Row" doc:id="81d4cf34-bb0d-497c-bc3f-316f4e79ad85" >
    <scheduling-strategy>
      <cron expression="0 0 12 * * ?" timeZone="America/Los_Angeles"/>
    </scheduling-strategy>
  </db:listener>
</flow>
```

## Configuring the Reconnection Strategy in XML

The following is an XML example of a standard reconnection strategy setting the count of
reconnection attempts before failing to `5` and setting `failsDeployment` to true, which causes the
application deployment to fail if the connection test fails. Because a frequency is not specified,
the retry interval is the default of every 2000 ms:

```xml
<db:config name="Database_Config" doc:name="Database Config" doc:id="79ae8d0f-e0af-4901-961d-b80befbf3f86" >
	<db:data-source-connection >
		<reconnection failsDeployment="true" >
           <reconnect count="5"/>
        </reconnection>
	</db:data-source-connection>
</db:config>
```

The following is an XML example of a reconnect forever strategy where the connector attempts to
reconnect every 4000 ms for as long as the application runs:

```xml
<db:config name="Database_Config1" doc:name="Database Config" doc:id="c0aaf1dd-ab6e-49ee-9e4d-8b5799945cc9">
    <db:data-source-connection>
        <reconnection failsDeployment="true">
            <reconnection>
                <reconnect-forever frequency="4000"/>
            </reconnection>
        </reconnection>
    </db:data-source-connection>
</db:config>
```

## Configuring the Streaming Strategy in XML

You can configure how Mule handles data streams with streaming strategies.

### File-Stored Repeatable Stream

The following is an XML example of reading a file that is configured with a 1 MB buffer:

```xml
<file:read path="bigFile.json">
  <repeatable-file-store-stream
    inMemorySize="1"
    bufferUnit="MB"/>
</file:read>
```

If you consistently process a file that’s no larger than 10 KB, you can save memory by reducing the
`inMemorySize` attribute:

```xml
<file:read path="smallFile.json">
  <repeatable-file-store-stream
    inMemorySize="10"
    bufferUnit="KB"/>
 </file:read>
```

### In-Memory Repeatable Stream

The following XML example shows an in-memory repeatable stream with a 512 KB initial size, which
grows at a rate of 256 KB and allows up to 2000 KB (2 MB) of content in memory:

```xml
<file:read path="exampleFile.json">
  <repeatable-in-memory-stream
    initialBufferSize="512"
    bufferSizeIncrement="256"
    maxInMemorySize="2000"
    bufferUnit="KB"/>
</file:read>
```
