Class HttpUrl.Builder
- java.lang.Object
-
- com.synopsys.defensics.apiserver.client.HttpUrl.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpUrl.Builder
addPathSegment(String segment)
Adds path segment to constructed URL.HttpUrl.Builder
addQueryParameter(String key, String value)
Adds query param to constructed URL.HttpUrl
build()
Builds the HttpUrl with constructed URL.
-
-
-
Constructor Detail
-
Builder
public Builder(URI uri)
Constructor.- Parameters:
uri
- Base URI to be augmented
-
-
Method Detail
-
addQueryParameter
public HttpUrl.Builder addQueryParameter(String key, String value)
Adds query param to constructed URL.- Parameters:
key
- Query param keyvalue
- Query param valu- Returns:
- builder
-
addPathSegment
public HttpUrl.Builder addPathSegment(String segment)
Adds path segment to constructed URL. NOTE: This method doesn't allow slashes or double periods to prevent path traversal. Adjust and/or add a method to add multiple path segments at once if those are needed.- Parameters:
segment
- URL segment to add.- Returns:
- builder
-
build
public HttpUrl build()
Builds the HttpUrl with constructed URL.- Returns:
- new HttpUrl.
-
-