com.crashlytics.tools.android_2.1.0

rg.apache.http.impl.client.cache.CacheConfig;
import org.apache.http.impl.client.cache.DefaultHttpCacheEntrySerializer;

public class EhcacheHttpCacheStorage
  implements HttpCacheStorage
{
  private final Ehcache cache;
  private final HttpCacheEntrySerializer serializer;
  private final int maxUpdateRetries;
  
  public EhcacheHttpCacheStorage(Ehcache cache)
  {
    this(cache, CacheConfig.DEFAULT, new DefaultHttpCacheEntrySerializer());
  }
  
  public EhcacheHttpCacheStorage(Ehcache cache, CacheConfig config)
  {
    this(cache, config, new DefaultHttpCacheEntrySerializer());
  }
  
  public EhcacheHttpCacheStorage(Ehcache cache, CacheConfig config, HttpCacheEntrySerializer serializer)
  {
    this.cache = cache;
    maxUpdateRetries = config.getMaxUpdateRetries();
    this.serializer = serializer;
  }
  
  public synchronized void putEntry(String key, HttpCacheEntry entry)
    throws IOException
  {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    serializer.writeTo(entry, bos);
    cache.put(new Element(key, bos.toByteArray()));
  }
  
  public synchronized HttpCacheEntry getEntry(String key)
    throws IOException
  {
    Element e = cache.get(key);
    if (e == null) {
      return null;
    }
    byte[] data = (byte[])e.getValue();
    return serializer.readFrom(new ByteArrayInputStream(data));
  }
  
  public synchronized void removeEntry(String key)
  {
    cache.remove(key);
  }
  
  public synchronized void updateEntry(String key, HttpCacheUpdateCallback callback)
    throws IOException, HttpCacheUpdateException
  {
    int numRetries = 0;
    do
    {
      Element oldElement = cache.get(key);
      
      HttpCacheEntry existingEntry = null;
      if (oldElement != null)
      {
        byte[] data = (byte[])oldElement.getValue();
        existingEntry = serializer.readFrom(new ByteArrayInputStream(data));
      }
      HttpCacheEntry updatedEntry = callback.update(existingEntry);
      if (existingEntry == null)
      {
        putEntry(key, updatedEntry);
        return;
      }
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      serializer.writeTo(updatedEntry, bos);
      Element newElement = new Element(key, bos.toByteArray());
      if (cache.replace(oldElement, newElement)) {
        return;
      }
      numRetries++;
    } while (numRetries <= maxUpdateRetries);
    throw new HttpCacheUpdateException("Failed to update");
  }
}

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

public abstract interface KeyHashingScheme
{
  public abstract String hash(String paramString);
}

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

import org.apache.http.client.cache.HttpCacheEntry;

public abstract interface MemcachedCacheEntry
{
  public abstract byte[] toByteArray();
  
  public abstract String getStorageKey();
  
  public abstract HttpCacheEntry getHttpCacheEntry();
  
  public abstract void set(byte[] paramArrayOfByte);
}

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

import org.apache.http.client.cache.HttpCacheEntry;

public abstract interface MemcachedCacheEntryFactory
{
  public abstract MemcachedCacheEntry getMemcachedCacheEntry(String paramString, HttpCacheEntry paramHttpCacheEntry);
  
  public abstract MemcachedCacheEntry getUnsetCacheEntry();
}

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

import org.apache.http.client.cache.HttpCacheEntry;

public class MemcachedCacheEntryFactoryImpl
  implements MemcachedCacheEntryFactory
{
  public MemcachedCacheEntry getMemcachedCacheEntry(String key, HttpCacheEntry entry)
  {
    return new MemcachedCacheEntryImpl(key, entry);
  }
  
  public MemcachedCacheEntry getUnsetCacheEntry()
  {
    return new MemcachedCacheEntryImpl(null, null);
  }
}

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

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import org.apache.http.client.cache.HttpCacheEntry;

public class MemcachedCacheEntryImpl
  implements MemcachedCacheEntry
{
  private String key;
  private HttpCacheEntry httpCacheEntry;
  
  public MemcachedCacheEntryImpl(String key, HttpCacheEntry httpCacheEntry)
  {
    this.key = key;
    this.httpCacheEntry = httpCacheEntry;
  }
  
  public MemcachedCacheEntryImpl() {}
  
  public synchronized byte[] toByteArray()
  {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    try
    {
      ObjectOutputStream oos = new ObjectOutputStream(bos);
      oos.writeObject(key);
      oos.writeObject(httpCacheEntry);
      oos.close();
    }
    catch (IOException ioe)
    {
      throw new MemcachedSerializationException(ioe);
    }
    return bos.toByteArray();
  }
  
  public synchronized String getStorageKey()
  {
    return key;
  }
  
  public synchronized HttpCacheEntry getHttpCacheEntry()
  {
    return httpCacheEntry;
  }
  
  public synchronized void set(byte[] bytes)
  {
    ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
    String s;
    HttpCacheEntry entry;
    try
    {
      ObjectInputStream ois = new ObjectInputStream(bis);
      s = (String)ois.readObject();
      entry = (HttpCacheEntry)ois.readObject();
      ois.close();
      bis.close();
    }
    catch (IOException ioe)
    {
      throw new MemcachedSerializationException(ioe);
    }
    catch (ClassNotFoundException cnfe)
    {
      throw new MemcachedSerializationException(cnfe);
    }
    key = s;
    httpCacheEntry = entry;
  }
}

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

import java.io.IOException;
import java.net.InetSocketAddress;
import net.spy.memcached.CASResponse;
import net.spy.memcached.CASValue;
import net.spy.memcached.MemcachedClient;
import net.spy.memcached.MemcachedClientIF;
import net.spy.memcached.OperationTimeoutException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.client.cache.HttpCacheEntry;
import org.apache.http.client.cache.HttpCacheEntrySerializer;
import org.apache.http.client.cache.HttpCacheStorage;
import org.apache.http.client.cache.HttpCacheUpdateCallback;
import org.apache.http.client.cache.HttpCacheUpdateException;
import org.apache.http.impl.client.cache.CacheConfig;

public class MemcachedHttpCacheStorage
  implements HttpCacheStorage
{
  private static final Log log = LogFactory.getLog(MemcachedHttpCacheStorage.class);
  private final MemcachedClientIF client;
  private final KeyHashingScheme keyHashingScheme;
  private final MemcachedCacheEntryFactory memcachedCacheEntryFactory;
  private final int maxUpdateRetries;
  
  public MemcachedHttpCacheStorage(InetSocketAddress address)
    throws IOException
  {
    this(new MemcachedClient(new InetSocketAddress[] { address }));
  }
  
  public MemcachedHttpCacheStorage(MemcachedClientIF cache)
  {
    this(cache, CacheConfig.DEFAULT, new MemcachedCacheEntryFactoryImpl(), new SHA256KeyHashingScheme());
  }
  
  @Deprecated
  public MemcachedHttpCacheStorage(MemcachedClientIF client, CacheConfig config, HttpCacheEntrySerializer serializer)
  {
    this(client, config, new MemcachedCacheEntryFactoryImpl(), new SHA256KeyHashingScheme());
  }
  
  public MemcachedHttpCacheStorage(MemcachedClientIF client, CacheConfig config, MemcachedCacheEntryFactory memcachedCacheEntryFactory, KeyHashingScheme keyHashingScheme)
  {
    this.client = client;
    maxUpdateRetries = config.getMaxUpdateRetries();
    this.memcachedCacheEntryFactory = memcachedCacheEntryFactory;
    this.keyHashingScheme = keyHashingScheme;
  }
  
  public void putEntry(String url, HttpCacheEntry entry)
    throws IOException
  {
    byte[] bytes = serializeEntry(url, entry);
    String key = getCacheKey(url);
    if (key == null) {
      return;
    }
    try
    {
      client.set(key, 0, bytes);
    }
    catch (OperationTimeoutException ex)
    {
      throw new MemcachedOperationTimeoutException(ex);
    }
  }
  
  private String getCacheKey(String url)
  {
    try
    {
      return keyHashingScheme.hash(url);
    }
    catch (MemcachedKeyHashingException mkhe) {}
    return null;
  }
  
  private byte[] serializeEntry(String url, HttpCacheEntry hce)
    throws IOException
  {
    MemcachedCacheEntry mce = memcachedCacheEntryFactory.getMemcachedCacheEntry(url, hce);
    try
    {
      return mce.toByteArray();
    }
    catch (MemcachedSerializationException mse)
    {
      IOException ioe = new IOException();
      ioe.initCause(mse);
      throw ioe;
    }
  }
  
  private byte[] convertToByteArray(Object o)
  {
    if (o == null) {
      return null;
    }
    if (!(o instanceof byte[]))
    {
      log.warn("got a non-bytearray back from memcached: " + o);
      return null;
    }
    return (byte[])o;
  }
  
  private MemcachedCacheEntry reconstituteEntry(Object o)
  {
    byte[] bytes = convertToByteArray(o);
    if (bytes == null) {
      return null;
    }
    MemcachedCacheEntry mce = memcachedCacheEntryFactory.getUnsetCacheEntry();
    try
    {
      mce.set(bytes);
    }
    catch (MemcachedSerializationException mse)
    {
      return null;
    }
    return mce;
  }
  
  public HttpCacheEntry getEntry(String url)
    throws IOException
  {
    String key = getCacheKey(url);
    if (key == null) {
      return null;
    }
    try
    {
      MemcachedCacheEntry mce = reconstituteEntry(client.get(key));
      if ((mce == null) || (!url.equals(mce.getStorageKey()))) {
        return null;
      }
      return mce.getHttpCacheEntry();
    }
    catch (OperationTimeoutException ex)
    {
      throw new MemcachedOperationTimeoutException(ex);
    }
  }
  
  public void removeEntry(String url)
    throws IOException
  {
    String key = getCacheKey(url);
    if (key == null) {
      return;
    }
    try
    {
      client.delete(key);
    }
    catch (OperationTimeoutException ex)
    {
      throw new MemcachedOperationTimeoutException(ex);
    }
  }
  
  public void updateEntry(String url, HttpCacheUpdateCallback callback)
    throws HttpCacheUpdateException, IOException
  {
    int numRetries = 0;
    String key = getCacheKey(url);
    if (key == null) {
      throw new HttpCacheUpdateException("couldn't generate cache key");
    }
    do
    {
      try
      {
        CASValue<Object> v = client.gets(key);
        MemcachedCacheEntry mce = v == null ? null : reconstituteEntry(v.getValue());
        if ((mce != null) && (!url.equals(mce.getStorageKey()))) {
          mce = null;
        }
        HttpCacheEntry existingEntry = mce == null ? null : mce.getHttpCacheEntry();
        
        HttpCacheEntry updatedEntry = callback.update(existingEntry);
        if (existingEntry == null)
        {
          putEntry(url, updatedEntry);
          return;
        }
        byte[] updatedBytes = serializeEntry(url, updatedEntry);
        CASResponse casResult = client.cas(key, v.getCas(), updatedBytes);
        if (casResult != CASResponse.OK) {
          numRetries++;
        } else {
          return;
        }
      }
      catch (OperationTimeoutException ex)
      {
        throw new MemcachedOperationTimeoutException(ex);
      }
    } while (numRetries <= maxUpdateRetries);
    throw new HttpCacheUpdateException("Failed to update");
  }
}

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

public class MemcachedKeyHashingException
  extends RuntimeException
{
  private static final long serialVersionUID = -7553380015989141114L;
  
  public MemcachedKeyHashingException(Throwable cause)
  {
    super(cause);
  }
}

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

import java.io.IOException;

class MemcachedOperationTimeoutException
  extends IOException
{
  private static final long serialVersionUID = 1608334789051537010L;
  
  public MemcachedOperationTimeoutException(Throwable cause)
  {
    super(cause.getMessage());
    initCause(cause);
  }
}

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

public class MemcachedSerializationException
  extends RuntimeException
{
  private static final long serialVersionUID = 2201652990656412236L;
  
  public MemcachedSerializationException(Throwable cause)
  {
    super(cause);
  }
}

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

public class PrefixKeyHashingScheme
  implements KeyHashingScheme
{
  private final String prefix;
  private final KeyHashingScheme backingScheme;
  
  public PrefixKeyHashingScheme(String prefix, KeyHashingScheme backingScheme)
  {
    this.prefix = prefix;
    this.backingScheme = backingScheme;
  }
  
  public String hash(String storageKey)
  {
    return prefix + backingScheme.hash(storageKey);
  }
}

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

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class SHA256KeyHashingScheme
  implements KeyHashingScheme
{
  private static final Log log = LogFactory.getLog(SHA256KeyHashingScheme.class);
  
  public String hash(String key)
  {
    MessageDigest md = getDigest();
    md.update(key.getBytes());
    return Hex.encodeHexString(md.digest());
  }
  
  private MessageDigest getDigest()
  {
    try
    {
      return MessageDigest.getInstance("SHA-256");
    }
    catch (NoSuchAlgorithmException nsae)
    {
      log.error("can't find SHA-256 implementation for cache key hashing");
      throw new MemcachedKeyHashingException(nsae);
    }
  }
}

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

import java.io.IOException;

public class ConnectionClosedException
  extends IOException
{
  private static final long serialVersionUID = 617550366255636674L;
  
  public ConnectionClosedException(String message)
  {
    super(message);
  }
}

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

import org.apache.http.protocol.HttpContext;

public abstract interface ConnectionReuseStrategy
{
  public abstract boolean keepAlive(HttpResponse paramHttpResponse, HttpContext paramHttpContext);
}

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

import java.nio.charset.Charset;

public final class Consts
{
  public static final int CR = 13;
  public static final int LF = 10;
  public static final int SP = 32;
  public static final int HT = 9;
  public static final Charset UTF_8 = Charset.forName("UTF-8");
  public static final Charset ASCII = Charset.forName("US-ASCII");
  public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
}

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

import java.io.IOException;

public class ContentTooLongException
  extends IOException
{
  private static final long serialVersionUID = -924287689552495383L;
  
  public ContentTooLongException(String message)
  {
    super(message);
  }
}

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

import org.apache.http.util.CharArrayBuffer;

public abstract interface FormattedHeader
  extends Header
{
  public abstract CharArrayBuffer getBuffer();
  
  public abstract int getValuePos();
}

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

public abstract interface Header
{
  public abstract String getName();
  
  public abstract String getValue();
  
  public abstract HeaderElement[] getElements()
    throws ParseException;
}

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

public abstract interface HeaderElement
{
  public abstract String getName();
  
  public abstract String getValue();
  
  public abstract NameValuePair[] getParameters();
  
  public abstract NameValuePair getParameterByName(String paramString);
  
  public abstract int getParameterCount();
  
  public abstract NameValuePair getParameter(int paramInt);
}

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

import java.util.Iterator;

public abstract interface HeaderElementIterator
  extends Iterator<Object>
{
  public abstract boolean hasNext();
  
  public abstract HeaderElement nextElement();
}

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

import java.util.Iterator;

public abstract interface HeaderIterator
  extends Iterator<Object>
{
  public abstract boolean hasNext();
  
  public abstract Header nextHeader();
}

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

import java.io.IOException;

public abstract interface HttpClientConnection
  extends HttpConnection
{
  public abstract boolean isResponseAvailable(int paramInt)
    throws IOException;
  
  public abstract void sendRequestHeader(HttpRequest paramHttpRequest)
    throws HttpException, IOException;
  
  public abstract void sendRequestEntity(HttpEntityEnclosingRequest paramHttpEntityEnclosingRequest)
    throws HttpException, IOException;
  
  public abstract HttpResponse receiveResponseHeader()
    throws HttpException, IOException;
  
  public abstract void receiveResponseEntity(HttpResponse paramHttpResponse)
    throws HttpException, IOException;
  
  public abstract void flush()
    throws IOException;
}

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

import java.io.Closeable;
import java.io.IOException;

public abstract interface HttpConnection
  extends Closeable
{
  public abstract void close()
    throws IOException;
  
  public abstract boolean isOpen();
  
  public abstract boolean isStale();
  
  public abstract void setSocketTimeout(int paramInt);
  
  public abstract int getSocketTimeout();
  
  public abstract void shutdown()
    throws IOException;
  
  public abstract HttpConnectionMetrics getMetrics();
}

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

