Class URLPathEncoder
java.lang.Object
nonapi.io.github.classgraph.utils.URLPathEncoder
A simple URL path encoder.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringdecodePath(String str) Unescape a URL segment, and turn it from UTF-8 bytes into a Java string.static StringencodePath(String path) Encode a URL path using percent-encoding. '/' is not encoded.static StringnormalizeURLPath(String urlPath) Normalize a URL path, so that it can be fed into the URL or URI constructor.
-
Method Details
-
decodePath
Unescape a URL segment, and turn it from UTF-8 bytes into a Java string.- Parameters:
str- the str- Returns:
- the string
-
encodePath
Encode a URL path using percent-encoding. '/' is not encoded.- Parameters:
path- The path to encode.- Returns:
- The encoded path.
-
normalizeURLPath
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
-