|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.renderer.util.UrlUtil
public class UrlUtil
Field Summary | |
---|---|
static List |
URL_PROTOCOLS
|
protected static int |
URL_SCHEMA_LENGTH
Maximum length of a URL schema, e.g. |
Constructor Summary | |
---|---|
UrlUtil()
|
Method Summary | |
---|---|
static String |
buildNewRelativeUrl(javax.servlet.http.HttpServletRequest request,
String name,
String value)
Deprecated. since 3.12 this is not used. Builds a URL with a new parameter, replacing any existing parameters with that name but maintaining all other parameters. For example /foo.html?name=fred&key=FLINT |
static boolean |
containsUrl(String str)
|
static String |
correctBaseUrls(String html,
String baseUrl)
Fixes the URLs used in content imported from external sources to have a base URL that points to that external source. |
static String |
escapeSpecialCharacters(String url)
Deprecated. since 3.12 use HtmlEscaper.escapeAmpersands(String,boolean) passing 'true' to
preserveExistingEntities. |
static String |
escapeUrlFirstCharacter(String linkBody)
|
static Map |
getQueryParameters(String url)
Returns a map of query parameters extracted the given url. |
static int |
getUrlIndex(String str)
|
static boolean |
startsWithUrl(String str)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final List URL_PROTOCOLS
protected static final int URL_SCHEMA_LENGTH
Constructor Detail |
---|
public UrlUtil()
Method Detail |
---|
public static String escapeSpecialCharacters(String url)
HtmlEscaper.escapeAmpersands(String,boolean)
passing 'true' to
preserveExistingEntities.
public static boolean startsWithUrl(String str)
public static boolean containsUrl(String str)
public static int getUrlIndex(String str)
public static String escapeUrlFirstCharacter(String linkBody)
public static String correctBaseUrls(String html, String baseUrl)
Links are fixed in href and src attributes in the HTML. Different types of links are treated differently (assuming a baseUrl of "http://www.example.com/path/to/file.html"):
html
- the HTML text which will have its links corrected to match the base URL of the remote server.baseUrl
- the URL which local links will be made relative to. Typically this is the base URL of the remote
content.
public static String buildNewRelativeUrl(javax.servlet.http.HttpServletRequest request, String name, String value)
For example /foo.html?name=fred&key=FLINT
request
- The current requestname
- The name of the parameter to add/replacevalue
- The value of the parameter to add/replacepublic static Map getQueryParameters(String url)
url
- to extract query parameters from
Map
of query parameters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |