INT-1614 replaced 'directoryExists' with 'exists'
This commit is contained in:
@@ -79,7 +79,7 @@ public class SftpInboundFileSynchronizer extends AbstractInboundFileSynchronizer
|
||||
logger.trace("Pooled SftpSession " + session + " from the pool");
|
||||
}
|
||||
session.connect();
|
||||
Assert.isTrue(session.directoryExists(remotePath), "remote path '" + remotePath + "' does not exist");
|
||||
Assert.isTrue(session.exists(remotePath), "remote path '" + remotePath + "' does not exist");
|
||||
Collection<ChannelSftp.LsEntry> beforeFilter = session.ls(remotePath);
|
||||
ChannelSftp.LsEntry[] entries = (beforeFilter == null) ? new ChannelSftp.LsEntry[0] :
|
||||
beforeFilter.toArray(new ChannelSftp.LsEntry[beforeFilter.size()]);
|
||||
|
||||
@@ -120,12 +120,8 @@ public class CachingSftpSessionFactory implements SftpSessionFactory, Disposable
|
||||
}
|
||||
}
|
||||
|
||||
public boolean directoryExists(String path) {
|
||||
return this.targetSession.directoryExists(path);
|
||||
}
|
||||
|
||||
public boolean mkdir(String path) {
|
||||
return this.targetSession.mkdir(path);
|
||||
public boolean exists(String path) {
|
||||
return this.targetSession.exists(path);
|
||||
}
|
||||
|
||||
public boolean rm(String path) {
|
||||
|
||||
@@ -135,7 +135,7 @@ public class DefaultSftpSession implements SftpSession {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean directoryExists(String path) {
|
||||
public boolean exists(String path) {
|
||||
try {
|
||||
SftpATTRS attrs = channel.stat(path);
|
||||
return (attrs != null) && attrs.isDir();
|
||||
|
||||
@@ -37,9 +37,7 @@ public interface SftpSession {
|
||||
|
||||
void disconnect();
|
||||
|
||||
boolean directoryExists(String path);
|
||||
|
||||
boolean mkdir(String path);
|
||||
boolean exists(String path);
|
||||
|
||||
boolean rm(String path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user