diff options
author | Kenny Root <kenny@the-b.org> | 2015-07-24 16:13:51 -0700 |
---|---|---|
committer | Kenny Root <kenny@the-b.org> | 2015-07-24 16:13:51 -0700 |
commit | d3c4f49d68ba97f43aacbe86d4ece7546eee4f15 (patch) | |
tree | 6cfe6093f69737af10bc5437acc10942795f2b57 /app/src/main/java/com/trilead/ssh2/SFTPException.java | |
parent | 739337624a5e69221a998cf10b1fd34fcc5ecd2d (diff) | |
parent | 571d61b6b55bc3eb9540e17973d93cc15b22da23 (diff) | |
download | connectbot-d3c4f49d68ba97f43aacbe86d4ece7546eee4f15.tar.gz connectbot-d3c4f49d68ba97f43aacbe86d4ece7546eee4f15.tar.bz2 connectbot-d3c4f49d68ba97f43aacbe86d4ece7546eee4f15.zip |
Merge pull request #105 from kruton/master
Update to library-based build
Diffstat (limited to 'app/src/main/java/com/trilead/ssh2/SFTPException.java')
-rw-r--r-- | app/src/main/java/com/trilead/ssh2/SFTPException.java | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/app/src/main/java/com/trilead/ssh2/SFTPException.java b/app/src/main/java/com/trilead/ssh2/SFTPException.java deleted file mode 100644 index d97723f..0000000 --- a/app/src/main/java/com/trilead/ssh2/SFTPException.java +++ /dev/null @@ -1,91 +0,0 @@ - -package com.trilead.ssh2; - -import java.io.IOException; - -import com.trilead.ssh2.sftp.ErrorCodes; - - -/** - * Used in combination with the SFTPv3Client. This exception wraps - * error messages sent by the SFTP server. - * - * @author Christian Plattner, plattner@trilead.com - * @version $Id: SFTPException.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $ - */ - -public class SFTPException extends IOException -{ - private static final long serialVersionUID = 578654644222421811L; - - private final String sftpErrorMessage; - private final int sftpErrorCode; - - private static String constructMessage(String s, int errorCode) - { - String[] detail = ErrorCodes.getDescription(errorCode); - - if (detail == null) - return s + " (UNKNOW SFTP ERROR CODE)"; - - return s + " (" + detail[0] + ": " + detail[1] + ")"; - } - - SFTPException(String msg, int errorCode) - { - super(constructMessage(msg, errorCode)); - sftpErrorMessage = msg; - sftpErrorCode = errorCode; - } - - /** - * Get the error message sent by the server. Often, this - * message does not help a lot (e.g., "failure"). - * - * @return the plain string as sent by the server. - */ - public String getServerErrorMessage() - { - return sftpErrorMessage; - } - - /** - * Get the error code sent by the server. - * - * @return an error code as defined in the SFTP specs. - */ - public int getServerErrorCode() - { - return sftpErrorCode; - } - - /** - * Get the symbolic name of the error code as given in the SFTP specs. - * - * @return e.g., "SSH_FX_INVALID_FILENAME". - */ - public String getServerErrorCodeSymbol() - { - String[] detail = ErrorCodes.getDescription(sftpErrorCode); - - if (detail == null) - return "UNKNOW SFTP ERROR CODE " + sftpErrorCode; - - return detail[0]; - } - - /** - * Get the description of the error code as given in the SFTP specs. - * - * @return e.g., "The filename is not valid." - */ - public String getServerErrorCodeVerbose() - { - String[] detail = ErrorCodes.getDescription(sftpErrorCode); - - if (detail == null) - return "The error code " + sftpErrorCode + " is unknown."; - - return detail[1]; - } -} |