INT-1614 synchronize method now accepts the loacl directory as an argument rather than having its own direct reference
This commit is contained in:
@@ -47,11 +47,6 @@ public abstract class AbstractInboundRemoteFileSystemSychronizer<F> implements I
|
||||
*/
|
||||
protected boolean shouldDeleteSourceFile;
|
||||
|
||||
/**
|
||||
* The directory to which we write our synchronizations.
|
||||
*/
|
||||
private volatile Resource localDirectory;
|
||||
|
||||
/**
|
||||
* An {@link FileListFilter} that runs against the <emphasis>remote</emphasis> file system view.
|
||||
*/
|
||||
@@ -63,14 +58,6 @@ public abstract class AbstractInboundRemoteFileSystemSychronizer<F> implements I
|
||||
private EntryAcknowledgmentStrategy<F> entryAcknowledgmentStrategy;
|
||||
|
||||
|
||||
public void setLocalDirectory(Resource localDirectory) {
|
||||
this.localDirectory = localDirectory;
|
||||
}
|
||||
|
||||
protected Resource getLocalDirectory() {
|
||||
return this.localDirectory;
|
||||
}
|
||||
|
||||
public void setFilter(FileListFilter<F> filter) {
|
||||
this.filter = filter;
|
||||
}
|
||||
@@ -110,7 +97,7 @@ public abstract class AbstractInboundRemoteFileSystemSychronizer<F> implements I
|
||||
/**
|
||||
* This is the callback where the subclasses must synchronize.
|
||||
*/
|
||||
protected abstract void syncRemoteToLocalFileSystem();
|
||||
protected abstract void syncRemoteToLocalFileSystem(Resource localDirectory);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -123,15 +123,6 @@ public abstract class AbstractInboundRemoteFileSystemSynchronizingMessageSource<
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure the remote files get here.
|
||||
*/
|
||||
this.synchronizer.setLocalDirectory(this.localDirectory);
|
||||
//this.synchronizer.setTaskScheduler(this.getTaskScheduler());
|
||||
//this.synchronizer.setBeanFactory(this.getBeanFactory());
|
||||
//this.synchronizer.setPhase(this.getPhase());
|
||||
//this.synchronizer.setBeanName(this.getComponentName());
|
||||
|
||||
/**
|
||||
* Forwards files once they ultimately appear in the {@link #localDirectory}.
|
||||
*/
|
||||
@@ -139,7 +130,7 @@ public abstract class AbstractInboundRemoteFileSystemSynchronizingMessageSource<
|
||||
this.fileSource.setFilter(this.buildFilter());
|
||||
this.fileSource.setDirectory(this.localDirectory.getFile());
|
||||
this.fileSource.afterPropertiesSet();
|
||||
//this.synchronizer.afterPropertiesSet();
|
||||
this.synchronizer.afterPropertiesSet();
|
||||
}
|
||||
catch (RuntimeException e) {
|
||||
throw e;
|
||||
@@ -160,7 +151,7 @@ public abstract class AbstractInboundRemoteFileSystemSynchronizingMessageSource<
|
||||
Assert.state(this.synchronizer != null, "synchronizer must not be null");
|
||||
Message<File> message = this.fileSource.receive();
|
||||
if (message == null) {
|
||||
this.synchronizer.syncRemoteToLocalFileSystem();
|
||||
this.synchronizer.syncRemoteToLocalFileSystem(this.localDirectory);
|
||||
message = this.fileSource.receive();
|
||||
}
|
||||
return message;
|
||||
|
||||
Reference in New Issue
Block a user