diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileListFilterFactoryBean.java b/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileListFilterFactoryBean.java index 2a58a8324f..78e31523bb 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileListFilterFactoryBean.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileListFilterFactoryBean.java @@ -80,9 +80,13 @@ public class FileListFilterFactoryBean implements FactoryBean createdFilter = null; - if ((this.filter != null) && (this.filenamePattern != null || this.filenameRegex!=null)) { + if ((this.filter != null) && (this.filenamePattern != null || this.filenameRegex != null)) { throw new IllegalArgumentException("The 'filter' reference is mutually exclusive with " - + "'filename-pattern' and 'filename-regex' attributes."); + + "either the 'filename-pattern' or 'filename-regex' attribute."); + } + + if (this.filenamePattern != null && this.filenameRegex != null) { + throw new IllegalArgumentException("The 'filename-pattern' and 'filename-regex' attributes are mutually exclusive."); } //'filter' is set