Class EncodingUtil

java.lang.Object
org.apache.maven.wagon.shared.http.EncodingUtil

public class EncodingUtil extends Object
Encoding utility.
Since:
2.7
  • Constructor Details

    • EncodingUtil

      public EncodingUtil()
  • Method Details

    • encodeURL

      @Deprecated public static URI encodeURL(String url) throws MalformedURLException, URISyntaxException
      Deprecated.
      to be removed with 4.0.0
      Parses and returns an encoded version of the given URL string.
      Parameters:
      url - Raw/decoded string form of a URL to parse/encode.
      Returns:
      Parsed/encoded URI that represents the string form URL passed in.
      Throws:
      MalformedURLException
      URISyntaxException
    • encodeURLToString

      @Deprecated public static String encodeURLToString(String url)
      Deprecated.
      To be remvoed with 4.0.0
      Parses and returns an encoded version of the given URL string. Wraps the MalformedURLException and URISyntaxException in case the passed URL is invalid.
      Parameters:
      url - Raw/decoded string form of a URL to parse/encode.
      Returns:
      Parsed/encoded URI (as string) that represents the
      Throws:
      IllegalArgumentException - in case the URL string is invalid.
    • encodeURLToString

      public static String encodeURLToString(String baseUrl, String path)
      Parses and returns an encoded version of the given URL string alongside the given path.
      Parameters:
      baseUrl - Base URL to use when constructing the final URL. This has to be a valid URL already.
      path - Additional unencoded path to append at the end of the base path.
      Returns:
      Composed URL (base + path) already encoded, separating the individual path segments by "/".
      Since:
      TODO
    • encodeURLToString

      public static String encodeURLToString(String baseUrl, String... pathSegments)
      Parses and returns an encoded version of the given URL string alongside the given path segments.
      Parameters:
      baseUrl - Base URL to use when constructing the final URL. This has to be a valid URL already.
      pathSegments - Additional unencoded path segments to append at the end of the base path.
      Returns:
      Composed URL (base + path) already encoded, separating the individual path segments by "/".
      Since:
      TODO