|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.monoserv.http.HttpParameters
public class HttpParameters
| Field Summary | |
|---|---|
static java.lang.String |
CRLF
CRLF |
| Constructor Summary | |
|---|---|
HttpParameters()
The constructor to initialize the internal hashtable. |
|
| Method Summary | |
|---|---|
void |
AddParam(java.lang.String key,
double value)
Convience method for AddParam(String,String). |
void |
AddParam(java.lang.String key,
int value)
Convience method for AddParam(String,String). |
void |
AddParam(java.lang.String key,
java.lang.String value)
Adds a parameters to the hash table. |
boolean |
DoesHeaderExist(java.lang.String key)
Performs a simple search to see if the header supplied exists in the internal hashtable. |
java.lang.String |
GetHeaderValue(java.lang.String idx)
Returns the value for the supplied header. |
java.lang.String |
getHttpHeaders()
Returns a string that is in the proper HTTP format for a response The format is |
java.util.Iterator<java.lang.String> |
GetIterator()
Returns the key set iterator for the internal hashtable. |
int |
GetParamCount()
Returns the size (or number of elements) for the internal hashtable. |
static HttpParameters |
make(java.lang.String httpHeaders)
This will take an unformatted string representation of HTTP headers in the standard format. |
static HttpParameters |
makeBlank()
Returns a blank parameters object |
java.lang.String |
toString()
A convienence function to see what is in the object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String CRLF
| Constructor Detail |
|---|
public HttpParameters()
| Method Detail |
|---|
public void AddParam(java.lang.String key,
int value)
AddParam(key, Integer.toString(value));
key - The name of the headervalue - The value of the headerAddParam(String,String)
public void AddParam(java.lang.String key,
double value)
AddParam(key, Double.toString(value));
key - The name of the headervalue - The value of the headerAddParam(String,String)
public void AddParam(java.lang.String key,
java.lang.String value)
throws java.lang.RuntimeException
key - The actual name of the headervalue - The value for the associated header.
java.lang.RuntimeException - If either supplied string has a length less than
or equal to 0.public java.util.Iterator<java.lang.String> GetIterator()
public java.lang.String GetHeaderValue(java.lang.String idx)
throws HeaderDoesNotExistException
idx - The header to look up
HeaderDoesNotExistException - If the header does not exist.DoesHeaderExist(String)public boolean DoesHeaderExist(java.lang.String key)
return ( params.size() > 0 && params.containsKey(key));
key - The key to search for
public int GetParamCount()
public java.lang.String toString()
{ HeaderName0="Value0"# HeaderName1="Value1"# ... HeaderNameN="ValueN" }
toString in class java.lang.Objectpublic static HttpParameters make(java.lang.String httpHeaders)
httpHeaders - A single string of all the http headers in the message
public java.lang.String getHttpHeaders()
HeaderName0: HeaderValue0\r\n HeaderNaem1: HeaderValue1\r\n ...Although the HTTP protocol requires an extra CRLF to break between the headers and the body, it is not added here.
public static HttpParameters makeBlank()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||