import java.io.IOException;
import java.net.Socket;

public abstract interface HttpConnectionFactory<T extends HttpConnection>
{
  public abstract T createConnection(Socket paramSocket)
    throws IOException;
}

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

public abstract interface HttpConnectionMetrics
{
  public abstract long getRequestCount();
  
  public abstract long getResponseCount();
  
  public abstract long getSentBytesCount();
  
  public abstract long getReceivedBytesCount();
  
  public abstract Object getMetric(String paramString);
  
  public abstract void reset();
}

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

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public abstract interface HttpEntity
{
  public abstract boolean isRepeatable();
  
  public abstract boolean isChunked();
  
  public abstract long getContentLength();
  
  public abstract Header getContentType();
  
  public abstract Header getContentEncoding();
  
  public abstract InputStream getContent()
    throws IOException, IllegalStateException;
  
  public abstract void writeTo(OutputStream paramOutputStream)
    throws IOException;
  
  public abstract boolean isStreaming();
  
  @Deprecated
  public abstract void consumeContent()
    throws IOException;
}

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

public abstract interface HttpEntityEnclosingRequest
  extends HttpRequest
{
  public abstract boolean expectContinue();
  
  public abstract void setEntity(HttpEntity paramHttpEntity);
  
  public abstract HttpEntity getEntity();
}

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

public class HttpException
  extends Exception
{
  private static final long serialVersionUID = -5437299376222011036L;
  
  public HttpException() {}
  
  public HttpException(String message)
  {
    super(message);
  }
  
  public HttpException(String message, Throwable cause)
  {
    super(message);
    initCause(cause);
  }
}

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

public final class HttpHeaders
{
  public static final String ACCEPT = "Accept";
  public static final String ACCEPT_CHARSET = "Accept-Charset";
  public static final String ACCEPT_ENCODING = "Accept-Encoding";
  public static final String ACCEPT_LANGUAGE = "Accept-Language";
  public static final String ACCEPT_RANGES = "Accept-Ranges";
  public static final String AGE = "Age";
  public static final String ALLOW = "Allow";
  public static final String AUTHORIZATION = "Authorization";
  public static final String CACHE_CONTROL = "Cache-Control";
  public static final String CONNECTION = "Connection";
  public static final String CONTENT_ENCODING = "Content-Encoding";
  public static final String CONTENT_LANGUAGE = "Content-Language";
  public static final String CONTENT_LENGTH = "Content-Length";
  public static final String CONTENT_LOCATION = "Content-Location";
  public static final String CONTENT_MD5 = "Content-MD5";
  public static final String CONTENT_RANGE = "Content-Range";
  public static final String CONTENT_TYPE = "Content-Type";
  public static final String DATE = "Date";
  public static final String DAV = "Dav";
  public static final String DEPTH = "Depth";
  public static final String DESTINATION = "Destination";
  public static final String ETAG = "ETag";
  public static final String EXPECT = "Expect";
  public static final String EXPIRES = "Expires";
  public static final String FROM = "From";
  public static final String HOST = "Host";
  public static final String IF = "If";
  public static final String IF_MATCH = "If-Match";
  public static final String IF_MODIFIED_SINCE = "If-Modified-Since";
  public static final String IF_NONE_MATCH = "If-None-Match";
  public static final String IF_RANGE = "If-Range";
  public static final String IF_UNMODIFIED_SINCE = "If-Unmodified-Since";
  public static final String LAST_MODIFIED = "Last-Modified";
  public static final String LOCATION = "Location";
  public static final String LOCK_TOKEN = "Lock-Token";
  public static final String MAX_FORWARDS = "Max-Forwards";
  public static final String OVERWRITE = "Overwrite";
  public static final String PRAGMA = "Pragma";
  public static final String PROXY_AUTHENTICATE = "Proxy-Authenticate";
  public static final String PROXY_AUTHORIZATION = "Proxy-Authorization";
  public static final String RANGE = "Range";
  public static final String REFERER = "Referer";
  public static final String RETRY_AFTER = "Retry-After";
  public static final String SERVER = "Server";
  public static final String STATUS_URI = "Status-URI";
  public static final String TE = "TE";
  public static final String TIMEOUT = "Timeout";
  public static final String TRAILER = "Trailer";
  public static final String TRANSFER_ENCODING = "Transfer-Encoding";
  public static final String UPGRADE = "Upgrade";
  public static final String USER_AGENT = "User-Agent";
  public static final String VARY = "Vary";
  public static final String VIA = "Via";
  public static final String WARNING = "Warning";
  public static final String WWW_AUTHENTICATE = "WWW-Authenticate";
}

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

