Package de.aristaflow.adept2.util
Class UriTools
java.lang.Object
de.aristaflow.adept2.util.UriTools
Some useful methods for
URIs.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetStringContent(URI uri) Loads the content of the designated URI, interprets it as UTF-8 string and returns the complete string (including line breaks).static StringgetStringFromURIs(URI[] uris, Logger logger) Convert an array of URIs to a string with special separator characters (%|).static URI[]getURIsFromString(String string, Logger logger) Convert a string with special separator characters (%|) to an array of URIs.
-
Field Details
-
SEPARATOR
The separator for the URIs in an URI[], which will be stored as string.- See Also:
-
-
Method Details
-
getStringFromURIs
Convert an array of URIs to a string with special separator characters (%|).- Parameters:
uris- The array of URIs that should be converted.logger- The logger for log messages.- Returns:
- A string representing the URI array or
nullin case ofnullor an empty array.
-
getURIsFromString
Convert a string with special separator characters (%|) to an array of URIs.- Parameters:
string- The string that should be converted.logger- The logger for log messages.- Returns:
- An array of URIs.
- Throws:
URISyntaxException- If problems occur during the (re-)creation of the URIs.
-
getStringContent
Loads the content of the designated URI, interprets it as UTF-8 string and returns the complete string (including line breaks).- Parameters:
uri- The URI from which to load string content (UTF-8-encoded).- Returns:
- The string content retrieved from the designated URI.
- Throws:
IOException- If there are problems connecting to the URI (viaURL) or retrieving the content, anIOExceptionwill be thrown.
-