java.lang.Object
com.aoapps.net.URIParser
URI parsing utilities.
- Author:
- AO Industries, Inc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intgetPathEnd(String uri) Find the first of '?'static intgetPathEnd(String uri, int fromIndex) Find the first of '?'static final StringGets the scheme for a URI, ornullwhen no scheme found.static intGets the length of a scheme.static booleanChecks if a URI has a scheme, not including any empty scheme (starts with ':').static booleanChecks if a URI starts with the given scheme.
-
Method Details
-
getSchemeLength
Gets the length of a scheme.- Returns:
- The index of the ':' or
-1on empty scheme, invalid character in scheme, or no colon found.
-
isScheme
Checks if a URI starts with the given scheme.- Parameters:
scheme- The scheme to look for, not including colon. For example"http".- Throws:
IllegalArgumentException- whenschemeis determined to be invalid. Please note that this determination is not guaranteed as shortcuts may skip individual character comparisons.
-
hasScheme
Checks if a URI has a scheme, not including any empty scheme (starts with ':'). -
getScheme
Gets the scheme for a URI, ornullwhen no scheme found. The scheme must start the URI, and matchALPHA *( ALPHA / DIGIT / "+" / "-" / "." )before the first colon (:) found. The scheme is normalized to lower-case. An empty scheme will never be returned (if the URI starts with ':').- Returns:
- The scheme, not including colon, or
nullwhen not found. For example"http".
-
getPathEnd
Find the first of '?' or '#' from the given starting index.- Returns:
- The index of the first '?' or '#' or
uri.length()when not found.
-
getPathEnd
Find the first of '?' or '#'.- Returns:
- The index of the first '?' or '#' or
uri.length()when not found.
-