import java.io.Serializable;
import java.net.InetAddress;
import java.util.Locale;
import org.apache.http.annotation.Immutable;
import org.apache.http.util.Args;
import org.apache.http.util.LangUtils;

@Immutable
public final class HttpHost
  implements Cloneable, Serializable
{
  private static final long serialVersionUID = -7529410654042457626L;
  public static final String DEFAULT_SCHEME_NAME = "http";
  protected final String hostname;
  protected final String lcHostname;
  protected final int port;
  protected final String schemeName;
  protected final InetAddress address;
  
  public HttpHost(String hostname, int port, String scheme)
  {
    this.hostname = ((String)Args.notNull(hostname, "Host name"));
    lcHostname = hostname.toLowerCase(Locale.ENGLISH);
    if (scheme != null) {
      schemeName = scheme.toLowerCase(Locale.ENGLISH);
    } else {
      schemeName = "http";
    }
    this.port = port;
    address = null;
  }
  
  public HttpHost(String hostname, int port)
  {
    this(hostname, port, null);
  }
  
  public HttpHost(String hostname)
  {
    this(hostname, -1, null);
  }
  
  public HttpHost(InetAddress address, int port, String scheme)
  {
    this.address = ((InetAddress)Args.notNull(address, "Inet address"));
    hostname = address.getHostAddress();
    lcHostname = hostname.toLowerCase(Locale.ENGLISH);
    if (scheme != null) {
      schemeName = scheme.toLowerCase(Locale.ENGLISH);
    } else {
      schemeName = "http";
    }
    this.port = port;
  }
  
  public HttpHost(InetAddress address, int port)
  {
    this(address, port, null);
  }
  
  public HttpHost(InetAddress address)
  {
    this(address, -1, null);
  }
  
  public HttpHost(HttpHost httphost)
  {
    Args.notNull(httphost, "HTTP host");
    hostname = hostname;
    lcHostname = lcHostname;
    schemeName = schemeName;
    port = port;
    address = address;
  }
  
  public String getHostName()
  {
    return hostname;
  }
  
  public int getPort()
  {
    return port;
  }
  
  public String getSchemeName()
  {
    return schemeName;
  }
  
  public InetAddress getAddress()
  {
    return address;
  }
  
  public String toURI()
  {
    StringBuilder buffer = new StringBuilder();
    buffer.append(schemeName);
    buffer.append("://");
    buffer.append(hostname);
    if (port != -1)
    {
      buffer.append(':');
      buffer.append(Integer.toString(port));
    }
    return buffer.toString();
  }
  
  public String toHostString()
  {
    if (port != -1)
    {
      StringBuilder buffer = new StringBuilder(hostname.length() + 6);
      buffer.append(hostname);
      buffer.append(":");
      buffer.append(Integer.toString(port));
      return buffer.toString();
    }
    return hostname;
  }
  
  public String toString()
  {
    return toURI();
  }
  
  public boolean equals(Object obj)
  {
    if (this == obj) {
      return true;
    }
    if ((obj instanceof HttpHost))
    {
      HttpHost that = (HttpHost)obj;
      return (lcHostname.equals(lcHostname)) && (port == port) && (schemeName.equals(schemeName));
    }
    return false;
  }
  
  public int hashCode()
  {
    int hash = 17;
    hash = LangUtils.hashCode(hash, lcHostname);
    hash = LangUtils.hashCode(hash, port);
    hash = LangUtils.hashCode(hash, schemeName);
    return hash;
  }
  
  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }
}

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

import java.net.InetAddress;

public abstract interface HttpInetConnection
  extends HttpConnection
{
  public abstract InetAddress getLocalAddress();
  
  public abstract int getLocalPort();
  
  public abstract InetAddress getRemoteAddress();
  
  public abstract int getRemotePort();
}

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

import org.apache.http.params.HttpParams;

public abstract interface HttpMessage
{
  public abstract ProtocolVersion getProtocolVersion();
  
  public abstract boolean containsHeader(String paramString);
  
  public abstract Header[] getHeaders(String paramString);
  
  public abstract Header getFirstHeader(String paramString);
  
  public abstract Header getLastHeader(String paramString);
  
  public abstract Header[] getAllHeaders();
  
  public abstract void addHeader(Header paramHeader);
  
  public abstract void addHeader(String paramString1, String paramString2);
  
  public abstract void setHeader(Header paramHeader);
  
  public abstract void setHeader(String paramString1, String paramString2);
  
  public abstract void setHeaders(Header[] paramArrayOfHeader);
  
  public abstract void removeHeader(Header paramHeader);
  
  public abstract void removeHeaders(String paramString);
  
  public abstract HeaderIterator headerIterator();
  
  public abstract HeaderIterator headerIterator(String paramString);
  
  @Deprecated
  public abstract HttpParams getParams();
  
  @Deprecated
  public abstract void setParams(HttpParams paramHttpParams);
}

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

public abstract interface HttpRequest
  extends HttpMessage
{
  public abstract RequestLine getRequestLine();
}

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

public abstract interface HttpRequestFactory
{
  public abstract HttpRequest newHttpRequest(RequestLine paramRequestLine)
    throws MethodNotSupportedException;
  
  public abstract HttpRequest newHttpRequest(String paramString1, String paramString2)
    throws MethodNotSupportedException;
}

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

import java.io.IOException;
import org.apache.http.protocol.HttpContext;

public abstract interface HttpRequestInterceptor
{
  public abstract void process(HttpRequest paramHttpRequest, HttpContext paramHttpContext)
    throws HttpException, IOException;
}

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

import java.util.Locale;

public abstract interface HttpResponse
  extends HttpMessage
{
  public abstract StatusLine getStatusLine();
  
  public abstract void setStatusLine(StatusLine paramStatusLine);
  
  public abstract void setStatusLine(ProtocolVersion paramProtocolVersion, int paramInt);
  
  public abstract void setStatusLine(ProtocolVersion paramProtocolVersion, int paramInt, String paramString);
  
  public abstract void setStatusCode(int paramInt)
    throws IllegalStateException;
  
  public abstract void setReasonPhrase(String paramString)
    throws IllegalStateException;
  
  public abstract HttpEntity getEntity();
  
  public abstract void setEntity(HttpEntity paramHttpEntity);
  
  @Deprecated
  public abstract Locale getLocale();
  
  @Deprecated
  public abstract void setLocale(Locale paramLocale);
}

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

import org.apache.http.protocol.HttpContext;

public abstract interface HttpResponseFactory
{
  public abstract HttpResponse newHttpResponse(ProtocolVersion paramProtocolVersion, int paramInt, HttpContext paramHttpContext);
  
  public abstract HttpResponse newHttpResponse(StatusLine paramStatusLine, HttpContext paramHttpContext);
}

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

import java.io.IOException;
import org.apache.http.protocol.HttpContext;

public abstract interface HttpResponseInterceptor
{
  public abstract void process(HttpResponse paramHttpResponse, HttpContext paramHttpContext)
    throws HttpException, IOException;
}

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

import java.io.IOException;

public abstract interface HttpServerConnection
  extends HttpConnection
{
  public abstract HttpRequest receiveRequestHeader()
    throws HttpException, IOException;
  
  public abstract void receiveRequestEntity(HttpEntityEnclosingRequest paramHttpEntityEnclosingRequest)
    throws HttpException, IOException;
  
  public abstract void sendResponseHeader(HttpResponse paramHttpResponse)
    throws HttpException, IOException;
  
  public abstract void sendResponseEntity(HttpResponse paramHttpResponse)
    throws HttpException, IOException;
  
  public abstract void flush()
    throws IOException;
}

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

