Android Open Source - Orlib Authentication Exception






From Project

Back to project page Orlib.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project Orlib listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *//from w  w w .  j a v  a  2  s.co m
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

package net.sourceforge.jsocks.socks;

/**
 *  Exception thrown by various socks classes to indicate errors
 *  with protocol or unsuccessful server responses.
 *  
 *  @author rayc@google.com (Ray Colline)
 */
public class AuthenticationException extends Throwable {
  
   private AuthErrorType errorType;
   private String errorString;
    
   /**
    * Create an AuthenticationException with the specified type
    * 
    * @param errorType an enum denoting what kind of auth error.
    */
   public AuthenticationException(AuthErrorType errorType) {
       this.errorType = errorType;
       this.errorString = errorType.toString();
   }
   
   /**
    * Create an AuthenticationException with both the specified type and
    * a free-form message
    * 
    * @param errorType an enum denoting what kind of auth error.
    * @param errorString a specific string detailing the error.
    */
   public AuthenticationException(AuthErrorType errorType, 
       String errorString) {
       this.errorType = errorType;
       this.errorString = errorString;
   }
   
   /**
    * Get the error type associated with this exception.
    * 
    * @return errorType the type associated with this exception.
    */
   public AuthErrorType getErrorType() {
      return errorType;
   }
   
   /**
    * Get human readable representation of this exception.
    * 
    * @return String representation of this exception.
    */
   @Override
   public String toString() {
      return errorString;
   }

   /**
    * Returns the message associated with this exception
    * 
    * @return String the error string.
    */
   @Override
   public String getMessage() {
     return errorString;
   }

   /**
    * List of Authentication error types.
    * 
    * @author rayc@google.com (Ray Colline)
    */
   public enum AuthErrorType {
     MALFORMED_REQUEST,
     PASSWORD_TOO_LONG;
   }
   
}




Java Source Code List

info.guardianproject.net.SocksSocketFactory.java
info.guardianproject.net.http.HttpManager.java
info.guardianproject.net.http.ModSSLSocketFactory.java
info.guardianproject.net.http.MyDefaultClientConnectionOperator.java
info.guardianproject.net.http.MyThreadSafeClientConnManager.java
info.guardianproject.net.http.SocksHttpClient.java
net.sourceforge.jsocks.SOCKS.java
net.sourceforge.jsocks.SocksServerException.java
net.sourceforge.jsocks.socks.AuthenticationException.java
net.sourceforge.jsocks.socks.AuthenticationNone.java
net.sourceforge.jsocks.socks.Authentication.java
net.sourceforge.jsocks.socks.InetRange.java
net.sourceforge.jsocks.socks.ProxyMessage.java
net.sourceforge.jsocks.socks.ProxyServer.java
net.sourceforge.jsocks.socks.Proxy.java
net.sourceforge.jsocks.socks.Socks4Message.java
net.sourceforge.jsocks.socks.Socks4Proxy.java
net.sourceforge.jsocks.socks.Socks5DatagramSocket.java
net.sourceforge.jsocks.socks.Socks5Message.java
net.sourceforge.jsocks.socks.Socks5Proxy.java
net.sourceforge.jsocks.socks.SocksException.java
net.sourceforge.jsocks.socks.SocksServerSocket.java
net.sourceforge.jsocks.socks.SocksSocket.java
net.sourceforge.jsocks.socks.UDPEncapsulation.java
net.sourceforge.jsocks.socks.UDPRelayServer.java
net.sourceforge.jsocks.socks.UserPasswordAuthentication.java
net.sourceforge.jsocks.socks.server.IdentAuthenticator.java
net.sourceforge.jsocks.socks.server.Ident.java
net.sourceforge.jsocks.socks.server.ServerAuthenticatorNone.java
net.sourceforge.jsocks.socks.server.ServerAuthenticator.java
net.sourceforge.jsocks.socks.server.UserPasswordAuthenticator.java
net.sourceforge.jsocks.socks.server.UserValidation.java
orlib.sample.OrlibMainActivity.java