UrlUtils (Apache CXF JavaDoc 4.2.2 API)
Description: declaration: package: org.apache.cxf.common.util, class: UrlUtils

Package org.apache.cxf.common.util

# Class UrlUtils

java.lang.Object
org.apache.cxf.common.util.UrlUtils

public final class UrlUtils extends Object
Utility class for decoding and encoding URLs

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `getStem(String baseURI)`
  Return everything in the path up to the last slash in a URI.
  `static Map<String,String>`
  `parseQueryString(String s)`
  Create a map from String to String that represents the contents of the query portion of a URL.
  `static String`
  `pathDecode(String value)`
  URL path segments may contain '+' symbols which should not be decoded into ' ' This method replaces '+' with %2B and delegates to URLDecoder
  `static String`
  `urlDecode(String value)`
  `static String`
  `urlDecode(String value, String enc)`
  Decodes using URLDecoder - use when queries or form post values are decoded
  `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`

- ## Method Details

  - ### urlEncode

    public static String urlEncode(String value)

  - ### urlEncode

    public static String urlEncode(String value, String enc)

  - ### urlDecode

    public static String urlDecode(String value, String enc)
    Decodes using URLDecoder - use when queries or form post values are decoded
    Parameters:
      `value` - value to decode
      `enc` - encoding

  - ### urlDecode

    public static String urlDecode(String value)

  - ### pathDecode

    public static String pathDecode(String value)
    URL path segments may contain '+' symbols which should not be decoded into ' ' This method replaces '+' with %2B and delegates to URLDecoder
    Parameters:
      `value` - value to decode

  - ### parseQueryString

    public static Map<String,String> parseQueryString(String s)
    Create a map from String to String that represents the contents of the query portion of a URL. For each x=y, x is the key and y is the value.
    Parameters:
      `s` - the query part of the URI.
    Returns:
      the map.

  - ### getStem

    public static String getStem(String baseURI)
    Return everything in the path up to the last slash in a URI.
    Parameters:
      `baseURI` -
    Returns:
      the trailing