Fixed several issues
This commit is contained in:
parent
cfa4fe1280
commit
ee5c05f588
@ -49,7 +49,7 @@ public class FtpsCredentials {
|
||||
|
||||
this.host = array2[0];
|
||||
this.port = Integer.valueOf(array20[0]);
|
||||
this.workingDir = array20.length < 2 ? "/" : array20[1];
|
||||
this.workingDir = array20.length < 2 ? "/" : array2[1].substring(array20[0].length() + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -56,7 +56,10 @@ public class MkdirCommand implements Command {
|
||||
try {
|
||||
ftps.connect(config.getHost(), config.getPort());
|
||||
ftps.login(config.getUser(), config.getPassword());
|
||||
ftps.changeWorkingDirectory(config.getWorkingDir());
|
||||
boolean changeDirResult = ftps.changeWorkingDirectory(config.getWorkingDir());
|
||||
if(!changeDirResult) {
|
||||
throw new RuntimeException("Changing directory failed: " + config.getWorkingDir());
|
||||
}
|
||||
|
||||
ftps.enterLocalPassiveMode();
|
||||
ftps.setFileType(FTP.BINARY_FILE_TYPE);
|
||||
|
@ -56,7 +56,10 @@ public class UploadCommand implements Command {
|
||||
try {
|
||||
ftps.connect(config.getHost(), config.getPort());
|
||||
ftps.login(config.getUser(), config.getPassword());
|
||||
ftps.changeWorkingDirectory(config.getWorkingDir());
|
||||
boolean changeDirResult = ftps.changeWorkingDirectory(config.getWorkingDir());
|
||||
if(!changeDirResult) {
|
||||
throw new RuntimeException("Changing directory failed: " + config.getWorkingDir());
|
||||
}
|
||||
FileInputStream fileInputStream = new FileInputStream(fileName);
|
||||
ftps.enterLocalPassiveMode();
|
||||
ftps.setFileType(FTP.BINARY_FILE_TYPE);
|
||||
|
@ -56,7 +56,10 @@ public class UploadFilesCommand implements Command {
|
||||
try {
|
||||
ftps.connect(config.getHost(), config.getPort());
|
||||
ftps.login(config.getUser(), config.getPassword());
|
||||
ftps.changeWorkingDirectory(config.getWorkingDir());
|
||||
boolean changeDirResult = ftps.changeWorkingDirectory(config.getWorkingDir());
|
||||
if(!changeDirResult) {
|
||||
throw new RuntimeException("Changing directory failed: " + config.getWorkingDir());
|
||||
}
|
||||
ftps.enterLocalPassiveMode();
|
||||
ftps.setFileType(FTP.BINARY_FILE_TYPE);
|
||||
|
||||
|
Reference in New Issue
Block a user