Package org.opengis.cite.sensorml20.util
Class URIUtils
java.lang.Object
org.opengis.cite.sensorml20.util.URIUtils
URIUtils class.
- Author:
- ricky, ricky
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FiledereferenceURI(URI uriRef) Dereferences the given URI and stores the resulting resource representation in a local file.static URIgetAbsoluteUri(String relativeUrl, URI referenceBaseUri) getAbsoluteUri.static booleanisAbsoluteURL(String urlString) Check if a string is absolute URLstatic DocumentParses the content of the given URI as an XML document and returns a new DOM Document object.static URIresolveRelativeURI(String baseURI, String uriRef) Constructs an absolute URI from the given URI reference and a base URI.static FileresolveURIAsFile(URI uriRef) Resolves the given URI and stores the resulting resource representation in a local file.
-
Constructor Details
-
URIUtils
public URIUtils()
-
-
Method Details
-
parseURI
Parses the content of the given URI as an XML document and returns a new DOM Document object. Entity reference nodes will not be expanded. XML inclusions (xi:include elements) will be processed if present.- Parameters:
uriRef- An absolute URI specifying the location of an XML resource.- Returns:
- A DOM Document node representing an XML resource.
- Throws:
SAXException- If the resource cannot be parsed.IOException- If the resource is not accessible.
-
dereferenceURI
Dereferences the given URI and stores the resulting resource representation in a local file. The file will be located in the default temporary file directory.- Parameters:
uriRef- An absolute URI specifying the location of some resource.- Returns:
- A File containing the content of the resource; it may be empty if resolution failed for any reason.
- Throws:
IOException- If an IO error occurred.
-
resolveRelativeURI
Constructs an absolute URI from the given URI reference and a base URI.- Parameters:
baseURI- The base URI; if present, it must be an absolute URI.uriRef- A URI reference that may be relative to the given base URI.- Returns:
- The resulting URI.
- See Also:
-
resolveURIAsFile
Resolves the given URI and stores the resulting resource representation in a local file. The file will be located in the default temporary file directory.- Parameters:
uriRef- An absolute URI specifying the location of some resource.- Returns:
- A File containing the content of the resource; it may be empty if resolution failed for any reason.
- Throws:
IOException- If an IO error occurs.
-
isAbsoluteURL
Check if a string is absolute URL- Parameters:
urlString- aStringobject- Returns:
- a boolean
-
getAbsoluteUri
public static URI getAbsoluteUri(String relativeUrl, URI referenceBaseUri) throws URISyntaxException getAbsoluteUri.
- Parameters:
relativeUrl- aStringobjectreferenceBaseUri- aURIobject- Returns:
- a
URIobject - Throws:
URISyntaxException- if any.
-