commons-codec-1.3

URL, bytes);
  }
  
  public byte[] decode(byte[] bytes)
    throws DecoderException
  {
    return decodeUrl(bytes);
  }
  
  public String encode(String pString, String charset)
    throws UnsupportedEncodingException
  {
    if (pString == null) {
      return null;
    }
    return new String(encode(pString.getBytes(charset)), "US-ASCII");
  }
  
  public String encode(String pString)
    throws EncoderException
  {
    if (pString == null) {
      return null;
    }
    try
    {
      return encode(pString, getDefaultCharset());
    }
    catch (UnsupportedEncodingException e)
    {
      throw new EncoderException(e.getMessage());
    }
  }
  
  public String decode(String pString, String charset)
    throws DecoderException, UnsupportedEncodingException
  {
    if (pString == null) {
      return null;
    }
    return new String(decode(pString.getBytes("US-ASCII")), charset);
  }
  
  public String decode(String pString)
    throws DecoderException
  {
    if (pString == null) {
      return null;
    }
    try
    {
      return decode(pString, getDefaultCharset());
    }
    catch (UnsupportedEncodingException e)
    {
      throw new DecoderException(e.getMessage());
    }
  }
  
  public Object encode(Object pObject)
    throws EncoderException
  {
    if (pObject == null) {
      return null;
    }
    if ((pObject instanceof byte[])) {
      return encode((byte[])pObject);
    }
    if ((pObject instanceof String)) {
      return encode((String)pObject);
    }
    throw new EncoderException("Objects of type " + pObject.getClass().getName() + " cannot be URL encoded");
  }
  
  public Object decode(Object pObject)
    throws DecoderException
  {
    if (pObject == null) {
      return null;
    }
    if ((pObject instanceof byte[])) {
      return decode((byte[])pObject);
    }
    if ((pObject instanceof String)) {
      return decode((String)pObject);
    }
    throw new DecoderException("Objects of type " + pObject.getClass().getName() + " cannot be URL decoded");
  }
  
  /**
   * @deprecated
   */
  public String getEncoding()
  {
    return charset;
  }
  
  public String getDefaultCharset()
  {
    return charset;
  }
  
  public URLCodec() {}
}

/* Location:
 * Qualified Name:     org.apache.commons.codec.net.URLCodec
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
1 2 3

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