Skip to content

Conversation

artembilan
Copy link
Member

Fixes: #10372

The AbstractInboundFileSynchronizingMessageSource uses a CompositeFileListFilter for a combination of the user-provided filter and then the one to ignore temporary files. However, the CompositeFileListFilter logic is OR, which means the temporary file might be accepted by the user-provided.

  • Fix the AbstractInboundFileSynchronizingMessageSource.buildFilter() to use a ChainFileListFilter instead (with an AND logic), and put ignoreTemporaryFiles filter as the first one.
  • Fix (S)FTP docs for an actual logic regarding local files filtering.

Cherry-pick to 6.5.x

Fixes: spring-projects#10372

The `AbstractInboundFileSynchronizingMessageSource` uses a `CompositeFileListFilter`
for a combination of the user-provided filter and then the one to ignore temporary files.
However, the `CompositeFileListFilter` logic is `OR`, which means the temporary
file might be accepted by the user-provided.

* Fix the `AbstractInboundFileSynchronizingMessageSource.buildFilter()`
to use a `ChainFileListFilter` instead (with an `AND` logic), and put `ignoreTemporaryFiles`
filter as the first one.
* Fix (S)FTP docs for an actual logic regarding local files filtering.

**Cherry-pick to `6.5.x`**
@artembilan artembilan requested a review from cppwfs September 2, 2025 17:26
@artembilan
Copy link
Member Author

NOTE: It won't cherry-pick clean since there is no proper Nullability.
So, some manual conflicts fixing would be necessary.

Thanks

Copy link
Contributor

@cppwfs cppwfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for fixing this!

@cppwfs cppwfs merged commit ce6e398 into spring-projects:main Sep 3, 2025
3 checks passed
cppwfs pushed a commit to cppwfs/spring-integration that referenced this pull request Sep 3, 2025
…-projects#10373)

Fixes: spring-projects#10372

The `AbstractInboundFileSynchronizingMessageSource` uses a `CompositeFileListFilter`
for a combination of the user-provided filter and then the one to ignore temporary files.
However, the `CompositeFileListFilter` logic is `OR`, which means the temporary
file might be accepted by the user-provided.

* Fix the `AbstractInboundFileSynchronizingMessageSource.buildFilter()`
to use a `ChainFileListFilter` instead (with an `AND` logic), and put `ignoreTemporaryFiles`
filter as the first one.
* Fix (S)FTP docs for an actual logic regarding local files filtering.

**Cherry-pick to `6.5.x`**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local temporary file suffix filter is combined in a CompositeFileListFilter instead of a ChainFileListFilter, therefore a OR instead of a AND
2 participants