org.apache.cxf.jaxrs.utils
Class HttpUtils
java.lang.Object
org.apache.cxf.jaxrs.utils.HttpUtils
public final class HttpUtils
- extends Object
Method Summary |
static String |
encodePartiallyEncoded(String encoded,
boolean query)
Encodes partially encoded string. |
static String |
fromPathSegment(javax.ws.rs.core.PathSegment ps)
|
static String |
getBaseAddress(Message m)
|
static int |
getContentLength(String value)
|
static String |
getEncoding(javax.ws.rs.core.MediaType mt,
String defaultEncoding)
|
static String |
getEndpointAddress(Message m)
|
static String |
getHeaderString(List<String> values)
|
static Date |
getHttpDate(String value)
|
static SimpleDateFormat |
getHttpDateFormat()
|
static Locale |
getLocale(String value)
|
static String |
getOriginalAddress(Message m)
|
static javax.ws.rs.core.Response.Status |
getParameterFailureStatus(ParameterType pType)
|
static String |
getPathToMatch(Message m,
boolean addSlash)
|
static String |
getPathToMatch(String path,
String address,
boolean addSlash)
|
static String |
getProtocolHeader(Message m,
String name,
String defaultValue)
|
static String |
getSetEncoding(javax.ws.rs.core.MediaType mt,
javax.ws.rs.core.MultivaluedMap<String,Object> headers,
String defaultEncoding)
|
static boolean |
isDateRelatedHeader(String headerName)
|
static boolean |
isHttpRequest(Message message)
|
static boolean |
isPartiallyEncoded(String value)
|
static String |
pathDecode(String value)
|
static String |
pathEncode(String value)
|
static String |
queryEncode(String value)
|
static void |
resetRequestURI(Message m,
String requestURI)
|
static URI |
toAbsoluteUri(String relativePath,
Message message)
|
static URI |
toAbsoluteUri(URI u,
Message message)
|
static void |
updatePath(Message m,
String path)
|
static String |
urlDecode(String value)
|
static String |
urlDecode(String value,
String enc)
|
static String |
urlEncode(String value)
|
static String |
urlEncode(String value,
String enc)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
urlDecode
public static String urlDecode(String value,
String enc)
urlDecode
public static String urlDecode(String value)
pathDecode
public static String pathDecode(String value)
queryEncode
public static String queryEncode(String value)
urlEncode
public static String urlEncode(String value)
urlEncode
public static String urlEncode(String value,
String enc)
pathEncode
public static String pathEncode(String value)
isPartiallyEncoded
public static boolean isPartiallyEncoded(String value)
encodePartiallyEncoded
public static String encodePartiallyEncoded(String encoded,
boolean query)
- Encodes partially encoded string. Encode all values but those matching pattern
"percent char followed by two hexadecimal digits".
- Parameters:
encoded
- fully or partially encoded string.
- Returns:
- fully encoded string
getHttpDateFormat
public static SimpleDateFormat getHttpDateFormat()
getHttpDate
public static Date getHttpDate(String value)
getLocale
public static Locale getLocale(String value)
getContentLength
public static int getContentLength(String value)
getHeaderString
public static String getHeaderString(List<String> values)
isDateRelatedHeader
public static boolean isDateRelatedHeader(String headerName)
isHttpRequest
public static boolean isHttpRequest(Message message)
toAbsoluteUri
public static URI toAbsoluteUri(String relativePath,
Message message)
toAbsoluteUri
public static URI toAbsoluteUri(URI u,
Message message)
resetRequestURI
public static void resetRequestURI(Message m,
String requestURI)
getPathToMatch
public static String getPathToMatch(Message m,
boolean addSlash)
getProtocolHeader
public static String getProtocolHeader(Message m,
String name,
String defaultValue)
getBaseAddress
public static String getBaseAddress(Message m)
getEndpointAddress
public static String getEndpointAddress(Message m)
updatePath
public static void updatePath(Message m,
String path)
getPathToMatch
public static String getPathToMatch(String path,
String address,
boolean addSlash)
getOriginalAddress
public static String getOriginalAddress(Message m)
fromPathSegment
public static String fromPathSegment(javax.ws.rs.core.PathSegment ps)
getParameterFailureStatus
public static javax.ws.rs.core.Response.Status getParameterFailureStatus(ParameterType pType)
getSetEncoding
public static String getSetEncoding(javax.ws.rs.core.MediaType mt,
javax.ws.rs.core.MultivaluedMap<String,Object> headers,
String defaultEncoding)
getEncoding
public static String getEncoding(javax.ws.rs.core.MediaType mt,
String defaultEncoding)
Apache CXF