aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/net/sourceforge/jsocks/SocksException.java
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2015-07-23 22:38:46 -0700
committerKenny Root <kenny@the-b.org>2015-07-24 15:35:39 -0700
commit147dae0102979a0217ac8a9eea82a4969a1ecf63 (patch)
tree40718fac7fc6a3afce07c910ffc243dd5d69d403 /app/src/main/java/net/sourceforge/jsocks/SocksException.java
parent739337624a5e69221a998cf10b1fd34fcc5ecd2d (diff)
downloadconnectbot-147dae0102979a0217ac8a9eea82a4969a1ecf63.tar.gz
connectbot-147dae0102979a0217ac8a9eea82a4969a1ecf63.tar.bz2
connectbot-147dae0102979a0217ac8a9eea82a4969a1ecf63.zip
Move to library-based build
Diffstat (limited to 'app/src/main/java/net/sourceforge/jsocks/SocksException.java')
-rw-r--r--app/src/main/java/net/sourceforge/jsocks/SocksException.java80
1 files changed, 0 insertions, 80 deletions
diff --git a/app/src/main/java/net/sourceforge/jsocks/SocksException.java b/app/src/main/java/net/sourceforge/jsocks/SocksException.java
deleted file mode 100644
index 764587f..0000000
--- a/app/src/main/java/net/sourceforge/jsocks/SocksException.java
+++ /dev/null
@@ -1,80 +0,0 @@
-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
-