Class URLPathEncoder
java.lang.Object
nonapi.io.github.classgraph.utils.URLPathEncoder
A simple URL path encoder.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final char[]Hexadecimal digits.private static boolean[]Whether an ASCII character is URL-safe.private static final String[]Valid classpath URL scheme prefixes. -
Constructor Summary
Constructors -
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.static StringnormalizeURLPath(String urlPath) Normalize a URL path, so that it can be fed into the URL or URI constructor.private static voidunescapeChars(String str, boolean isQuery, ByteArrayOutputStream buf) Unescape chars in a URL.
-
Field Details
-
safe
private static boolean[] safeWhether an ASCII character is URL-safe. -
HEXADECIMAL
private static final char[] HEXADECIMALHexadecimal digits. -
SCHEME_PREFIXES
Valid classpath URL scheme prefixes.
-
-
Constructor Details
-
URLPathEncoder
private URLPathEncoder()Constructor.
-
-
Method Details
-
unescapeChars
Unescape chars in a URL. URLDecoder.decode is broken: https://bugs.openjdk.java.net/browse/JDK-8179507 -
decodePath
-
encodePath
-
normalizeURLPath
-