public class

URIUtil

extends Object
java.lang.Object
   ↳ com.atlassian.applinks.core.util.URIUtil

Summary

Public Constructors
URIUtil()
Public Methods
static URI concatenate(URI base, URI... paths)
static String concatenate(String base, String... paths)
static URI concatenate(URI base, String... paths)
static URI copyOf(URI uri)
static String removeRedundantSlashes(String path)

Reduces sequences of more than one consecutive forward slash ("/") to a single slash (see: https://studio.atlassian.com/browse/PLUG-597).

static URI uncheckedConcatenate(URI base, String... paths)
ONLY to be used if the caller is certain that the base and path will form a valid URI when concatenated.
static URI uncheckedConcatenateAndToUri(String base, String... paths)
ONLY to be used if the caller is certain that the base and path will form a valid URI when concatenated.
static URI uncheckedCreate(String uri)
ONLY to be used if the caller is certain that the supplied String is a valid URI.
static URI uncheckedToUri(String uri)
static String utf8Decode(String string)
static String utf8Encode(String string)
Equivalent to URLEncoder.encode(string, "UTF-8");
static String utf8Encode(URI uri)
Equivalent to URLEncoder.encode(uri.toASCIIString(), "UTF-8")
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public URIUtil ()

Public Methods

public static URI concatenate (URI base, URI... paths)

public static String concatenate (String base, String... paths)

public static URI concatenate (URI base, String... paths)

public static URI copyOf (URI uri)

public static String removeRedundantSlashes (String path)

Reduces sequences of more than one consecutive forward slash ("/") to a single slash (see: https://studio.atlassian.com/browse/PLUG-597).

Parameters
path any string, including null (e.g. "foo//bar")
Returns
  • the input string, with all sequences of more than one consecutive slash removed (e.g. "foo/bar")

public static URI uncheckedConcatenate (URI base, String... paths)

ONLY to be used if the caller is certain that the base and path will form a valid URI when concatenated.

public static URI uncheckedConcatenateAndToUri (String base, String... paths)

ONLY to be used if the caller is certain that the base and path will form a valid URI when concatenated.

public static URI uncheckedCreate (String uri)

ONLY to be used if the caller is certain that the supplied String is a valid URI.

public static URI uncheckedToUri (String uri)

public static String utf8Decode (String string)

public static String utf8Encode (String string)

Equivalent to URLEncoder.encode(string, "UTF-8");

public static String utf8Encode (URI uri)

Equivalent to URLEncoder.encode(uri.toASCIIString(), "UTF-8")