Class HttpUtils


  • public final class HttpUtils
    extends Object
    • Method Detail

      • 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
      • toHttpDate

        public static String toHttpDate​(Date date)
      • getOtherRuntimeDelegate

        public static javax.ws.rs.ext.RuntimeDelegate getOtherRuntimeDelegate()
      • getHeaderDelegate

        public static javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate<Object> getHeaderDelegate​(Object o)
      • getHeaderDelegate

        public static javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate<Object> getHeaderDelegate​(javax.ws.rs.ext.RuntimeDelegate rd,
                                                                                               Object o)
      • getModifiableStringHeaders

        public static <T> javax.ws.rs.core.MultivaluedMap<String,​T> getModifiableStringHeaders​(org.apache.cxf.message.Message m)
      • getModifiableHeaders

        public static javax.ws.rs.core.MultivaluedMap<String,​Object> getModifiableHeaders​(org.apache.cxf.message.Message m)
      • convertHeaderValuesToString

        public static void convertHeaderValuesToString​(Map<String,​List<Object>> headers,
                                                       boolean delegateOnly)
      • 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​(org.apache.cxf.message.Message message)
      • toAbsoluteUri

        public static URI toAbsoluteUri​(String relativePath,
                                        org.apache.cxf.message.Message message)
      • setHttpRequestURI

        public static void setHttpRequestURI​(org.apache.cxf.message.Message message,
                                             String uriTemplate)
      • toAbsoluteUri

        public static URI toAbsoluteUri​(URI u,
                                        org.apache.cxf.message.Message message)
      • resetRequestURI

        public static void resetRequestURI​(org.apache.cxf.message.Message m,
                                           String requestURI)
      • getPathToMatch

        public static String getPathToMatch​(org.apache.cxf.message.Message m,
                                            boolean addSlash)
      • getProtocolHeader

        public static String getProtocolHeader​(org.apache.cxf.message.Message m,
                                               String name,
                                               String defaultValue)
      • getProtocolHeader

        public static String getProtocolHeader​(org.apache.cxf.message.Message m,
                                               String name,
                                               String defaultValue,
                                               boolean setOnMessage)
      • getBaseAddress

        public static String getBaseAddress​(org.apache.cxf.message.Message m)
      • getEndpointUri

        public static String getEndpointUri​(org.apache.cxf.message.Message m)
      • getEndpointAddress

        public static String getEndpointAddress​(org.apache.cxf.message.Message m)
      • updatePath

        public static void updatePath​(org.apache.cxf.message.Message m,
                                      String path)
      • getPathToMatch

        public static String getPathToMatch​(String path,
                                            String address,
                                            boolean addSlash)
      • getOriginalAddress

        public static String getOriginalAddress​(org.apache.cxf.message.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)
      • getMediaTypeCharsetParameter

        public static String getMediaTypeCharsetParameter​(javax.ws.rs.core.MediaType mt)
      • resolve

        public static URI resolve​(javax.ws.rs.core.UriBuilder baseBuilder,
                                  URI uri)
      • relativize

        public static URI relativize​(URI base,
                                     URI uri)
      • toHttpLanguage

        public static String toHttpLanguage​(Locale locale)
      • isPayloadEmpty

        public static boolean isPayloadEmpty​(javax.ws.rs.core.MultivaluedMap<String,​String> headers)
      • createServletResourceValue

        public static <T> T createServletResourceValue​(org.apache.cxf.message.Message m,
                                                       Class<T> clazz)
      • isMethodWithNoRequestContent

        public static boolean isMethodWithNoRequestContent​(String method)
      • isMethodWithNoResponseContent

        public static boolean isMethodWithNoResponseContent​(String method)
      • isHttpScheme

        public static boolean isHttpScheme​(String scheme)