> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# File Connector

> The File connector pulls files from external directories into the flow and pushes files from the flow into external directories.

export const CommonCacheCleanup = () => <>
    <p>Arc はリソースキャッシュを自動的にクリーンアップします。この処理はすべての受信サイクルの間にバックグラウンドで実行され、リモートサーバー上にすでに存在しないファイルの古いキャッシュエントリを削除します。これにより、手動での操作を必要とせずにキャッシュサイズを管理可能な状態に保ちます。</p>
    <p>デフォルトでは、ファイルは30 日間保持されますが、<strong>Advanced</strong> タブの<strong>Other Settings</strong> フィールドにある<code>ResourceCacheRetentionDays</code> 設定を使用して、お使いの環境に合わせて調整できます。例えば、<code>ResourceCacheRetentionDays=15</code> とすると、ファイルは削除されるまで15 日間保持されます。</p>
  </>;

export const SlasTab = ({siteName = "CData Arc"}) => <>
    <p><em>サービスレベルアグリーメント（SLA）の設定に関する設定です。</em></p>
    <p>
      SLA を使用すると、フロー内のコネクタが送受信すると見込まれるボリュームを設定し、そのボリュームを達成すると見込まれる期間を設定できます。{siteName} は、SLA が達成されない場合にユーザーへ警告するメールを送信し、SLA を<em>At Risk</em> としてマークします。これは、SLA が間もなく達成されない場合に<em>Violated</em> としてマークされることを意味します。これにより、ユーザーは介入してSLA が達成されない理由を特定し、適切な対応を取る機会を得られます。At Risk 期間の終了時点でもSLA が達成されない場合、SLA はviolated としてマークされ、ユーザーに再度通知されます。
    </p>
    <p>
      SLA を定義するには、<strong>Expected Volume</strong> をオンに切り替え、<strong>Settings</strong> タブをクリックします。
    </p>
    <img src="/public/images/sla_empty.png" alt="SLA Empty" />
    <ul>
      <li>コネクタに送信と受信の個別のアクションがある場合は、ラジオボタンを使用してSLA がどちらの方向に適用されるかを指定します。</li>
      <li>ウィンドウの<strong>Expect at least</strong> 部分で、次を設定します。
        <ul>
          <li>処理を見込む最小トランザクション数（ボリューム）を設定します。</li>
          <li><strong>Every</strong> フィールドを使用して期間を指定します。</li>
          <li>SLA を有効にするタイミングを指定します。<strong>Starting on</strong> を選択した場合は、日付および時刻フィールドを入力します。</li>
          <li>SLA を有効にしたい曜日のチェックボックスをオンにします。必要に応じて、ドロップダウンで<strong>Everyday</strong> を選択します。</li>
        </ul>
      </li>
      <li>ウィンドウの<strong>Set status to 'At Risk'</strong> 部分で、SLA をAt Risk としてマークするタイミングを指定します。
        <ul>
          <li>デフォルトでは、SLA が違反状態になるまで通知は送信されません。これを変更するには、<strong>Send an 'At Risk' notification</strong> をオンにします。</li>
        </ul>
      </li>
    </ul>
    <p>
      次の例は、月曜日から金曜日まで毎日1000 件のファイルを受信すると見込むコネクタ向けに設定されたSLA を示しています。1000 件のファイルが受信されていない場合、期間の終了の1時間前にAt Risk 通知が送信されます。
    </p>
    <img src="/public/images/sla_defined.png" alt="SLA Configuration Example" />
    <Note>
      必要に応じてSLA アラートをオフにすることができます。これはメンテナンスウィンドウ中に役立ちます。navbar で<strong>Settings</strong> をクリックし、<strong>Alerts &gt; General Alerts</strong> に移動します。タブレットと鉛筆のアイコンをクリックして編集し、<strong>SLA Alerts</strong> 設定のチェックを外します。
    </Note>
  </>;

export const AlertsTab = ({siteNameShort = "Arc"}) => <>
    <p><em>アラートの設定に関する設定です。</em></p>
    <p>
      サービスレベルアグリーメント（SLA）を実行する前に、通知用のメールアラートをセットアップする必要があります。デフォルトでは、{siteNameShort} は<a href="/26.2/self-hosted/ja/getting-started/administration/settings/alerts">Alerts</a> タブのグローバル設定を使用します。このコネクタに別の設定を使用するには、<strong>Override global setting</strong> をオンに切り替えます。
    </p>
    <p>
      デフォルトではエラーアラートが有効になっており、エラーが発生するたびにメールが送信されます。これをオフにするには、<strong>Enable</strong> チェックボックスのチェックを外します。
    </p>
    <p>
      <strong>Subject</strong>（必須）を入力し、必要に応じて<strong>Recipient</strong> のメールアドレスをカンマ区切りのリストで入力します。
    </p>
  </>;

export const Message = () => <>
    <p><em>Message 設定は、コネクタがメッセージを検索する方法と、処理後にメッセージを管理する方法を決定します。</em></p>
    <table>
      <thead>
        <tr><th>設定</th><th>説明</th></tr>
      </thead>
      <tbody>
        
          <tr>
            <td><strong>Save to Sent Folder</strong></td>
            <td>コネクタが処理したファイルをコネクタのSent フォルダにコピーするには、これをオンにします。</td>
          </tr>
        
        <tr>
          <td><strong>Sent Folder Scheme</strong></td>
          <td>選択した間隔に従って、コネクタが<strong>Sent</strong> フォルダ内のファイルをグループ化するよう指示します。例えば、<strong>Weekly</strong> オプションは、コネクタが毎週新しいサブフォルダを作成し、その週のすべての送信済みファイルをそのフォルダに保存するよう指示します。空白の設定は、コネクタがすべてのファイルを<strong>Sent</strong> フォルダに直接保存するよう指示します。多数のトランザクションを処理するコネクタでは、サブフォルダを使用することでファイルを整理しやすくなり、パフォーマンスを向上できます。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const MiscConnector = () => <>
    <p><em>Miscellaneous 設定は、特定のユースケース向けの設定です。</em></p>
    <table>
      <thead>
        <tr>
          <th>設定</th>
          <th>説明</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Other Settings</strong></td>
          <td>非表示のコネクタ設定をセミコロン区切りのリストで設定できます（例：<code>setting1=value1;setting2=value2</code>）。通常のコネクタのユースケースや機能では、これらの設定の使用は必要ありません。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const Logging = () => <>
    <p><em>ログの作成と保存を制御する設定です。</em></p>
    <table>
      <thead>
        <tr>
          <th>設定</th>
          <th>説明</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Log Level</strong></td>
          <td>コネクタが生成するログの詳細度です。サポートを依頼する際は、これを<strong>Debug</strong> に設定してください。</td>
        </tr>
        <tr>
          <td><strong>Log Subfolder Scheme</strong></td>
          <td>選択した間隔に従って、コネクタがLogs フォルダ内のファイルをグループ化するよう指示します。<strong>Weekly</strong> オプション（デフォルト）は、コネクタが毎週新しいサブフォルダを作成し、その週のすべてのログをそのフォルダに保存するよう指示します。この設定を空白のままにすると、コネクタはすべてのログをLogs フォルダに直接保存します。多数のトランザクションを処理するコネクタでは、サブフォルダを使用することでログを整理しやすくなり、パフォーマンスが向上します。</td>
        </tr>
        <tr>
          <td><strong>Log Messages</strong></td>
          <td>処理したファイルのログエントリにファイル自体のコピーを含めるには、これをオンにします。これを無効にすると、<strong>Transactions</strong> タブからファイルのコピーをダウンロードできなくなる場合があります。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const MacrosExamples = ({extraMacros = []}) => <>
    <p>
      %Ext% や %ShortDate% などの一部のマクロは引数を必要としませんが、引数を必要とするものもあります。
      引数を取るすべてのマクロは次の構文を使用します。<code>%Macro:argument%</code>
    </p>

    <p>引数を取るマクロの例を次に示します。</p>

    <ul>
      <li>%Header:headername%：<code>headername</code> はメッセージ上のヘッダーの名前です。</li>
      <li>%Header:mycustomheader% は、入力メッセージに設定された<code>mycustomheader</code> ヘッダーの値に解決されます。</li>
      <li>%Header:ponum% は、入力メッセージに設定された<code>ponum</code> ヘッダーの値に解決されます。</li>
      <li>%RegexFilename:pattern%：<code>pattern</code> は正規表現パターンです。例えば、<code>%RegexFilename:^([\w][A-Za-z]+)%</code> は、ファイル名の最初の単語にマッチしてそれに解決され、大文字・小文字を区別しません（<code>test_file.xml</code> は<code>test</code> に解決されます）。</li>
      <li>%Vault:vaultitem%：<code>vaultitem</code> は<a href="/26.2/self-hosted/ja/getting-started/administration/settings/global-settings-vault">Vault</a> 内のアイテムの名前です。例えば、<code>%Vault:companyname%</code> は、Vault に保存された<code>companyname</code> アイテムの値に解決されます。</li>
      <li>%DateFormat:format%：<code>format</code> は許容される日付形式です（詳細は<a href="/26.2/self-hosted/ja/scripting/value-formatters/date-formatters#sample-date-formats">日付形式のサンプル</a>を参照してください）。例えば、<code>%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%</code> は、ファイルの日付とタイムスタンプに解決されます。</li>
      {extraMacros.filter(item => item.example).map(item => <li key={`ex-${item.name}`}>{item.example}</li>)}
    </ul>

    <p>次の例に示すように、より高度なマクロを作成することもできます。</p>

    <ul>
      <li>1 つのファイル名で複数のマクロを組み合わせる：<code>%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%%EXT%</code></li>
      <li>マクロの外側にテキストを含める：<code>MyFile_%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%</code></li>
      <li>マクロの内側にテキストを含める：<code>%DateFormat:'DateProcessed-'yyyy-MM-dd_'TimeProcessed-'HH-mm-ss%</code></li>
    </ul>
  </>;

export const MacrosTable = ({siteName = "CData Arc", extraMacros = []}) => <>
    <p>
      ファイル命名戦略でマクロを使用すると、データの整理効率と文脈の理解を高めることができます。
      ファイル名にマクロを組み込むことで、識別子、タイムスタンプ、ヘッダー情報などの関連情報を
      動的に含めることができ、各ファイルに有用な文脈を提供します。
    </p>

    <p>{siteName} は次のマクロをサポートしています。これらはすべて次の構文を使用します。<code>%Macro%</code></p>

    <table>
      <thead>
        <tr><th>マクロ</th><th>説明</th></tr>
      </thead>
      <tbody>
        <tr><td>ConnectorID</td><td>コネクタのConnectorID に評価されます。</td></tr>
        <tr><td>Ext</td><td>コネクタが現在処理しているファイルの拡張子に評価されます。</td></tr>
        <tr><td>Filename</td><td>コネクタが現在処理しているファイルのファイル名（拡張子を含む）に評価されます。</td></tr>
        <tr><td>FilenameNoExt</td><td>コネクタが現在処理しているファイルのファイル名（拡張子を除く）に評価されます。</td></tr>
        <tr><td>MessageId</td><td>コネクタが出力しているメッセージのMessageId に評価されます。</td></tr>
        <tr><td>RegexFilename:<em>pattern</em></td><td>コネクタが現在処理しているファイルのファイル名に正規表現パターンを適用します。</td></tr>
        <tr><td>Header:<em>headername</em></td><td>コネクタが現在処理しているメッセージ上の対象ヘッダー（<code>headername</code>）の値に評価されます。</td></tr>
        <tr><td>LongDate</td><td>システムの現在の日時を長い形式（例：Wednesday, January 24, 2024）で評価します。</td></tr>
        <tr><td>ShortDate</td><td>システムの現在の日時をyyyy-MM-dd 形式（例：2024-01-24）で評価します。</td></tr>
        <tr><td>DateFormat:<em>format</em></td><td>システムの現在の日時を指定された形式（<code>format</code>）で評価します。利用可能な日時形式については、<a href="/26.2/self-hosted/ja/scripting/value-formatters/date-formatters#date-formats-with-literal-characters">日付形式のサンプル</a>を参照してください。</td></tr>
        <tr><td>Vault:<em>vaultitem</em></td><td>指定されたVault アイテムの値に評価されます。</td></tr>
        {extraMacros.map(item => <tr key={item.name}>
            <td>{item.name}</td>
            <td>{item.description}</td>
          </tr>)}
      </tbody>
    </table>
  </>;

export const Performance = () => <>
    <p><em>コネクタへのリソースの割り当てに関する設定です。</em></p>
    <table>
      <thead>
        <tr>
          <th>設定</th>
          <th>説明</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Max Workers</strong></td>
          <td>このコネクタでファイルを処理するためにスレッドプールから消費されるワーカースレッドの最大数です。設定すると、<a href="/26.2/self-hosted/ja/getting-started/administration/settings/advanced-settings">Advanced Settings</a> ページの<a href="/26.2/self-hosted/ja/getting-started/administration/settings/performance-settings">Performance Settings</a> 部分にあるデフォルト設定が上書きされます。</td>
        </tr>
        <tr>
          <td><strong>Max Files</strong></td>
          <td>コネクタに割り当てられた各スレッドが送信するファイルの最大数です。設定すると、<a href="/26.2/self-hosted/ja/getting-started/administration/settings/advanced-settings">Advanced Settings</a> ページの<a href="/26.2/self-hosted/ja/getting-started/administration/settings/performance-settings">Performance Settings</a> 部分にあるデフォルト設定が上書きされます。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const siteNameShort = "Arc";

export const siteName = "CData Arc";

The File connector can:

* Pull files from external directories into the {siteName} flow
* Push files from the {siteNameShort} flow into external directories

## Key Capabilities

* Local and network file system integration with UNC path support
* Configurable authentication for protected network locations (.NET edition only)
* Advanced filtering with glob patterns and recursive directory support
* Temporary file handling with staging and rename operations for reliable transfers
* Optional caching to ensure only new or updated files are downloaded

## Overview

Each File connector is configured with a path on disk that determines what folder it reads files from or writes files to. This can be a local file path or a UNC path to access other file locations on the network.

When a File connector receives a file from the configured path, it passes the received file off to the next connector in the {siteNameShort} flow without modifying the file. In this way, File connectors can be used to poll an external folder location for files to pull into the {siteNameShort} flow.

When a file in the {siteNameShort} flow is processed by a File connector, that file is written to the folder at the configured path. In this way, File connectors can be used to drop off processed files at a location external to the application.

File connectors can be configured with username/password credentials to provide access to external filepaths that otherwise would not be accessible to the application. This allows {siteNameShort} to pull files from protected folder locations without needing to grant the entire application access to the protected location.

The path configured in the File connector can be dynamically populated using macros. For more information, see the [Macros](#macros) section.

## Connector Configuration

This section contains all of the configurable connector properties.

### Settings Tab

#### Connector Settings

*Settings related to the core operation of the connector.*

| Setting                   | Description                                                                                                                                                           |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Connector Id**          | The static, unique identifier for the connector.                                                                                                                      |
| **Connector Type**        | Displays the connector name and a description of what it does.                                                                                                        |
| **Connector Description** | An optional field to provide a free-form description of the connector and its role in the flow.                                                                       |
| **Path**                  | The external filepath where the connector pulls files from or pushes files to. The path can include macros for dynamic evaluation, as described in [Macros](#macros). |

#### Receive

*Settings related to pulling files from the external filepath.*

| Setting                           | Description                                                                                                                                                                                                                           |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **File Mask**                     | A glob pattern for filtering files that should be pulled from the configured path. Only files matching the filemask are pulled. This setting can be combined with **Receive Filter** on the Advanced tab to specify multiple filters. |
| **Delete files (after received)** | Whether to remove files from the external path after they are pulled into the {siteNameShort} flow.                                                                                                                                   |

#### Authentication

| Setting      | Description                                                                                                                       |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| **Username** | The Windows user account that is used to access the files. If this is not specified, the connector uses the current user account. |
| **Password** | The password for the specified user account.                                                                                      |
| **Domain**   | The domain for the Windows user account. This can be empty if the specified user is a local user account.                         |

#### Caching

*Settings related to caching and comparing files between multiple downloads.*

| Setting                  | Description                                                                                                                                                                          |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **File Size Comparison** | Check this to keep a record of downloaded file names and sizes. Previously downloaded files are skipped unless the file size is different than the last download.                    |
| **Timestamp Comparison** | Check this to keep a record of downloaded file names and last-modified timestamps. Previously downloaded files are skipped unless the timestamp is different than the last download. |

<Note><CommonCacheCleanup /> When you enable caching, the file names are case-insensitive. For example, the connector cannot distinguish between `TEST.TXT` and `test.txt`.</Note>

### Advanced Tab

#### Advanced Settings

*Settings not included in the previous categories.*

| Setting                 | Description                                                                                                                                                                                                                                                                                                                                                                       |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Max Receive Files**   | The maximum number of files that are pulled in a single receive interval. If this is not a positive integer, no limit is applied.                                                                                                                                                                                                                                                 |
| **Overwrite Option**    | Specifies how the connector should handle the case when it attempts to write a file to the external path and that file already exists. The connector can *rename* the current file to a unique filename, *overwrite* the existing file, *append* the current file to the existing file, *skip* the operation without error, or *stop* the operation and throw an error.           |
| **Receiving Delay**     | The amount of time (in seconds) that the connector waits before receiving files from the remote path.                                                                                                                                                                                                                                                                             |
| **Recurse**             | Set this to true to download files in all subfolders of the target remote path. The directories are preserved for the received files.                                                                                                                                                                                                                                             |
| **Temp Send Path**      | A directory to use as a staging folder before moving the file to its configured destination path.                                                                                                                                                                                                                                                                                 |
| **Temp Send Prefix**    | If specified, the connector uploads the file with the temporary prefix, then renames the file to its original filename after the operation is complete.                                                                                                                                                                                                                           |
| **Temp Send Extension** | If specified, the connector uploads the file with the temporary extension, then renames the file to its original filename and extension after the operation is complete.                                                                                                                                                                                                          |
| **Minimum File Size**   | The minimum file size to process, in bytes. If a file being uploaded is smaller than the specified size, it is finalized as **Skipped**. For files being downloaded, the connector adds a transaction log entry indicating that the file was skipped because of its size.                                                                                                         |
| **Local File Scheme**   | A scheme for assigning filenames to messages that are output by the connector. You can use macros in your filenames dynamically to include information such as identifiers and timestamps. For more information, see [Macros](#macros).                                                                                                                                           |
| **Receive Filter**      | A glob pattern filter to determine which files should be downloaded from the remote storage (e.g. \*.txt). Use negative patterns to indicate files that should *not* be downloaded (for example, -\*.tmp). Use this setting when you need multiple **File Mask** patterns. Separate multiple patterns by commas; later filters take priority except when an exact match is found. |
| **Processing Delay**    | The amount of time (in seconds) by which the processing of files placed in the **Transactions** tab is delayed. This is a legacy setting. Best practice is to [use a File connector](../flows/designing-a-flow#ローカルファイルシステムとのやり取り) to manage local file systems instead of this setting.                                                                                          |

#### Message

<Message />

#### Logging

<Logging />

#### Miscellaneous

<MiscConnector />

### Automation Tab

#### Automation Settings

*Settings related to the automatic processing of files by the connector.*

| Setting            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Send**           | A toggle that instructs the connector to automatically send files when they are ready.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Retry Interval** | The interval the connector waits before retrying a failed send.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Max Attempts**   | The number of attempts the connector makes to send the message. Setting this value to *1* instructs the connector to only make the initial send attempt without retrying. The connector waits the duration specified by **Retry Interval** between each attempt.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Receive**        | A toggle that instructs the connector to automatically process files when they are ready and send them to the **Transactions** tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Interval**       | The interval at which the connector processes all pending files and sends them to the **Transactions** tab. The next field depends on the selection here:<br />**Hourly** — A *Minutes Past the Hour* dropdown menu allows you to specify the number of minutes past the hour to process receive files.<br />**Daily** — A *Time* field appears to specify the time of day (in UTC) to process receive files.<br />**Weekly** — Two fields appear. *Day* allows you to select the day of the week for processing, and *Time* allows you to specify the time (in UTC) to process receive files.<br />**Monthly** — Two fields appear. *Day* allows you to select the day of the month for processing, and *Time* allows you to specify the time (in UTC) to process receive files.<br />**Minute** — A *Minutes* field appears to specify the number of minutes between processing intervals.<br />**Advanced** — A five-position *Cron Expression* field allows you to specify exact processing intervals. |

#### Performance

<Performance />

### Alerts Tab

<AlertsTab />

### SLAs Tab

<SlasTab />

## Establishing a Connection

File connectors must have the appropriate permissions to read/write from the configured path. Permissions issues are primarily a concern when the configured path is a UNC path to another server on the network, but can also arise when pushing or pulling files from a protected folder on the local disk.

If the user running {siteNameShort} does not have permission to access the path, set the **Username**, **Password**, and **Domain** fields in the [Authentication](#authentication) section of the **Settings** tab to a specific user with the appropriate permissions.

## Sending and Receiving Files

### Sending Files

The File connector sends files from the **Transactions** tab to the external folder specified in the configured path. Files are automatically sent if **Send** is enabled on the [Automation](#automation-settings) tab.

### Receiving Files

The File connector receives files from the external folder specified in the configured path and places them in the connector's **Transactions** tab. If the File connector is connected to another connector in the flow, the file does not remain in this folder and is instead passed along to the next connected connector.

The connector automatically polls the external folder for files if **Receive** is enabled on the [Automation](#automation-settings) tab.

The connector only pulls files that match the specified **File Mask**. If **Enable Timestamp Comparison** or **Enable File Size Comparison** is enabled, the connector caches file names pulled from the remote path and only receives files that are new or have been modified since they were last received.

### Subfolder Headers

If **Recurse Subdirectories** is set to **True**, when receiving a file:

* The message for the received file contains a Subfolder header in its metadata.
* This header contains the subfolder, relative to the configured path, that the file was received from.
* This subfolder header is supported by other connectors that support a Subfolder header in Send operations.

When sending files, if a Subfolder header is present on the message that is sent to the configured path in the File connector:

* The file is placed in the subfolder (relative to the path setting in the File connector) that is specified in the subfolder header.
* The subfolder is created if permissions are available.

## Macros

<MacrosTable />

### Examples

<MacrosExamples />
