INT-1614 moved the 'INCOMPLETE_EXTENSION' constant into the AbstractInboundFileSynchronizer class instead of the MessageSource implementation

This commit is contained in:
Mark Fisher
2010-11-21 23:11:04 -05:00
parent 003d9e71f6
commit 9b5ba8b56a
2 changed files with 8 additions and 8 deletions

View File

@@ -50,6 +50,12 @@ import org.springframework.util.ObjectUtils;
*/
public abstract class AbstractInboundFileSynchronizer<F> 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<F> 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);

View File

@@ -54,12 +54,6 @@ import org.springframework.util.Assert;
*/
public abstract class AbstractInboundFileSynchronizingMessageSource<F> extends MessageProducerSupport implements MessageSource<File> {
/**
* 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<F> extends M
@SuppressWarnings("unchecked")
private FileListFilter<File> buildFilter() {
Pattern completePattern = Pattern.compile("^.*(?<!" + INCOMPLETE_EXTENSION + ")$");
Pattern completePattern = Pattern.compile("^.*(?<!" + AbstractInboundFileSynchronizer.INCOMPLETE_EXTENSION + ")$");
return new CompositeFileListFilter<File>(Arrays.asList(
new AcceptOnceFileListFilter<File>(),
new PatternMatchingFileListFilter(completePattern)));