INT-2387 changed mkdir() method in Session to return boolean
This commit is contained in:
@@ -255,11 +255,11 @@ public class FileTransferringMessageHandler<F> extends AbstractMessageHandler {
|
||||
break;
|
||||
}
|
||||
else {
|
||||
pathsToCreate.add(pathSegment);
|
||||
pathsToCreate.add(0, pathSegment);
|
||||
nextSeparatorIndex = pathSegment.lastIndexOf(remoteFileSeparator);
|
||||
}
|
||||
}
|
||||
Collections.reverse(pathsToCreate);
|
||||
|
||||
for (String pathToCreate : pathsToCreate) {
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("Creating '" + pathToCreate + "'");
|
||||
|
||||
@@ -155,8 +155,8 @@ public class CachingSessionFactory<F> implements SessionFactory<F>, DisposableBe
|
||||
this.targetSession.rename(pathFrom, pathTo);
|
||||
}
|
||||
|
||||
public void mkdir(String directory) throws IOException {
|
||||
this.targetSession.mkdir(directory);
|
||||
public boolean mkdir(String directory) throws IOException {
|
||||
return this.targetSession.mkdir(directory);
|
||||
}
|
||||
|
||||
public boolean exists(String path) throws IOException{
|
||||
|
||||
@@ -39,7 +39,7 @@ public interface Session<T> {
|
||||
|
||||
void write(InputStream inputStream, String destination) throws IOException;
|
||||
|
||||
void mkdir(String directory) throws IOException;
|
||||
boolean mkdir(String directory) throws IOException;
|
||||
|
||||
void rename(String pathFrom, String pathTo) throws IOException;
|
||||
|
||||
|
||||
@@ -262,7 +262,8 @@ public class RemoteFileOutboundGatewayTests {
|
||||
public void write(InputStream inputStream, String destination)
|
||||
throws IOException {
|
||||
}
|
||||
public void mkdir(String directory) throws IOException {
|
||||
public boolean mkdir(String directory) throws IOException {
|
||||
return true;
|
||||
}
|
||||
public void rename(String pathFrom, String pathTo)
|
||||
throws IOException {
|
||||
@@ -320,7 +321,8 @@ public class RemoteFileOutboundGatewayTests {
|
||||
public void write(InputStream inputStream, String destination)
|
||||
throws IOException {
|
||||
}
|
||||
public void mkdir(String directory) throws IOException {
|
||||
public boolean mkdir(String directory) throws IOException {
|
||||
return true;
|
||||
}
|
||||
public void rename(String pathFrom, String pathTo)
|
||||
throws IOException {
|
||||
@@ -375,7 +377,8 @@ public class RemoteFileOutboundGatewayTests {
|
||||
public void write(InputStream inputStream, String destination)
|
||||
throws IOException {
|
||||
}
|
||||
public void mkdir(String directory) throws IOException {
|
||||
public boolean mkdir(String directory) throws IOException {
|
||||
return true;
|
||||
}
|
||||
public void rename(String pathFrom, String pathTo)
|
||||
throws IOException {
|
||||
|
||||
@@ -119,8 +119,8 @@ class FtpSession implements Session<FTPFile> {
|
||||
}
|
||||
}
|
||||
|
||||
public void mkdir(String remoteDirectory) throws IOException {
|
||||
this.client.makeDirectory(remoteDirectory);
|
||||
public boolean mkdir(String remoteDirectory) throws IOException {
|
||||
return this.client.makeDirectory(remoteDirectory);
|
||||
}
|
||||
|
||||
public boolean exists(String path) throws IOException{
|
||||
|
||||
@@ -151,13 +151,14 @@ class SftpSession implements Session<LsEntry> {
|
||||
}
|
||||
}
|
||||
|
||||
public void mkdir(String remoteDirectory) throws IOException {
|
||||
public boolean mkdir(String remoteDirectory) throws IOException {
|
||||
try {
|
||||
this.channel.mkdir(remoteDirectory);
|
||||
}
|
||||
catch (SftpException e) {
|
||||
throw new NestedIOException("failed to create remote directory '" + remoteDirectory + "'.", e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean exists(String path) {
|
||||
|
||||
Reference in New Issue
Block a user