public final class SCMUri extends Object
Modifier and Type | Method and Description |
---|---|
static Map<String,Integer> |
commonDefaultPorts()
Returns the common default ports.
|
static String |
normalize(String uri)
Normalize an URI.
|
static String |
normalize(String uri,
Map<String,Integer>... defaultPorts)
Normalize an URI.
|
public static Map<String,Integer> commonDefaultPorts()
@CheckForNull public static String normalize(@CheckForNull String uri)
ssh
,
http
and https
The hostname will be converted from IDNA to ASCII if necessary and forced to
lowercase and the PCT-encoding of the user authority will be enforced (note that this may affect the case where
a username in a user authority contains a :
as the URI
class does not provide a means to
destructure and restructure a URI without encoding/decoding the username, consequently the %3A
will
be converted to :
and not converted back)/foo/../bar
will
be normalized to /bar
/
will be removeduri
- the URI.@CheckForNull public static String normalize(@CheckForNull String uri, Map<String,Integer>... defaultPorts)
ssh
,
http
and https
The hostname will be converted from IDNA to ASCII if necessary and forced to
lowercase and the PCT-encoding of the user authority will be enforced (note that this may affect the case where
a username in a user authority contains a :
as the URI
class does not provide a means to
destructure and restructure a URI without encoding/decoding the username, consequently the %3A
will
be converted to :
and not converted back)/foo/../bar
will
be normalized to /bar
/
will be removeduri
- the URIdefaultPorts
- the URI scheme to default port mapping (a varargs list to make combination easier). Normally
the caller would use commonDefaultPorts()
as one of the arguments.Copyright © 2016–2022. All rights reserved.