Java Utililty Methods URI to

List of utility methods to do URI to

Description

The list of methods to do URI to are organized into topic(s).

Method

StringtoString(URI pathUri)
Create a stripped down string value for error messages.
return pathUri != null
        ? String.format("%s://%s/%s", pathUri.getScheme(), pathUri.getHost(), pathUri.getPath())
        : "(null URI)";
StringtoString(URI uri)
Creates a String from a URI, the URI can be relative or absolute, the URI is decoded.
StringBuffer buffer = new StringBuffer();
if (uri.getScheme() != null) {
    buffer.append(uri.getScheme());
    buffer.append(":");
buffer.append(uri.getSchemeSpecificPart());
if (uri.getFragment() != null) {
    buffer.append("#");
...
ListtoStringList(List list)
Convert a List of URIs to a List of Strings
List<String> simpleCollection = new ArrayList<String>();
for (URI uri : list) {
    simpleCollection.add(uri.toString());
return simpleCollection;
SettoStringSet(Collection uris)
to String Set
Set<String> result = new HashSet<String>();
for (URI uri : uris) {
    result.add(uri.toASCIIString());
return result;
StringtoUnencodedString(URI uri)
Returns a string representation of the given URI that doesn't have illegal characters encoded.
StringBuffer result = new StringBuffer();
String scheme = uri.getScheme();
if (scheme != null) {
    result.append(scheme).append(':');
result.append(uri.getSchemeSpecificPart());
String fragment = uri.getFragment();
if (fragment != null) {
...
StringURItoString(URI uri)
UR Ito String
return uri == null ? null : uri.toString();
StringuriToString(URI[] uris)
uri To String
if (uris == null) {
    return null;
StringBuffer ret = new StringBuffer(uris[0].toString());
for (int i = 1; i < uris.length; i++) {
    ret.append(",");
    ret.append(uris[i].toString());
return ret.toString();
StringuriToString(URI[] uris)
uri To String
if (uris == null) {
    return null;
StringBuilder ret = new StringBuilder(uris[0].toString());
for (int i = 1; i < uris.length; i++) {
    ret.append(",");
    ret.append(uris[i].toString());
return ret.toString();