INT-1614 moved the 'INCOMPLETE_EXTENSION' constant into the AbstractInboundFileSynchronizer class instead of the MessageSource implementation
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user