|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.gadgets.util.Uri
public class Uri
Utility class for dealing with URIs.
Method Summary | |
---|---|
static URI |
create(String gadgetUri)
Attempts to convert the gadgetUri to a URI object. |
static String |
decodeUriComponent(String uriComponent)
Returns the decoded part of the URI. |
static String |
encodeUriComponent(String uriComponent)
Returns the encoded part of the URI. |
static String |
ensureTrailingSlash(String url)
Returns a "/"-terminated String . |
static boolean |
isValid(String gadgetUri)
Returns true if the gadget URI is a valid URI and begins with http:// or https://,
false otherwise. |
static URI |
relativizeUriAgainstBase(String baseUrl,
String possiblyAbsoluteUri)
Relativize a possibly absolute URI against a specified base. |
static URI |
relativizeUriAgainstBase(String baseUrl,
URI possiblyAbsoluteUri)
Relativize a possibly absolute URI against a specified base. |
static URI |
resolveUriAgainstBase(String baseUrl,
String possiblyRelativeUri)
Resolves a possibly relative URI (in String form) against a specified base. |
static URI |
resolveUriAgainstBase(String baseUrl,
URI possiblyRelativeUri)
Resolves a possibly relative URI against a specified base. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String decodeUriComponent(String uriComponent)
uriComponent
- part of the URI to decode
public static String encodeUriComponent(String uriComponent)
uriComponent
- part of the URI to encode
public static boolean isValid(String gadgetUri)
true
if the gadget URI is a valid URI
and begins with http:// or https://,
false
otherwise.
gadgetUri
- URI to validate
true
if the gadget URI is a valid URI
and begins with http:// or https://, false
otherwise.public static URI create(String gadgetUri) throws GadgetSpecUriNotAllowedException
gadgetUri
to a URI
object. If the URI is an invalid URI or does not
begin with http:// or https://, throws an InvalidGadgetSpecUriException
.
gadgetUri
- value to be converted to a URI
object
gadgetUri
converted to a URI
object
GadgetSpecUriNotAllowedException
- thrown if the value is not a valid URI
or does not start with
http:// or https://public static String ensureTrailingSlash(String url)
String
.
url
- the URL to be "/"-terminated.
public static URI resolveUriAgainstBase(String baseUrl, URI possiblyRelativeUri)
java.net.URI.resolve(java.net.URI)
.
baseUrl
- the base URI to resolve againstpossiblyRelativeUri
- the relative URI to be resolved. If this is already absolute, it will not be resolved against the base
public static URI resolveUriAgainstBase(String baseUrl, String possiblyRelativeUri)
java.net.URI.resolve(java.net.URI)
.
baseUrl
- the base URI to resolve againstpossiblyRelativeUri
- the relative URI to be resolved. If this is already absolute, it will not be resolved against the base
public static URI relativizeUriAgainstBase(String baseUrl, URI possiblyAbsoluteUri)
java.net.URI.relativize(java.net.URI)
.
baseUrl
- the base URI to relativize againstpossiblyAbsoluteUri
- the absolute URI to be relativize. If this is already relative, it will not be relativize against the base
public static URI relativizeUriAgainstBase(String baseUrl, String possiblyAbsoluteUri)
java.net.URI.relativize(java.net.URI)
.
baseUrl
- the base URI to relativize againstpossiblyAbsoluteUri
- the absolute URI to be relativize. If this is already relative, it will not be relativize against the base
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |