|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.data.tml.uri.URIs
public class URIs
Utility methods for data URI creation and manipulation.
| Field Summary | |
|---|---|
static String |
PROTOCOL
Scheme of cms URIs. |
| Constructor Summary | |
|---|---|
URIs()
|
|
| Method Summary | |
|---|---|
static URLConnection |
connection(URI uri,
String scope)
Deprecated. since 2.3.1. Use URLConnection normally in current scope. |
static URI |
make(String sourceId,
String... identifiers)
Constructs a data URI from a source identifier and one or more node identifiers. |
static String |
nodeID(URI uri)
Returns the identifier of the node identified by a data URI. |
static String[] |
nodeIDs(URI uri)
Returns the identifiers in a data URI. |
static URI |
parentURI(URI uri)
Returns a data URI for the parent of the node identified by another data URI. |
static org.gcube.data.trees.patterns.Pattern |
pattern(URI uri)
Returns a Pattern for the existence of the path of identifiers in a data URI. |
static String |
rootId(URI uri)
Returns the root identifier in a data URI. |
static String |
sourceId(URI uri)
Returns the source identifier in a data URI. |
static gr.uoa.di.madgik.grs.record.GenericRecord |
toRSElement(URI uri)
Returns the serialisation of a data URI as an element of ResultSet, as expected by the service. |
static URI |
treeURI(URI uri)
Returns a data URI for the tree of the node identified by another data URI. |
static URI |
uri(org.gcube.data.trees.data.Node node)
Returns the data URI of a Node. |
static void |
validate(URI uri)
Indicates whether a URI is a valid data URI. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROTOCOL
| Constructor Detail |
|---|
public URIs()
| Method Detail |
|---|
public static void validate(URI uri)
throws URISyntaxException
uri - the URI.
URISyntaxException - if the URI fails validation.
public static URI make(String sourceId,
String... identifiers)
throws IllegalArgumentException
sourceId - the source identifier.identifiers - the node identifiers.
IllegalArgumentException - if the input is null or empty.
public static String sourceId(URI uri)
throws URISyntaxException
uri - the URI.
URISyntaxException - if the URI is not a data URI.
public static String rootId(URI uri)
throws URISyntaxException
uri - the URI.
URISyntaxException - if the URI is not a data URI.
public static String nodeID(URI uri)
throws URISyntaxException
uri - the URI.
URISyntaxException - if the URI is not a data URI.
public static String[] nodeIDs(URI uri)
throws URISyntaxException
uri - the URI.
URISyntaxException - if the URI is not a data 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 treeURI(URI uri)
throws URISyntaxException
uri - the input URI.
URISyntaxException - if the input URI is not a data URI.
public static final org.gcube.data.trees.patterns.Pattern pattern(URI uri)
throws URISyntaxException
Pattern for the existence of the path of identifiers in a data URI.
uri - the URI.
URISyntaxException - if the URI is not a data URI.
public static final gr.uoa.di.madgik.grs.record.GenericRecord toRSElement(URI uri)
throws URISyntaxException,
Exception
uri - the URI.
URISyntaxException - if the URI is not a data URI.
Exception - if the URI could not be serialised as an element.
public static URLConnection connection(URI uri,
String scope)
throws IOException,
URISyntaxException
URLConnection normally in current scope.
uri - a data URI.scope - the scope.
IOException - if the connections could not be established.
URISyntaxException - if the URI is not a data URI or if the protocol handler for the cms scheme is not active.
public static URI uri(org.gcube.data.trees.data.Node node)
throws IllegalStateException
Node.
tm://id0/id1/.../idN
where
/id2...idN-1 are the identifiers of the nodes on the path that
connects the root of the tree to the node.
node - the node
IllegalStateException - if the node or one of its ancestors does not have an identifier, or
if the root of the tree does not specify a source identifier
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||