Skip to content

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

@karim789

Description

@karim789

In what version(s) of Spring Integration are you seeing this issue?

6.5.0

Describe the bug

Local temporary file suffix filter is combined in a CompositeFileListFilter instead of a ChainFileListFilter, therefore a ( localFileListfilter || temporaryFileSuffixFilter ) instead of ( localFileListfilter && temporaryFileSuffixFilter ).

If the file is beeing written as .writting suffix indicates, it shouldn't be available for message creation, yet, even if other custom filters meet the conditions.

The temporaryFileSuffixFilter should be first in the chain.

I got around that by creating a localfilelistfilter chain that includes first the same filesuffix regex filter

	private FileListFilter<File> buildFilter() {
		Pattern completePattern = Pattern.compile("^.*(?<!" + this.synchronizer.getTemporaryFileSuffix() + ")$");
		return new CompositeFileListFilter<>(
				Arrays.asList(this.localFileListFilter, new RegexPatternFileListFilter(completePattern)));
	}

To Reproduce

Issue occurs if you add custom localFileListFilter.

Expected behavior

.writting files should not be accepted no matter what

Sample

Sorry I can't push code from the corporation I am writting this repport.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions