Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3849

<int-file:inbound-channel-adapter> filter doesnt work without prevent-duplicates or ignore-hidden attributes

    XMLWordPrintable

    Details

      Description

      I defined a file:inbound-channel-adapter as follow in one of my project :

      <int-file:inbound-channel-adapter directory="${input.folder.path}" channel="fileInputChannel" filter="compositeFilter">
      		...
      </int-file:inbound-channel-adapter>
      

      For some reasons, my filter was not used. I dug deeper and find this test in the FileInboundChannelAdapterParser class, in registerFilter method :

      if (!StringUtils.hasText(filenamePattern) && !StringUtils.hasText(filenameRegex)
      		&& !StringUtils.hasText(preventDuplicates) && !StringUtils.hasText(ignoreHidden)) {
      	return null;
      }
      

      I change my configuration to add the ignore-hidden and it works.

      So, it seems that you need to define one of those 4 attributes on your inbound-channel-adapter to have your filter bean to be used (exactly 2 because filename-pattern and filename-regex raise an exception with filter attributes), which is not what is defined in file support page example :

      <int-file:inbound-channel-adapter id="filesIn2"
          directory="file:${input.directory}"
          filter="customFilterBean" />
      

      This is not

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              grussell Gary Russell
              Reporter:
              ikikrepus Guillaume Monteils
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: