Apache CXF API

org.apache.cxf.jaxrs.utils
Class HttpUtils

java.lang.Object
  extended by 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 String getEncoding(javax.ws.rs.core.MediaType mt, String defaultEncoding)
           
static String getEndpointAddress(Message m)
           
static SimpleDateFormat getHttpDateFormat()
           
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 isPartiallyEncoded(String value)
           
static String pathDecode(String value)
           
static String pathEncode(String value)
           
static String queryEncode(String value)
           
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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)

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()

isDateRelatedHeader

public static boolean isDateRelatedHeader(String headerName)

toAbsoluteUri

public static URI toAbsoluteUri(URI u,
                                Message message)

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 API

Apache CXF