httpclient-4.3.2

16:36:35.677 INFO  jd.cli.Main - Decompiling httpclient-4.3.2.jar
package org.apache.http.auth;

import org.apache.http.annotation.Immutable;

@Immutable
public final class AUTH
{
  public static final String WWW_AUTH = "WWW-Authenticate";
  public static final String WWW_AUTH_RESP = "Authorization";
  public static final String PROXY_AUTH = "Proxy-Authenticate";
  public static final String PROXY_AUTH_RESP = "Proxy-Authorization";
}

/* Location:
 * Qualified Name:     org.apache.http.auth.AUTH
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import org.apache.http.ProtocolException;
import org.apache.http.annotation.Immutable;

@Immutable
public class AuthenticationException
  extends ProtocolException
{
  private static final long serialVersionUID = -6794031905674764776L;
  
  public AuthenticationException() {}
  
  public AuthenticationException(String message)
  {
    super(message);
  }
  
  public AuthenticationException(String message, Throwable cause)
  {
    super(message, cause);
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.AuthenticationException
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import org.apache.http.annotation.Immutable;
import org.apache.http.util.Args;

@Immutable
public final class AuthOption
{
  private final AuthScheme authScheme;
  private final Credentials creds;
  
  public AuthOption(AuthScheme authScheme, Credentials creds)
  {
    Args.notNull(authScheme, "Auth scheme");
    Args.notNull(creds, "User credentials");
    this.authScheme = authScheme;
    this.creds = creds;
  }
  
  public AuthScheme getAuthScheme()
  {
    return authScheme;
  }
  
  public Credentials getCredentials()
  {
    return creds;
  }
  
  public String toString()
  {
    return authScheme.toString();
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.AuthOption
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

public enum AuthProtocolState
{
  UNCHALLENGED,  CHALLENGED,  HANDSHAKE,  FAILURE,  SUCCESS;
  
  private AuthProtocolState() {}
}

/* Location:
 * Qualified Name:     org.apache.http.auth.AuthProtocolState
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import org.apache.http.Header;
import org.apache.http.HttpRequest;

public abstract interface AuthScheme
{
  public abstract void processChallenge(Header paramHeader)
    throws MalformedChallengeException;
  
  public abstract String getSchemeName();
  
  public abstract String getParameter(String paramString);
  
  public abstract String getRealm();
  
  public abstract boolean isConnectionBased();
  
  public abstract boolean isComplete();
  
  @Deprecated
  public abstract Header authenticate(Credentials paramCredentials, HttpRequest paramHttpRequest)
    throws AuthenticationException;
}

/* Location:
 * Qualified Name:     org.apache.http.auth.AuthScheme
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import org.apache.http.params.HttpParams;

@Deprecated
public abstract interface AuthSchemeFactory
{
  public abstract AuthScheme newInstance(HttpParams paramHttpParams);
}

/* Location:
 * Qualified Name:     org.apache.http.auth.AuthSchemeFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import org.apache.http.protocol.HttpContext;

public abstract interface AuthSchemeProvider
{
  public abstract AuthScheme create(HttpContext paramHttpContext);
}

/* Location:
 * Qualified Name:     org.apache.http.auth.AuthSchemeProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import org.apache.http.HttpRequest;
import org.apache.http.protocol.HttpContext;

class AuthSchemeRegistry$1
  implements AuthSchemeProvider
{
  AuthSchemeRegistry$1(AuthSchemeRegistry paramAuthSchemeRegistry, String paramString) {}
  
  public AuthScheme create(HttpContext context)
  {
    HttpRequest request = (HttpRequest)context.getAttribute("http.request");
    
    return this$0.getAuthScheme(val$name, request.getParams());
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.AuthSchemeRegistry.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.http.HttpRequest;
import org.apache.http.annotation.ThreadSafe;
import org.apache.http.config.Lookup;
import org.apache.http.params.HttpParams;
import org.apache.http.protocol.HttpContext;
import org.apache.http.util.Args;

@Deprecated
@ThreadSafe
public final class AuthSchemeRegistry
  implements Lookup<AuthSchemeProvider>
{
  private final ConcurrentHashMap<String, AuthSchemeFactory> registeredSchemes;
  
  public AuthSchemeRegistry()
  {
    registeredSchemes = new ConcurrentHashMap();
  }
  
  public void register(String name, AuthSchemeFactory factory)
  {
    Args.notNull(name, "Name");
    Args.notNull(factory, "Authentication scheme factory");
    registeredSchemes.put(name.toLowerCase(Locale.ENGLISH), factory);
  }
  
  public void unregister(String name)
  {
    Args.notNull(name, "Name");
    registeredSchemes.remove(name.toLowerCase(Locale.ENGLISH));
  }
  
  public AuthScheme getAuthScheme(String name, HttpParams params)
    throws IllegalStateException
  {
    Args.notNull(name, "Name");
    AuthSchemeFactory factory = (AuthSchemeFactory)registeredSchemes.get(name.toLowerCase(Locale.ENGLISH));
    if (factory != null) {
      return factory.newInstance(params);
    }
    throw new IllegalStateException("Unsupported authentication scheme: " + name);
  }
  
  public List<String> getSchemeNames()
  {
    return new ArrayList(registeredSchemes.keySet());
  }
  
  public void setItems(Map<String, AuthSchemeFactory> map)
  {
    if (map == null) {
      return;
    }
    registeredSchemes.clear();
    registeredSchemes.putAll(map);
  }
  
  public AuthSchemeProvider lookup(final String name)
  {
    new AuthSchemeProvider()
    {
      public AuthScheme create(HttpContext context)
      {
        HttpRequest request = (HttpRequest)context.getAttribute("http.request");
        
        return getAuthScheme(name, request.getParams());
      }
    };
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.AuthSchemeRegistry
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import java.util.Locale;
import org.apache.http.HttpHost;
import org.apache.http.annotation.Immutable;
import org.apache.http.util.Args;
import org.apache.http.util.LangUtils;

@Immutable
public class AuthScope
{
  public static final String ANY_HOST = null;
  public static final int ANY_PORT = -1;
  public static final String ANY_REALM = null;
  public static final String ANY_SCHEME = null;
  public static final AuthScope ANY = new AuthScope(ANY_HOST, -1, ANY_REALM, ANY_SCHEME);
  private final String scheme;
  private final String realm;
  private final String host;
  private final int port;
  
  public AuthScope(String host, int port, String realm, String scheme)
  {
    this.host = (host == null ? ANY_HOST : host.toLowerCase(Locale.ENGLISH));
    this.port = (port < 0 ? -1 : port);
    this.realm = (realm == null ? ANY_REALM : realm);
    this.scheme = (scheme == null ? ANY_SCHEME : scheme.toUpperCase(Locale.ENGLISH));
  }
  
  public AuthScope(HttpHost host, String realm, String schemeName)
  {
    this(host.getHostName(), host.getPort(), realm, schemeName);
  }
  
  public AuthScope(HttpHost host)
  {
    this(host, ANY_REALM, ANY_SCHEME);
  }
  
  public AuthScope(String host, int port, String realm)
  {
    this(host, port, realm, ANY_SCHEME);
  }
  
  public AuthScope(String host, int port)
  {
    this(host, port, ANY_REALM, ANY_SCHEME);
  }
  
  public AuthScope(AuthScope authscope)
  {
    Args.notNull(authscope, "Scope");
    host = authscope.getHost();
    port = authscope.getPort();
    realm = authscope.getRealm();
    scheme = authscope.getScheme();
  }
  
  public String getHost()
  {
    return host;
  }
  
  public int getPort()
  {
    return port;
  }
  
  public String getRealm()
  {
    return realm;
  }
  
  public String getScheme()
  {
    return scheme;
  }
  
  public int match(AuthScope that)
  {
    int factor = 0;
    if (LangUtils.equals(scheme, scheme)) {
      factor++;
    } else if ((scheme != ANY_SCHEME) && (scheme != ANY_SCHEME)) {
      return -1;
    }
    if (LangUtils.equals(realm, realm)) {
      factor += 2;
    } else if ((realm != ANY_REALM) && (realm != ANY_REALM)) {
      return -1;
    }
    if (port == port) {
      factor += 4;
    } else if ((port != -1) && (port != -1)) {
      return -1;
    }
    if (LangUtils.equals(host, host)) {
      factor += 8;
    } else if ((host != ANY_HOST) && (host != ANY_HOST)) {
      return -1;
    }
    return factor;
  }
  
  public boolean equals(Object o)
  {
    if (o == null) {
      return false;
    }
    if (o == this) {
      return true;
    }
    if (!(o instanceof AuthScope)) {
      return super.equals(o);
    }
    AuthScope that = (AuthScope)o;
    return (LangUtils.equals(host, host)) && (port == port) && (LangUtils.equals(realm, realm)) && (LangUtils.equals(scheme, scheme));
  }
  
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    if (scheme != null)
    {
      buffer.append(scheme.toUpperCase(Locale.ENGLISH));
      buffer.append(' ');
    }
    if (realm != null)
    {
      buffer.append('\'');
      buffer.append(realm);
      buffer.append('\'');
    }
    else
    {
      buffer.append("<any realm>");
    }
    if (host != null)
    {
      buffer.append('@');
      buffer.append(host);
      if (port >= 0)
      {
        buffer.append(':');
        buffer.append(port);
      }
    }
    return buffer.toString();
  }
  
  public int hashCode()
  {
    int hash = 17;
    hash = LangUtils.hashCode(hash, host);
    hash = LangUtils.hashCode(hash, port);
    hash = LangUtils.hashCode(hash, realm);
    hash = LangUtils.hashCode(hash, scheme);
    return hash;
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.AuthScope
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import java.util.Queue;
import org.apache.http.annotation.NotThreadSafe;
import org.apache.http.util.Args;

@NotThreadSafe
public class AuthState
{
  private AuthProtocolState state;
  private AuthScheme authScheme;
  private AuthScope authScope;
  private Credentials credentials;
  private Queue<AuthOption> authOptions;
  
  public AuthState()
  {
    state = AuthProtocolState.UNCHALLENGED;
  }
  
  public void reset()
  {
    state = AuthProtocolState.UNCHALLENGED;
    authOptions = null;
    authScheme = null;
    authScope = null;
    credentials = null;
  }
  
  public AuthProtocolState getState()
  {
    return state;
  }
  
  public void setState(AuthProtocolState state)
  {
    this.state = (state != null ? state : AuthProtocolState.UNCHALLENGED);
  }
  
  public AuthScheme getAuthScheme()
  {
    return authScheme;
  }
  
  public Credentials getCredentials()
  {
    return credentials;
  }
  
  public void update(AuthScheme authScheme, Credentials credentials)
  {
    Args.notNull(authScheme, "Auth scheme");
    Args.notNull(credentials, "Credentials");
    this.authScheme = authScheme;
    this.credentials = credentials;
    authOptions = null;
  }
  
  public Queue<AuthOption> getAuthOptions()
  {
    return authOptions;
  }
  
  public boolean hasAuthOptions()
  {
    return (authOptions != null) && (!authOptions.isEmpty());
  }
  
  public void update(Queue<AuthOption> authOptions)
  {
    Args.notEmpty(authOptions, "Queue of auth options");
    this.authOptions = authOptions;
    authScheme = null;
    credentials = null;
  }
  
  @Deprecated
  public void invalidate()
  {
    reset();
  }
  
  @Deprecated
  public boolean isValid()
  {
    return authScheme != null;
  }
  
  @Deprecated
  public void setAuthScheme(AuthScheme authScheme)
  {
    if (authScheme == null)
    {
      reset();
      return;
    }
    this.authScheme = authScheme;
  }
  
  @Deprecated
  public void setCredentials(Credentials credentials)
  {
    this.credentials = credentials;
  }
  
  @Deprecated
  public AuthScope getAuthScope()
  {
    return authScope;
  }
  
  @Deprecated
  public void setAuthScope(AuthScope authScope)
  {
    this.authScope = authScope;
  }
  
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    buffer.append("state:").append(state).append(";");
    if (authScheme != null) {
      buffer.append("auth scheme:").append(authScheme.getSchemeName()).append(";");
    }
    if (credentials != null) {
      buffer.append("credentials present");
    }
    return buffer.toString();
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.AuthState
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import java.io.Serializable;
import java.security.Principal;
import org.apache.http.annotation.Immutable;
import org.apache.http.util.Args;
import org.apache.http.util.LangUtils;

@Immutable
public final class BasicUserPrincipal
  implements Principal, Serializable
{
  private static final long serialVersionUID = -2266305184969850467L;
  private final String username;
  
  public BasicUserPrincipal(String username)
  {
    Args.notNull(username, "User name");
    this.username = username;
  }
  
  public String getName()
  {
    return username;
  }
  
  public int hashCode()
  {
    int hash = 17;
    hash = LangUtils.hashCode(hash, username);
    return hash;
  }
  
  public boolean equals(Object o)
  {
    if (this == o) {
      return true;
    }
    if ((o instanceof BasicUserPrincipal))
    {
      BasicUserPrincipal that = (BasicUserPrincipal)o;
      if (LangUtils.equals(username, username)) {
        return true;
      }
    }
    return false;
  }
  
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    buffer.append("[principal: ");
    buffer.append(username);
    buffer.append("]");
    return buffer.toString();
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.BasicUserPrincipal
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

public enum ChallengeState
{
  TARGET,  PROXY;
  
  private ChallengeState() {}
}

/* Location:
 * Qualified Name:     org.apache.http.auth.ChallengeState
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import org.apache.http.Header;
import org.apache.http.HttpRequest;
import org.apache.http.protocol.HttpContext;

public abstract interface ContextAwareAuthScheme
  extends AuthScheme
{
  public abstract Header authenticate(Credentials paramCredentials, HttpRequest paramHttpRequest, HttpContext paramHttpContext)
    throws AuthenticationException;
}

/* Location:
 * Qualified Name:     org.apache.http.auth.ContextAwareAuthScheme
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import java.security.Principal;

public abstract interface Credentials
{
  public abstract Principal getUserPrincipal();
  
  public abstract String getPassword();
}

/* Location:
 * Qualified Name:     org.apache.http.auth.Credentials
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import org.apache.http.annotation.Immutable;

@Immutable
public class InvalidCredentialsException
  extends AuthenticationException
{
  private static final long serialVersionUID = -4834003835215460648L;
  
  public InvalidCredentialsException() {}
  
  public InvalidCredentialsException(String message)
  {
    super(message);
  }
  
  public InvalidCredentialsException(String message, Throwable cause)
  {
    super(message, cause);
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.InvalidCredentialsException
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import org.apache.http.ProtocolException;
import org.apache.http.annotation.Immutable;

@Immutable
public class MalformedChallengeException
  extends ProtocolException
{
  private static final long serialVersionUID = 814586927989932284L;
  
  public MalformedChallengeException() {}
  
  public MalformedChallengeException(String message)
  {
    super(message);
  }
  
  public MalformedChallengeException(String message, Throwable cause)
  {
    super(message, cause);
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.MalformedChallengeException
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import java.io.Serializable;
import java.security.Principal;
import java.util.Locale;
import org.apache.http.annotation.Immutable;
import org.apache.http.util.Args;
import org.apache.http.util.LangUtils;

@Immutable
public class NTCredentials
  implements Credentials, Serializable
{
  private static final long serialVersionUID = -7385699315228907265L;
  private final NTUserPrincipal principal;
  private final String password;
  private final String workstation;
  
  public NTCredentials(String usernamePassword)
  {
    Args.notNull(usernamePassword, "Username:password string");
    
    int atColon = usernamePassword.indexOf(':');
    String username;
    if (atColon >= 0)
    {
      String username = usernamePassword.substring(0, atColon);
      password = usernamePassword.substring(atColon + 1);
    }
    else
    {
      username = usernamePassword;
      password = null;
    }
    int atSlash = username.indexOf('/');
    if (atSlash >= 0) {
      principal = new NTUserPrincipal(username.substring(0, atSlash).toUpperCase(Locale.ENGLISH), username.substring(atSlash + 1));
    } else {
      principal = new NTUserPrincipal(null, username.substring(atSlash + 1));
    }
    workstation = null;
  }
  
  public NTCredentials(String userName, String password, String workstation, String domain)
  {
    Args.notNull(userName, "User name");
    principal = new NTUserPrincipal(domain, userName);
    this.password = password;
    if (workstation != null) {
      this.workstation = workstation.toUpperCase(Locale.ENGLISH);
    } else {
      this.workstation = null;
    }
  }
  
  public Principal getUserPrincipal()
  {
    return principal;
  }
  
  public String getUserName()
  {
    return principal.getUsername();
  }
  
  public String getPassword()
  {
    return password;
  }
  
  public String getDomain()
  {
    return principal.getDomain();
  }
  
  public String getWorkstation()
  {
    return workstation;
  }
  
  public int hashCode()
  {
    int hash = 17;
    hash = LangUtils.hashCode(hash, principal);
    hash = LangUtils.hashCode(hash, workstation);
    return hash;
  }
  
  public boolean equals(Object o)
  {
    if (this == o) {
      return true;
    }
    if ((o instanceof NTCredentials))
    {
      NTCredentials that = (NTCredentials)o;
      if ((LangUtils.equals(principal, principal)) && (LangUtils.equals(workstation, workstation))) {
        return true;
      }
    }
    return false;
  }
  
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    buffer.append("[principal: ");
    buffer.append(principal);
    buffer.append("][workstation: ");
    buffer.append(workstation);
    buffer.append("]");
    return buffer.toString();
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.NTCredentials
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import java.io.Serializable;
import java.security.Principal;
import java.util.Locale;
import org.apache.http.annotation.Immutable;
import org.apache.http.util.Args;
import org.apache.http.util.LangUtils;

@Immutable
public class NTUserPrincipal
  implements Principal, Serializable
{
  private static final long serialVersionUID = -6870169797924406894L;
  private final String username;
  private final String domain;
  private final String ntname;
  
  public NTUserPrincipal(String domain, String username)
  {
    Args.notNull(username, "User name");
    this.username = username;
    if (domain != null) {
      this.domain = domain.toUpperCase(Locale.ENGLISH);
    } else {
      this.domain = null;
    }
    if ((this.domain != null) && (this.domain.length() > 0))
    {
      StringBuilder buffer = new StringBuilder();
      buffer.append(this.domain);
      buffer.append('\\');
      buffer.append(this.username);
      ntname = buffer.toString();
    }
    else
    {
      ntname = this.username;
    }
  }
  
  public String getName()
  {
    return ntname;
  }
  
  public String getDomain()
  {
    return domain;
  }
  
  public String getUsername()
  {
    return username;
  }
  
  public int hashCode()
  {
    int hash = 17;
    hash = LangUtils.hashCode(hash, username);
    hash = LangUtils.hashCode(hash, domain);
    return hash;
  }
  
  public boolean equals(Object o)
  {
    if (this == o) {
      return true;
    }
    if ((o instanceof NTUserPrincipal))
    {
      NTUserPrincipal that = (NTUserPrincipal)o;
      if ((LangUtils.equals(username, username)) && (LangUtils.equals(domain, domain))) {
        return true;
      }
    }
    return false;
  }
  
  public String toString()
  {
    return ntname;
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.NTUserPrincipal
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth.params;

import org.apache.http.params.HttpAbstractParamBean;
import org.apache.http.params.HttpParams;

@Deprecated
public class AuthParamBean
  extends HttpAbstractParamBean
{
  public AuthParamBean(HttpParams params)
  {
    super(params);
  }
  
  public void setCredentialCharset(String charset)
  {
    AuthParams.setCredentialCharset(params, charset);
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.params.AuthParamBean
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth.params;

import java.nio.charset.Charset;
import org.apache.http.annotation.Immutable;
import org.apache.http.params.HttpParams;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.Args;

@Deprecated
@Immutable
public final class AuthParams
{
  public static String getCredentialCharset(HttpParams params)
  {
    Args.notNull(params, "HTTP parameters");
    String charset = (String)params.getParameter("http.auth.credential-charset");
    if (charset == null) {
      charset = HTTP.DEF_PROTOCOL_CHARSET.name();
    }
    return charset;
  }
  
  public static void setCredentialCharset(HttpParams params, String charset)
  {
    Args.notNull(params, "HTTP parameters");
    params.setParameter("http.auth.credential-charset", charset);
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.params.AuthParams
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth.params;

@Deprecated
public abstract interface AuthPNames
{
  public static final String CREDENTIAL_CHARSET = "http.auth.credential-charset";
  public static final String TARGET_AUTH_PREF = "http.auth.target-scheme-pref";
  public static final String PROXY_AUTH_PREF = "http.auth.proxy-scheme-pref";
}

/* Location:
 * Qualified Name:     org.apache.http.auth.params.AuthPNames
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.auth;

import java.io.Serializable;
import java.security.Principal;
import org.apache.http.annotation.Immutable;
import org.apache.http.util.Args;
import org.apache.http.util.LangUtils;

@Immutable
public class UsernamePasswordCredentials
  implements Credentials, Serializable
{
  private static final long serialVersionUID = 243343858802739403L;
  private final BasicUserPrincipal principal;
  private final String password;
  
  public UsernamePasswordCredentials(String usernamePassword)
  {
    Args.notNull(usernamePassword, "Username:password string");
    int atColon = usernamePassword.indexOf(':');
    if (atColon >= 0)
    {
      principal = new BasicUserPrincipal(usernamePassword.substring(0, atColon));
      password = usernamePassword.substring(atColon + 1);
    }
    else
    {
      principal = new BasicUserPrincipal(usernamePassword);
      password = null;
    }
  }
  
  public UsernamePasswordCredentials(String userName, String password)
  {
    Args.notNull(userName, "Username");
    principal = new BasicUserPrincipal(userName);
    this.password = password;
  }
  
  public Principal getUserPrincipal()
  {
    return principal;
  }
  
  public String getUserName()
  {
    return principal.getName();
  }
  
  public String getPassword()
  {
    return password;
  }
  
  public int hashCode()
  {
    return principal.hashCode();
  }
  
  public boolean equals(Object o)
  {
    if (this == o) {
      return true;
    }
    if ((o instanceof UsernamePasswordCredentials))
    {
      UsernamePasswordCredentials that = (UsernamePasswordCredentials)o;
      if (LangUtils.equals(principal, principal)) {
        return true;
      }
    }
    return false;
  }
  
  public String toString()
  {
    return principal.toString();
  }
}

/* Location:
 * Qualified Name:     org.apache.http.auth.UsernamePasswordCredentials
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.client;

import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScheme;

public abstract interface AuthCache
{
  public abstract void put(HttpHost paramHttpHost, AuthScheme paramAuthScheme);
  
  public abstract AuthScheme get(HttpHost paramHttpHost);
  
  public abstract void remove(HttpHost paramHttpHost);
  
  public abstract void clear();
}

/* Location:
 * Qualified Name:     org.apache.http.client.AuthCache
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.client;

import java.util.Map;
import org.apache.http.Header;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScheme;
import org.apache.http.auth.AuthenticationException;
import org.apache.http.auth.MalformedChallengeException;
import org.apache.http.protocol.HttpContext;

@Deprecated
public abstract interface AuthenticationHandler
{
  public abstract boolean isAuthenticationRequested(HttpResponse paramHttpResponse, HttpContext paramHttpContext);
  
  public abstract Map<String, Header> getChallenges(HttpResponse paramHttpResponse, HttpContext paramHttpContext)
    throws MalformedChallengeException;
  
  public abstract AuthScheme selectScheme(Map<String, Header> paramMap, HttpResponse paramHttpResponse, HttpContext paramHttpContext)
    throws AuthenticationException;
}

/* Location:
 * Qualified Name:     org.apache.http.client.AuthenticationHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.client;

import java.util.Map;
import java.util.Queue;
import org.apache.http.Header;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthOption;
import org.apache.http.auth.AuthScheme;
import org.apache.http.auth.MalformedChallengeException;
import org.apache.http.protocol.HttpContext;

public abstract interface AuthenticationStrategy
{
  public abstract boolean isAuthenticationRequested(HttpHost paramHttpHost, HttpResponse paramHttpResponse, HttpContext paramHttpContext);
  
  public abstract Map<String, Header> getChallenges(HttpHost paramHttpHost, HttpResponse paramHttpResponse, HttpContext paramHttpContext)
    throws MalformedChallengeException;
  
  public abstract Queue<AuthOption> select(Map<String, Header> paramMap, HttpHost paramHttpHost, HttpResponse paramHttpResponse, HttpContext paramHttpContext)
    throws MalformedChallengeException;
  
  public abstract void authSucceeded(HttpHost paramHttpHost, AuthScheme paramAuthScheme, HttpContext paramHttpContext);
  
  public abstract void authFailed(HttpHost paramHttpHost, AuthScheme paramAuthScheme, HttpContext paramHttpContext);
}

/* Location:
 * Qualified Name:     org.apache.http.client.AuthenticationStrategy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.client;

import org.apache.http.conn.routing.HttpRoute;

public abstract interface BackoffManager
{
  public abstract void backOff(HttpRoute paramHttpRoute);
  
  public abstract void probe(HttpRoute paramHttpRoute);
}

/* Location:
 * Qualified Name:     org.apache.http.client.BackoffManager
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.client;

import org.apache.http.annotation.Immutable;

@Immutable
public class CircularRedirectException
  extends RedirectException
{
  private static final long serialVersionUID = 6830063487001091803L;
  
  public CircularRedirectException() {}
  
  public CircularRedirectException(String message)
  {
    super(message);
  }
  
  public CircularRedirectException(String message, Throwable cause)
  {
    super(message, cause);
  }
}

/* Location:
 * Qualified Name:     org.apache.http.client.CircularRedirectException
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.client;

import java.io.IOException;
import org.apache.http.annotation.Immutable;

@Immutable
public class ClientProtocolException
  extends IOException
{
  private static final long serialVersionUID = -5596590843227115865L;
  
  public ClientProtocolException() {}
  
  public ClientProtocolException(String s)
  {
    super(s);
  }
  
  public ClientProtocolException(Throwable cause)
  {
    initCause(cause);
  }
  
  public ClientProtocolException(String message, Throwable cause)
  {
    super(message);
    initCause(cause);
  }
}

/* Location:
 * Qualified Name:     org.apache.http.client.ClientProtocolException
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.client.config;

import org.apache.http.annotation.Immutable;

@Immutable
public final class AuthSchemes
{
  public static final String BASIC = "Basic";
  public static final String DIGEST = "Digest";
  public static final String NTLM = "NTLM";
  public static final String SPNEGO = "negotiate";
  public static final String KERBEROS = "Kerberos";
}

/* Location:
 * Qualified Name:     org.apache.http.client.config.AuthSchemes
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.client.config;

import org.apache.http.annotation.Immutable;

@Immutable
public final class CookieSpecs
{
  public static final String BROWSER_COMPATIBILITY = "compatibility";
  public static final String NETSCAPE = "netscape";
  public static final String STANDARD = "standard";
  public static final String BEST_MATCH = "best-match";
  public static final String IGNORE_COOKIES = "ignoreCookies";
}

/* Location:
 * Qualified Name:     org.apache.http.client.config.CookieSpecs
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.client.config;

import java.net.InetAddress;
import java.util.Collection;
import org.apache.http.HttpHost;

public class RequestConfig$Builder
{
  private boolean expectContinueEnabled;
  private HttpHost proxy;
  private InetAddress localAddress;
  private boolean staleConnectionCheckEnabled;
  private String cookieSpec;
  private boolean redirectsEnabled;
  private boolean relativeRedirectsAllowed;
  private boolean circularRedirectsAllowed;
  private int maxRedirects;
  private boolean authenticationEnabled;
  private Collection<String> targetPreferredAuthSchemes;
  private Collection<String> proxyPreferredAuthSchemes;
  private int connectionRequestTimeout;
  private int connectTimeout;
  private int socketTimeout;
  
  RequestConfig$Builder()
  {
    staleConnectionCheckEnabled = true;
    redirectsEnabled = true;
    maxRedirects = 50;
    relativeRedirectsAllowed = true;
    authenticationEnabled = true;
    connectionRequestTimeout = -1;
    connectTimeout = -1;
    socketTimeout = -1;
  }
  
  public Builder setExpectContinueEnabled(boolean expectContinueEnabled)
  {
    this.expectContinueEnabled = expectContinueEnabled;
    return this;
  }
  
  public Builder setProxy(HttpHost proxy)
  {
    this.proxy = proxy;
    return this;
  }
  
  public Builder setLocalAddress(InetAddress localAddress)
  {
    this.localAddress = localAddress;
    return this;
  }
  
  public Builder setStaleConnectionCheckEnabled(boolean staleConnectionCheckEnabled)
  {
    this.staleConnectionCheckEnabled = staleConnectionCheckEnabled;
    return this;
  }
  
  public Builder setCookieSpec(String cookieSpec)
  {
    this.cookieSpec = cookieSpec;
    return this;
  }
  
  public Builder setRedirectsEnabled(boolean redirectsEnabled)
  {
    this.redirectsEnabled = redirectsEnabled;
    return this;
  }
  
  public Builder setRelativeRedirectsAllowed(boolean relativeRedirectsAllowed)
  {
    this.relativeRedirectsAllowed = relativeRedirectsAllowed;
    return this;
  }
  
  public Builder setCircularRedirectsAllowed(boolean circularRedirectsAllowed)
  {
    this.circularRedirectsAllowed = circularRedirectsAllowed;
    return this;
  }
  
  public Builder setMaxRedirects(int maxRedirects)
  {
    this.maxRedirects = maxRedirects;
    return this;
  }
  
  public Builder setAuthenticationEnabled(boolean authenticationEnabled)
  {
    this.authenticationEnabled = authenticationEnabled;
    return this;
  }
  
  public Builder setTargetPreferredAuthSchemes(Collection<String> targetPreferredAuthSchemes)
  {
    this.targetPreferredAuthSchemes = targetPreferredAuthSchemes;
    return this;
  }
  
  public Builder setProxyPreferredAuthSchemes(Collection<String> proxyPreferredAuthSchemes)
  {
    this.proxyPreferredAuthSchemes = proxyPreferredAuthSchemes;
    return this;
  }
  
  public Builder setConnectionRequestTimeout(int connectionRequestTimeout)
  {
    this.connectionRequestTimeout = connectionRequestTimeout;
    return this;
  }
  
  public Builder setConnectTimeout(int connectTimeout)
  {
    this.connectTimeout = connectTimeout;
    return this;
  }
  
  public Builder setSocketTimeout(int socketTimeout)
  {
    this.socketTimeout = socketTimeout;
    return this;
  }
  
  public RequestConfig build()
  {
    return new RequestConfig(expectContinueEnabled, proxy, localAddress, staleConnectionCheckEnabled, cookieSpec, redirectsEnabled, relativeRedirectsAllowed, circularRedirectsAllowed, maxRedirects, authenticationEnabled, targetPreferredAuthSchemes, proxyPreferredAuthSchemes, connectionRequestTimeout, connectTimeout, socketTimeout);
  }
}

/* Location:
 * Qualified Name:     org.apache.http.client.config.RequestConfig.Builder
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.http.client.config;

import java.net.InetAddress;
import java.util.Collection;
import org.apache.http.HttpHost;

public class RequestConfig
  implements Cloneable
{
  public static final RequestConfig DEFAULT = new Builder().build();
  private final boolean expectContinueEnabled;
  private final HttpHost proxy;
  private final InetAddress localAddress;
  private final boolean staleConnectionCheckEnabled;
  private final String cookieSpec;
  private final boolean redirectsEnabled;
  private final boolean relativeRedirectsAllowed;
  private final boolean circularRedirectsAllowed;
  private final int maxRedirects;
  private final boolean authenticationEnabled;
  private final Collection<String> targetPreferredAuthSchemes;
  private final Collection<String> proxyPreferredAuthSchemes;
  private final int connectionRequestTimeout;
  private final int connectTimeout;
  private final int socketTimeout;
  
  RequestConfig(boolean expectContinueEnabled, HttpHost proxy, InetAddress localAddress, boolean staleConnectionCheckEnabled, String cookieSpec, boolean redirectsEnabled, boolean relativeRedirectsAllowed, boolean circularRedirectsAllowed, int maxRedirects, boolean authenticationEnabled, Collection<String> targetPreferredAuthSchemes, Collection<String> proxyPreferredAuthSchemes, int connectionRequestTimeout, int connectTimeout, int socketTimeout)
  {
    this.expectContinueEnabled = expectContinueEnabled;
    this.proxy = proxy;
    this.localAddress = localAddress;
    this.staleConnectionCheckEnabled = staleConnectionCheckEnabled;
    this.cookieSpec = cookieSpec;
    this.redirectsEnabled = redirectsEnabled;
    this.relativeRedirectsAllowed = relativeRedirectsAllowed;
    this.circularRedirectsAllowed = circularRedirectsAllowed;
    this.maxRedirects = maxRedirects;
    this.authenticationEnabled = authenticationEnabled;
    this.targetPreferredAuthSchemes = targetPreferredAuthSchemes;
    this.proxyPreferredAuthSchemes = proxyPreferredAuthSchemes;
    this.connectionRequestTimeout = connectionRequestTimeout;
    this.connectTimeout = connectTimeout;
    this.socketTimeout = socketTimeout;
  }
  
  public boolean isExpectContinueEnabled()
  {
    return expectContinueEnabled;
  }
  
  public HttpHost getProxy()
  {
    return proxy;
  }
  
  public InetAddress getLocalAddress()
  {
    return localAddress;
  }
  
  public boolean isStaleConnectionCheckEnabled()
  {
    return staleConnectionCheckEnabled;
  }
  
  public String getCookieSpec()
  {
    return cookieSpec;
  }
  
  public boolean isRedirectsEnabled()
  {
    return redirectsEnabled;
  }
  
  public boolean isRelativeRedirectsAllowed()
  {
    return relativeRedirectsAllowed;
  }
  
  public boolean isCircularRedirectsAllowed()
  {
    return circularRedirectsAllowed;
  }
  
  public int getMaxRedirects()
  {
    return maxRedirects;
  }
  
  public boolean isAuthenticationEnabled()
  {
    return authenticationEnabled;
  }
  
  public Collection<String> getTargetPreferredAuthSchemes()
  {
    return targetPreferredAuthSchemes;
  }
  
  public Collection<String> getProxyPreferredAuthSchemes()
  {
    return proxyPreferredAuthSchemes;
  }
  
  public int getConnectionRequestTimeout()
  {
    return connectionRequestTimeout;
  }
  
  public int getConnectTimeout()
  {
    return connectTimeout;
  }
  
  public int getSocketTimeout()
  {
    return socketTimeout;
  }
  
  protected RequestConfig clone()
    throws CloneNotSupportedException
  {
    return (RequestConfig)super.clone();
  }
  
  public String toString()
  {
    StringBuilder builder = new StringBuilder();
    builder.append(", expectContinueEnabled=").append(expectContinueEnabled);
    builder.append(", proxy=").append(proxy);
    builder.append(", localAddress=").append(localAddress);
    builder.append(", staleConnectionCheckEnabled=").append(staleConnectionCheckEnabled);
    builder.append(", cookieSpec=").append(cookieSpec);
    builder.append(", redirectsEnabled=").append(redirectsEnabled);
    builder.append(", relativeRedirectsAllowed=").append(relativeRedirectsAllowed);
    builder.append(", maxRedirects=").append(maxRedirects);
    builder.append(", circularRedirectsAllowed=").append(circularRedirectsAllowed);
    builder.append(", authenticationEnabled=").append(authenticationEnabled);
    builder.append(", targetPreferredAuthSchemes=").append(targetPreferredAuthSchemes);
    builder.append(", proxyPreferredAuthSchemes=").append(proxyPreferredAuthSchemes);
    builder.append(", connectionRequestTimeout=").append(connectionRequestTimeout);
    builder.append(", connectTimeout=").append(connectTimeout);
    builder.append(", socketTimeout=").append(socketTimeout);
    builder.append("]");
    return builder.toString();
  }
  
  public static Builder custom()
  {
    return new Builder();
  }
  
  public static Builder copy(RequestConfig config)
  {
    return new Builder().setExpectContinueEnabled(config.isExpectContinueEnabled()).setProxy(config.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd