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/net/sourceforge/jsocks/SocksException.java | |
parent | 847af5046fb7d2dbcc668cecf81f1726b7c48bd9 (diff) | |
download | connectbot-d8e49ec3f297f9ba0991762eb2cddbc00ed634d2.tar.gz connectbot-d8e49ec3f297f9ba0991762eb2cddbc00ed634d2.tar.bz2 connectbot-d8e49ec3f297f9ba0991762eb2cddbc00ed634d2.zip |
Fix line endings
Diffstat (limited to 'src/net/sourceforge/jsocks/SocksException.java')
-rw-r--r-- | src/net/sourceforge/jsocks/SocksException.java | 160 |
1 files changed, 80 insertions, 80 deletions
diff --git a/src/net/sourceforge/jsocks/SocksException.java b/src/net/sourceforge/jsocks/SocksException.java index 867eff6..764587f 100644 --- a/src/net/sourceforge/jsocks/SocksException.java +++ b/src/net/sourceforge/jsocks/SocksException.java @@ -1,80 +1,80 @@ -package net.sourceforge.jsocks;
-
-/**
- Exception thrown by various socks classes to indicate errors
- with protocol or unsuccessful server responses.
-*/
-public class SocksException extends java.io.IOException{
- private static final long serialVersionUID = 6141184566248512277L;
-
- /**
- Construct a SocksException with given error code.
- <p>
- Tries to look up message which corresponds to this error code.
- @param errCode Error code for this exception.
- */
- public SocksException(int errCode){
- this.errCode = errCode;
- if((errCode >> 16) == 0){
- //Server reply error message
- errString = errCode <= serverReplyMessage.length ?
- serverReplyMessage[errCode] :
- UNASSIGNED_ERROR_MESSAGE;
- }else{
- //Local error
- errCode = (errCode >> 16) -1;
- errString = errCode <= localErrorMessage.length ?
- localErrorMessage[errCode] :
- UNASSIGNED_ERROR_MESSAGE;
- }
- }
- /**
- Constructs a SocksException with given error code and message.
- @param errCode Error code.
- @param errString Error Message.
- */
- public SocksException(int errCode,String errString){
- this.errCode = errCode;
- this.errString = errString;
- }
- /**
- Get the error code associated with this exception.
- @return Error code associated with this exception.
- */
- public int getErrorCode(){
- return errCode;
- }
- /**
- Get human readable representation of this exception.
- @return String represntation of this exception.
- */
- public String toString(){
- return errString;
- }
-
- static final String UNASSIGNED_ERROR_MESSAGE =
- "Unknown error message";
- static final String serverReplyMessage[] = {
- "Succeeded",
- "General SOCKS server failure",
- "Connection not allowed by ruleset",
- "Network unreachable",
- "Host unreachable",
- "Connection refused",
- "TTL expired",
- "Command not supported",
- "Address type not supported" };
-
- static final String localErrorMessage[] ={
- "SOCKS server not specified",
- "Unable to contact SOCKS server",
- "IO error",
- "None of Authentication methods are supported",
- "Authentication failed",
- "General SOCKS fault" };
-
- String errString;
- public int errCode;
-
-}//End of SocksException class
-
+package net.sourceforge.jsocks; + +/** + Exception thrown by various socks classes to indicate errors + with protocol or unsuccessful server responses. +*/ +public class SocksException extends java.io.IOException{ + private static final long serialVersionUID = 6141184566248512277L; + + /** + Construct a SocksException with given error code. + <p> + Tries to look up message which corresponds to this error code. + @param errCode Error code for this exception. + */ + public SocksException(int errCode){ + this.errCode = errCode; + if((errCode >> 16) == 0){ + //Server reply error message + errString = errCode <= serverReplyMessage.length ? + serverReplyMessage[errCode] : + UNASSIGNED_ERROR_MESSAGE; + }else{ + //Local error + errCode = (errCode >> 16) -1; + errString = errCode <= localErrorMessage.length ? + localErrorMessage[errCode] : + UNASSIGNED_ERROR_MESSAGE; + } + } + /** + Constructs a SocksException with given error code and message. + @param errCode Error code. + @param errString Error Message. + */ + public SocksException(int errCode,String errString){ + this.errCode = errCode; + this.errString = errString; + } + /** + Get the error code associated with this exception. + @return Error code associated with this exception. + */ + public int getErrorCode(){ + return errCode; + } + /** + Get human readable representation of this exception. + @return String represntation of this exception. + */ + public String toString(){ + return errString; + } + + static final String UNASSIGNED_ERROR_MESSAGE = + "Unknown error message"; + static final String serverReplyMessage[] = { + "Succeeded", + "General SOCKS server failure", + "Connection not allowed by ruleset", + "Network unreachable", + "Host unreachable", + "Connection refused", + "TTL expired", + "Command not supported", + "Address type not supported" }; + + static final String localErrorMessage[] ={ + "SOCKS server not specified", + "Unable to contact SOCKS server", + "IO error", + "None of Authentication methods are supported", + "Authentication failed", + "General SOCKS fault" }; + + String errString; + public int errCode; + +}//End of SocksException class + |