|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.portal.generic.HttpUtil
public class HttpUtil
HTTP utilities. Encoding and decoding is for utf strings encoded with the rules defined for the "application/x-www-form-urlencoded" MIME format.
| Constructor Summary | |
|---|---|
HttpUtil()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
decode(java.lang.String source)
Decode a string. |
static void |
decode(java.lang.StringBuffer source,
int beginIndex,
int endIndex,
java.lang.StringBuffer dest)
Extract and decode an encoded portion of a StringBuffer. |
static void |
decode(java.lang.String source,
int beginIndex,
int endIndex,
java.lang.StringBuffer dest)
Extract and decode an encoded portion of a string. |
static void |
decode(java.lang.String source,
java.lang.StringBuffer dest)
Decode a string. |
static java.lang.String |
encode(java.lang.String source)
Encode a string. |
static void |
encode(java.lang.StringBuffer source,
int beginIndex,
int endIndex,
java.lang.StringBuffer dest)
Extract and encode a portion of a StringBuffer. |
static void |
encode(java.lang.StringBuffer source,
int beginIndex,
int endIndex,
java.io.Writer dest)
Extract and encode a portion of a StringBuffer. |
static void |
encode(java.lang.String source,
int beginIndex,
int endIndex,
java.lang.StringBuffer dest)
Extract and encode a portion of a String. |
static void |
encode(java.lang.String source,
int beginIndex,
int endIndex,
java.io.Writer dest)
Extract and encode a portion of a String. |
static void |
encode(java.lang.String source,
java.lang.StringBuffer dest)
Encode a string. |
static void |
encode(java.lang.String source,
java.io.Writer dest)
Encode a string. |
static void |
encodeUri(java.lang.CharSequence source,
int beginIndex,
int endIndex,
java.lang.StringBuffer dest)
|
static void |
encodeUri(java.lang.CharSequence source,
int beginIndex,
int endIndex,
java.io.Writer dest)
|
static java.lang.String |
extractParameters(java.util.Map<java.lang.String,java.lang.String[]> map,
java.lang.String url)
Extract and decode parameters out of the query string portion of the path and add them to the map. |
static java.lang.String |
extractParameters(java.util.Map<java.lang.String,java.lang.String[]> map,
java.lang.String url,
int beginIndex)
Extract and decode parameters out of the query string portion of the path and add them to the map. |
static java.lang.String |
getFirstHeaderElement(java.lang.String headerValue)
Return only the first header element, null if headerValue is null or there are no header elements. |
static java.util.Set<java.lang.String> |
getHeaderElements(java.lang.String headerValue)
Return an ordered Set of header elements from an http header. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpUtil()
| Method Detail |
|---|
public static java.util.Set<java.lang.String> getHeaderElements(java.lang.String headerValue)
text/html; q=1.0, text/*; q=0.8, image/gif; q=0.6, image/jpeg; q=0.8, image/*; q=0.5returns:
public static java.lang.String getFirstHeaderElement(java.lang.String headerValue)
public static java.lang.String extractParameters(java.util.Map<java.lang.String,java.lang.String[]> map,
java.lang.String url)
map - the Map to put the parameters inurl - the url
public static java.lang.String extractParameters(java.util.Map<java.lang.String,java.lang.String[]> map,
java.lang.String url,
int beginIndex)
map - the Map to put the parameters inurl - the urlbeginIndex - the index of the character that follows the '?' characterpublic static java.lang.String encode(java.lang.String source)
source - the String to encode
public static void encode(java.lang.String source,
java.lang.StringBuffer dest)
source - the String to encodedest - a StringBuffer that receives the encoded result
public static void encode(java.lang.String source,
int beginIndex,
int endIndex,
java.lang.StringBuffer dest)
source - the String to encodebeginIndex - the begin index, inclusiveendIndex - the end index, exclusivedest - a StringBuffer that receives the encoded result
public static void encode(java.lang.StringBuffer source,
int beginIndex,
int endIndex,
java.lang.StringBuffer dest)
source - the StringBuffer to encodebeginIndex - the begin index, inclusiveendIndex - the end index, exclusivedest - a StringBuffer that receives the encoded result
public static void encodeUri(java.lang.CharSequence source,
int beginIndex,
int endIndex,
java.lang.StringBuffer dest)
public static void encode(java.lang.String source,
java.io.Writer dest)
throws java.io.IOException
source - the String to encodedest - a Writer that receives the encoded result
java.io.IOException
public static void encode(java.lang.String source,
int beginIndex,
int endIndex,
java.io.Writer dest)
throws java.io.IOException
source - the String to encodebeginIndex - the begin index, inclusiveendIndex - the end index, exclusivedest - a Writer that receives the encoded result
java.io.IOException
public static void encode(java.lang.StringBuffer source,
int beginIndex,
int endIndex,
java.io.Writer dest)
throws java.io.IOException
source - the StringBuffer to encodebeginIndex - the begin index, inclusiveendIndex - the end index, exclusivedest - a Writer that receives the encoded result
java.io.IOException
public static void encodeUri(java.lang.CharSequence source,
int beginIndex,
int endIndex,
java.io.Writer dest)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String decode(java.lang.String source)
source - the String to decode
public static void decode(java.lang.String source,
java.lang.StringBuffer dest)
source - the String to decodedest - a StringBuffer that receives the decoded result
public static void decode(java.lang.String source,
int beginIndex,
int endIndex,
java.lang.StringBuffer dest)
source - the String to extract frombeginIndex - the begin index, inclusiveendIndex - the end index, exclusivedest - a StringBuffer that receives the decoded result
public static void decode(java.lang.StringBuffer source,
int beginIndex,
int endIndex,
java.lang.StringBuffer dest)
source - the StringBuffer to extract frombeginIndex - the begin index, inclusiveendIndex - the end index, exclusivedest - a StringBuffer that receives the decoded result
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||