public class URIs extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PROTOCOL
Scheme of cms URIs.
|
| Constructor and Description |
|---|
URIs() |
| Modifier and Type | Method and Description |
|---|---|
static String |
collectionID(URI uri)
Returns the collection identifier in a
sm URI. |
static URLConnection |
connection(URI uri,
String scope)
Deprecated.
since 2.3.1. Use
URLConnection normally in current scope. |
static String |
documentID(URI uri)
Returns the document identifier in a content URI.
|
static URI |
documentURI(URI uri)
Returns a content URI for the document of the node identified by another content URI.
|
static URI |
make(String collectionID,
String... identifiers)
Constructs a content URI from a collection identifiers and one or more node identifiers.
|
static String |
nodeID(URI uri)
Returns the identifier of the node identified by a content URI.
|
static String[] |
nodeIDs(URI uri)
Returns the identifiers in a content URI.
|
static URI |
parentURI(URI uri)
Returns a content URI for the parent of the node identified by another content URI.
|
static void |
validate(URI uri)
Indicates whether a URI is a valid content URI.
|
public static final String PROTOCOL
public static void validate(URI uri) throws URISyntaxException
uri - the URI.URISyntaxException - if the URI fails validation.public static URI make(String collectionID, String... identifiers) throws IllegalArgumentException
collectionID - the collection identifier.identifiers - the node identifiers.IllegalArgumentException - if the input is null or empty.public static String collectionID(URI uri) throws URISyntaxException
sm URI.uri - the URI.URISyntaxException - if the URI is not a content URI.public static String documentID(URI uri) throws URISyntaxException
uri - the URI.URISyntaxException - if the URI is not a content URI.public static String nodeID(URI uri) throws URISyntaxException
uri - the URI.URISyntaxException - if the URI is not a content URI.public static String[] nodeIDs(URI uri) throws URISyntaxException
uri - the URI.URISyntaxException - if the URI is not a content URI.public static URI parentURI(URI uri) throws URISyntaxException
uri - the input URI.URISyntaxException - if the input URI is not a content URL.public static URI documentURI(URI uri) throws URISyntaxException
uri - the input URI.URISyntaxException - if the input URI is not a content URI.public static URLConnection connection(URI uri, String scope) throws IOException, URISyntaxException
URLConnection normally in current scope.uri - a content URI.scope - the scope.IOException - if the connections could not be established.URISyntaxException - if the URI is not a content URI or if the protocol handler for the smp scheme is not active.Copyright © 2016. All Rights Reserved.