From 7ce84b0b7922c11882556291b38e80511cb737f2 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Mon, 15 Nov 2010 17:25:22 -0500 Subject: [PATCH] INT-1615 The 'filename-pattern' and 'filename-regex' attributes are now mutually exclusive. --- .../file/config/FileListFilterFactoryBean.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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