2

These all files downloaded from ftp.

enter image description here

I have tried this flow :

<flow name="myFlow">
    <file:inbound-endpoint path="fiel_path" connector-ref="File" pollingFrequency="3600000" fileAge="50000" responseTimeout="10000" encoding="UTF-16" mimeType="text/csv" doc:name="File">
        <file:filename-regex-filter pattern=".*#[server.dateTime.format('yyyy_MM_dd')].*.csv" caseSensitive="true"/>
    </file:inbound-endpoint>
    ....

But I could not read file. Thanks in Advance.

3 Answers3

0

Include HH:mm:ss in regex

#[server.dateTime.format('yyyy-MM-dd HH:mm:ss')]
Thirumal
  • 8,280
  • 11
  • 53
  • 103
0

try this in regex filter pattern ".*#[server.dateTime.format('yyyy_MM_dd_HH:mm:ss')].csv"

Vatsal Mehta
  • 117
  • 2
  • 19
0

The file regex pattern does not process MEL expressions.

You will have to change your filename-regex-filter pattern in your file inbound-endpoint and include an expression filter in your flow.

<file:inbound-endpoint path="fiel_path" connector-ref="File" pollingFrequency="3600000" fileAge="50000" responseTimeout="10000" encoding="UTF-16" mimeType="text/csv" doc:name="File">
    <file:filename-regex-filter pattern=".*\d{4}_\d{2}_\d{2}_.*.csv" caseSensitive="true"/>
</file:inbound-endpoint>

<expression-filter expression="#[message.inboundProperties.originalFilename.contains(server.dateTime.format('yyyy_MM_dd'))]" doc:name="Filter today's date Expression"/>

The above regex filter only allows those files with the dates in their filenames such as anytext_2016_05_10_anytext.csv.

The above expression filter only allows today's date through. I am assuming you only want today's date based on your use of the server.datetime in your regex.

tbriscoe
  • 160
  • 1
  • 13