public abstract interface HttpStatus
{
  public static final int SC_CONTINUE = 100;
  public static final int SC_SWITCHING_PROTOCOLS = 101;
  public static final int SC_PROCESSING = 102;
  public static final int SC_OK = 200;
  public static final int SC_CREATED = 201;
  public static final int SC_ACCEPTED = 202;
  public static final int SC_NON_AUTHORITATIVE_INFORMATION = 203;
  public static final int SC_NO_CONTENT = 204;
  public static final int SC_RESET_CONTENT = 205;
  public static final int SC_PARTIAL_CONTENT = 206;
  public static final int SC_MULTI_STATUS = 207;
  public static final int SC_MULTIPLE_CHOICES = 300;
  public static final int SC_MOVED_PERMANENTLY = 301;
  public static final int SC_MOVED_TEMPORARILY = 302;
  public static final int SC_SEE_OTHER = 303;
  public static final int SC_NOT_MODIFIED = 304;
  public static final int SC_USE_PROXY = 305;
  public static final int SC_TEMPORARY_REDIRECT = 307;
  public static final int SC_BAD_REQUEST = 400;
  public static final int SC_UNAUTHORIZED = 401;
  public static final int SC_PAYMENT_REQUIRED = 402;
  public static final int SC_FORBIDDEN = 403;
  public static final int SC_NOT_FOUND = 404;
  public static final int SC_METHOD_NOT_ALLOWED = 405;
  public static final int SC_NOT_ACCEPTABLE = 406;
  public static final int SC_PROXY_AUTHENTICATION_REQUIRED = 407;
  public static final int SC_REQUEST_TIMEOUT = 408;
  public static final int SC_CONFLICT = 409;
  public static final int SC_GONE = 410;
  public static final int SC_LENGTH_REQUIRED = 411;
  public static final int SC_PRECONDITION_FAILED = 412;
  public static final int SC_REQUEST_TOO_LONG = 413;
  public static final int SC_REQUEST_URI_TOO_LONG = 414;
  public static final int SC_UNSUPPORTED_MEDIA_TYPE = 415;
  public static final int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
  public static final int SC_EXPECTATION_FAILED = 417;
  public static final int SC_INSUFFICIENT_SPACE_ON_RESOURCE = 419;
  public static final int SC_METHOD_FAILURE = 420;
  public static final int SC_UNPROCESSABLE_ENTITY = 422;
  public static final int SC_LOCKED = 423;
  public static final int SC_FAILED_DEPENDENCY = 424;
  public static final int SC_INTERNAL_SERVER_ERROR = 500;
  public static final int SC_NOT_IMPLEMENTED = 501;
  public static final int SC_BAD_GATEWAY = 502;
  public static final int SC_SERVICE_UNAVAILABLE = 503;
  public static final int SC_GATEWAY_TIMEOUT = 504;
  public static final int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
  public static final int SC_INSUFFICIENT_STORAGE = 507;
}

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

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

@Immutable
public final class HttpVersion
  extends ProtocolVersion
  implements Serializable
{
  private static final long serialVersionUID = -5856653513894415344L;
  public static final String HTTP = "HTTP";
  public static final HttpVersion HTTP_0_9 = new HttpVersion(0, 9);
  public static final HttpVersion HTTP_1_0 = new HttpVersion(1, 0);
  public static final HttpVersion HTTP_1_1 = new HttpVersion(1, 1);
  
  public HttpVersion(int major, int minor)
  {
    super("HTTP", major, minor);
  }
  
  public ProtocolVersion forVersion(int major, int minor)
  {
    if ((major == this.major) && (minor == this.minor)) {
      return this;
    }
    if (major == 1)
    {
      if (minor == 0) {
        return HTTP_1_0;
      }
      if (minor == 1) {
        return HTTP_1_1;
      }
    }
    if ((major == 0) && (minor == 9)) {
      return HTTP_0_9;
    }
    return new HttpVersion(major, minor);
  }
}

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

import java.io.IOException;

public class MalformedChunkCodingException
  extends IOException
{
  private static final long serialVersionUID = 2158560246948994524L;
  
  public MalformedChunkCodingException() {}
  
  public MalformedChunkCodingException(String message)
  {
    super(message);
  }
}

/* Location:
 * Qu
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109

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-2019. Infinite Loop Ltd