|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.monoserv.http.HttpQueryString
public class HttpQueryString
Constructor Summary | |
---|---|
HttpQueryString()
Initializes the internal hashtable. |
Method Summary | |
---|---|
void |
AddHeader(java.lang.String fieldName,
java.lang.String fieldValue)
This will add a header to the internal hashtable. |
static java.lang.String |
decode(java.lang.String s)
|
boolean |
DoesHeaderExist(java.lang.String fieldName)
Returns true if the internal hashtable contains a key equal to the string provided. |
static java.lang.String |
encode(java.lang.String s)
Encode a string to the "x-www-form-urlencoded" form, enhanced with the UTF-8-in-URL proposal. |
java.util.Iterator |
GetFieldIterator()
Returns an Iterator object for the key set so we can traverse through the elements. |
int |
GetFieldSize()
Returns the size (or number of elements) for the internal hashtable |
java.lang.String |
GetFieldValue(java.lang.String fieldName)
This will get the value of the requested field if it exists. |
java.lang.String |
GetQueryString()
Takes all the values in the hash table and combines them into a string that is encoded to ensure that its HTTP safe. |
static HttpQueryString |
makeQueryString(java.lang.String qs)
Creates a HttpQueryString object based on the query string passed in from the HTTP message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpQueryString()
Method Detail |
---|
public int GetFieldSize()
public java.util.Iterator GetFieldIterator()
public void AddHeader(java.lang.String fieldName, java.lang.String fieldValue) throws InvalidQueryStringFieldName
fieldName
- The name of the field in the query stringfieldValue
- The value for the associated name
InvalidQueryStringFieldName
- If the field name is not valid.public java.lang.String GetFieldValue(java.lang.String fieldName) throws InvalidQueryStringFieldName
fieldName
- The name of the field to reference.
InvalidQueryStringFieldName
- If the fieldname fails the sanity check (see description).public java.lang.String GetQueryString()
public boolean DoesHeaderExist(java.lang.String fieldName)
fieldName
- The field name to check for
public static HttpQueryString makeQueryString(java.lang.String qs) throws java.lang.RuntimeException
qs
- A string representation of the query string
java.lang.RuntimeException
- If any of the above requirements for the query string are not met.public static java.lang.String decode(java.lang.String s)
public static java.lang.String encode(java.lang.String s)
The ASCII characters 'a' through 'z', 'A' through 'Z', and '0' through '9' remain the same.
The unreserved characters - _ . ! ~ * ' ( ) remain the same.
The space character ' ' is converted into a plus sign '+'.
All other ASCII characters are converted into the 3-character string "%xy", where xy is the two-digit hexadecimal representation of the character code
All non-ASCII characters are encoded in two steps: first to a sequence of 2 or 3 bytes, using the UTF-8 algorithm; secondly each of these bytes is encoded as "%xx".
s
- The string to be encoded
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |