diff options
author | Kenny Root <kenny@the-b.org> | 2013-04-11 21:01:32 -0700 |
---|---|---|
committer | Kenny Root <kenny@the-b.org> | 2013-04-11 21:01:32 -0700 |
commit | d8e49ec3f297f9ba0991762eb2cddbc00ed634d2 (patch) | |
tree | aac59c707c980e90202241c7a9c306ab9d278a1c /src/com/trilead/ssh2/SFTPException.java | |
parent | 847af5046fb7d2dbcc668cecf81f1726b7c48bd9 (diff) | |
download | connectbot-d8e49ec3f297f9ba0991762eb2cddbc00ed634d2.tar.gz connectbot-d8e49ec3f297f9ba0991762eb2cddbc00ed634d2.tar.bz2 connectbot-d8e49ec3f297f9ba0991762eb2cddbc00ed634d2.zip |
Fix line endings
Diffstat (limited to 'src/com/trilead/ssh2/SFTPException.java')
-rw-r--r-- | src/com/trilead/ssh2/SFTPException.java | 182 |
1 files changed, 91 insertions, 91 deletions
diff --git a/src/com/trilead/ssh2/SFTPException.java b/src/com/trilead/ssh2/SFTPException.java index f3b6d3e..d97723f 100644 --- a/src/com/trilead/ssh2/SFTPException.java +++ b/src/com/trilead/ssh2/SFTPException.java @@ -1,91 +1,91 @@ -
-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];
- }
-}
+ +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]; + } +} |