From 9b5ba8b56a5e0af20123f29697ed00ab3cabdd85 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Sun, 21 Nov 2010 23:11:04 -0500 Subject: [PATCH] INT-1614 moved the 'INCOMPLETE_EXTENSION' constant into the AbstractInboundFileSynchronizer class instead of the MessageSource implementation --- .../synchronizer/AbstractInboundFileSynchronizer.java | 8 +++++++- .../AbstractInboundFileSynchronizingMessageSource.java | 8 +------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java index 4fdfedda32..7628b322e4 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java @@ -50,6 +50,12 @@ import org.springframework.util.ObjectUtils; */ public abstract class AbstractInboundFileSynchronizer implements InboundFileSynchronizer, InitializingBean { + /** + * Extension used when downloading files. We change it right after we know it's downloaded. + */ + static final String INCOMPLETE_EXTENSION = ".INCOMPLETE"; + + protected final Log logger = LogFactory.getLog(this.getClass()); /** @@ -149,7 +155,7 @@ public abstract class AbstractInboundFileSynchronizer implements InboundFileS } File localFile = new File(localDirectory, remoteFileName); if (!localFile.exists()) { - String tempFileName = localFile.getAbsolutePath() + AbstractInboundFileSynchronizingMessageSource.INCOMPLETE_EXTENSION; + String tempFileName = localFile.getAbsolutePath() + INCOMPLETE_EXTENSION; File tempFile = new File(tempFileName); InputStream inputStream = null; FileOutputStream fileOutputStream = new FileOutputStream(tempFile); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizingMessageSource.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizingMessageSource.java index b31dd25d91..47b7591b7e 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizingMessageSource.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizingMessageSource.java @@ -54,12 +54,6 @@ import org.springframework.util.Assert; */ public abstract class AbstractInboundFileSynchronizingMessageSource extends MessageProducerSupport implements MessageSource { - /** - * Extension used when downloading files. We change it right after we know it's downloaded. - */ - public static final String INCOMPLETE_EXTENSION = ".INCOMPLETE"; - - /** * Should the endpoint attempt to create the local directory and/or the remote directory? */ @@ -157,7 +151,7 @@ public abstract class AbstractInboundFileSynchronizingMessageSource extends M @SuppressWarnings("unchecked") private FileListFilter buildFilter() { - Pattern completePattern = Pattern.compile("^.*(?(Arrays.asList( new AcceptOnceFileListFilter(), new PatternMatchingFileListFilter(completePattern)));