Class ZulipUrlUtils
java.lang.Object
com.github.jamesnetherton.zulip.client.util.ZulipUrlUtils
A utility class to resolve API endpoint.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanDetermines whether a request path contains a segment that a server could resolve to a different path.static URLgetZulipApiUrl(String baseUrl) Returns the URL to a Zulip API endpoint.static StringpathSegment(String value) Verifies that a value destined for a single Zulip API request path segment cannot modify the structure of that path.static StringpathSegments(String value) Verifies that a value destined for one or more Zulip API request path segments cannot traverse outside of the request path that it is interpolated into.
-
Field Details
-
API
- See Also:
-
V1
- See Also:
-
API_BASE_PATH
- See Also:
-
-
Method Details
-
getZulipApiUrl
Returns the URL to a Zulip API endpoint.- Parameters:
baseUrl- The base URL of the Zulip server- Returns:
- The
URLof the Zulip API - Throws:
MalformedURLException- if the URL is invalid
-
pathSegment
-
pathSegments
Verifies that a value destined for one or more Zulip API request path segments cannot traverse outside of the request path that it is interpolated into.- Parameters:
value- The value to be interpolated into the request path- Returns:
- The unmodified value
-
containsRelativePathSegment
Determines whether a request path contains a segment that a server could resolve to a different path.- Parameters:
path- The request path to check- Returns:
trueif the path contains a relative path segment.falseotherwise
-