public final class Preconditions2 extends Object
Modifier and Type | Method and Description |
---|---|
static void |
checkPort(int port) |
static void |
checkPort(int port,
String message,
Object... args) |
static void |
checkValidAlias(String alias)
Validates characters present in the provided parameter for
UrlAliasEndpoint . |
public static void checkPort(int port)
public static void checkValidAlias(String alias)
UrlAliasEndpoint
.
The following URL aliases are valid:
/some/url
/some/url/{var1}
/some/{var}/endpoint
...while the following are not:
/some/url/** - wildcard
/some/url?param - request parameter character '?'
/some/@[]<>\:; - special characters
URL aliases
are meant to be simple - complex URLs are aliased for this very reason - so this method
only allows a subset of special characters between slashes (/
) - - . _ ( ) %
.
Note that this does not validate the available path variables based from the service parameters yet because
the Service
object doesn't contain parameter metadata.alias
- Alias to validateIllegalArgumentException
- If the alias is invalidCopyright © 2020. All rights reserved.