public class ServiceUtils extends java.lang.Object
Constructor and Description |
---|
ServiceUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
encodePathSegment(java.lang.String pathSegment)
Encodes the given url path segment.
|
static java.lang.String |
encodeQueryParameter(java.lang.String queryParameter)
Encodes the given value as query parameter (includes slashes and + symbols).
|
static java.lang.String |
encodeUniformPath(java.lang.String uniformPath)
Encodes the given uniform path by URL-encoding each segment while preserving
the slashes.
|
static java.util.Optional<java.lang.String> |
getErrorMessageForInvalidIdentifiers(java.lang.String identifierText,
java.lang.String identifierDescription)
Produces a specific error message if the identifier is invalid (e.g.,
contains linebreaks, invisible unicode chars, or is empty).
|
static boolean |
isValidServerAddress(java.lang.String address)
Uses Java API to check if the server address is valid
|
public ServiceUtils()
public static java.lang.String encodePathSegment(java.lang.String pathSegment)
public static java.lang.String encodeQueryParameter(java.lang.String queryParameter)
public static java.lang.String encodeUniformPath(java.lang.String uniformPath)
public static boolean isValidServerAddress(java.lang.String address)
public static java.util.Optional<java.lang.String> getErrorMessageForInvalidIdentifiers(java.lang.String identifierText, java.lang.String identifierDescription)
identifierText
- the text of the identifier (e.g., "x" or "foo")identifierDescription
- a description of what this identifier should be (e.g., "Group
name" or "Id"). This is used at the beginning of the error message
and therefore should start with an uppercase letter.