use of com.jn.agileway.ssh.client.sftp.ResponseStatusCode in project agileway by fangjinuo.
the class JschSftps method wrapSftpException.
public static SftpException wrapSftpException(com.jcraft.jsch.SftpException ex) {
ResponseStatusCode statusCode = Enums.ofCode(ResponseStatusCode.class, ex.id);
SftpException exception = null;
if (statusCode == ResponseStatusCode.NO_SUCH_FILE) {
exception = new NoSuchFileSftpException(ex);
} else {
exception = new SftpException(ex);
}
exception.setStatusCode(statusCode);
return exception;
}
use of com.jn.agileway.ssh.client.sftp.ResponseStatusCode in project agileway by fangjinuo.
the class Ssh2Sftps method wrapSftpException.
public static SftpException wrapSftpException(Throwable ex) {
if (ex instanceof SFTPException) {
ResponseStatusCode statusCode = Enums.ofCode(ResponseStatusCode.class, ((SFTPException) ex).getServerErrorCode());
SftpException exception = null;
if (statusCode == ResponseStatusCode.NO_SUCH_FILE) {
exception = new NoSuchFileSftpException(ex);
} else {
exception = new SftpException(ex);
}
exception.setStatusCode(statusCode);
return exception;
} else {
return new SftpException(ex);
}
}
use of com.jn.agileway.ssh.client.sftp.ResponseStatusCode in project agileway by fangjinuo.
the class SshjSftps method wrapSftpException.
public static SftpException wrapSftpException(Throwable ex) {
if (ex instanceof SFTPException) {
ResponseStatusCode statusCode = Enums.ofName(ResponseStatusCode.class, ((SFTPException) ex).getStatusCode().name());
SftpException exception = null;
if (statusCode == ResponseStatusCode.NO_SUCH_FILE) {
exception = new NoSuchFileSftpException(ex);
} else {
exception = new SftpException(ex);
}
exception.setStatusCode(statusCode);
return exception;
} else {
return new SftpException(ex);
}
}
use of com.jn.agileway.ssh.client.sftp.ResponseStatusCode in project agileway by fangjinuo.
the class Ssh2Sftps method wrapSftpException.
public static SftpException wrapSftpException(Throwable ex) {
if (ex instanceof SFTPException) {
ResponseStatusCode statusCode = Enums.ofCode(ResponseStatusCode.class, ((SFTPException) ex).getServerErrorCode());
SftpException exception = null;
if (statusCode == ResponseStatusCode.NO_SUCH_FILE) {
exception = new NoSuchFileSftpException(ex);
} else {
exception = new SftpException(ex);
}
exception.setStatusCode(statusCode);
return exception;
} else {
return new SftpException(ex);
}
}
Aggregations