com.dynamide.util
Class URLDecoder

java.lang.Object
  extended by com.dynamide.util.URLDecoder

public class URLDecoder
extends java.lang.Object

This class really only decodes the query portion of a URL. It does not parse the protocol, host, port, path, or target.


Constructor Summary
URLDecoder(java.lang.String url)
          You can pass in a full URL String or everything after and including the question mark, e.g. "?
 
Method Summary
static java.lang.String decodeURLString(java.lang.String s)
          Translates String from x-www-form-urlEncoded format into text.
 java.lang.String getContent()
           
 java.util.Enumeration getFieldNames()
           
 java.util.Enumeration getFields()
          Use this method to get the name-value pairs in a CGI string.
 java.lang.String getFieldValue(java.lang.String name)
          Use this method to get the named values in a CGI string.
 java.lang.String getPath()
           
 java.lang.String getRawValue()
           
 boolean hasField(java.lang.String name)
           
protected  void setContent(java.lang.String new_cache)
           
 void setPath(java.lang.String new_value)
           
 void setRawValue(java.lang.String new_value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URLDecoder

public URLDecoder(java.lang.String url)
You can pass in a full URL String or everything after and including the question mark, e.g. "?foo=1&bar=2" and "http://dynamide.com:8080/mojo/nixon?foo=1&bar=2" are equivalent.

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getFields

public java.util.Enumeration getFields()
Use this method to get the name-value pairs in a CGI string. That string should have been passed to the constructor of this class. The names are the even-indexed elements (starting at zero) in the enumeration, and the values are the odd-indexed elements (starting at one).


getFieldNames

public java.util.Enumeration getFieldNames()

getFieldValue

public java.lang.String getFieldValue(java.lang.String name)
Use this method to get the named values in a CGI string. That string should have been passed to the constructor of this class.


hasField

public boolean hasField(java.lang.String name)

getContent

public java.lang.String getContent()

getPath

public java.lang.String getPath()

setPath

public void setPath(java.lang.String new_value)

getRawValue

public java.lang.String getRawValue()

setRawValue

public void setRawValue(java.lang.String new_value)

setContent

protected void setContent(java.lang.String new_cache)

decodeURLString

public static java.lang.String decodeURLString(java.lang.String s)
Translates String from x-www-form-urlEncoded format into text. The procedure was copied from O'Reilly Java Network Programming.

Parameters:
s - String to be translated
Returns:
the translated String.


Copyright © 2001-2013 DYNAMIDE.COM. All Rights Reserved.