Class URLPathEncoder

java.lang.Object
nonapi.io.github.classgraph.utils.URLPathEncoder

public final class URLPathEncoder extends Object
A simple URL path encoder.
  • Method Details

    • decodePath

      public static String decodePath(String str)
      Unescape a URL segment, and turn it from UTF-8 bytes into a Java string.
      Parameters:
      str - the str
      Returns:
      the string
    • encodePath

      public static String encodePath(String path)
      Encode a URL path using percent-encoding. '/' is not encoded.
      Parameters:
      path - The path to encode.
      Returns:
      The encoded path.
    • normalizeURLPath

      public static String normalizeURLPath(String urlPath)
      Normalize a URL path, so that it can be fed into the URL or URI constructor.
      Parameters:
      urlPath - the URL path
      Returns:
      the URL string