Package com.atlassian.bamboo.util
Class HtmlUtils
java.lang.Object
com.atlassian.bamboo.util.HtmlUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddPrefixToLines(String prefix, String input) static StringappendUrls(String url1, String url2) static StringcolorizeAnsiToHtml(String line) static StringDeprecated.since 5.14 use com.atlassian.bamboo.utils.EscapeChars#forUrl insteadstatic @NotNull StringgetAsPreformattedText(@Nullable Object o) Escapes the passed object as a string.static StringgetFirstNCharactersWithTrailer(@Nullable String s, int chars) static StringgetFirstNLines(String s, int lines) Returns the first n lines of the passed stringstatic StringgetFirstNLinesWithTrailer(String s, int lines) static HtmlUtilsstatic StringChanges text to html, this includes escaping any html specific characters, placing href tags around links and replacing new lines with break tags
-
Field Details
-
WBR
- See Also:
-
BSLASH
- See Also:
-
-
Method Details
-
getAsPreformattedText
Escapes the passed object as a string. The method:- Escapes HTML
- replaces all double spaces with chars
- Allows \/ characters to have line breaks after them
- Parameters:
o- - Any object, can be null- Returns:
- escaped string
-
getTextAsHtml
Changes text to html, this includes escaping any html specific characters, placing href tags around links and replacing new lines with break tags- Parameters:
o- Any object, can be null- Returns:
- Formatted String
-
getFirstNLines
Returns the first n lines of the passed string- Parameters:
s- - can be nulllines- must be > 0- Returns:
- first n lines inclusive. So if there are no new line characters, the entire string is returned. Empty string if null was passed
-
getFirstNLinesWithTrailer
-
getFirstNCharactersWithTrailer
-
appendUrls
-
colorizeAnsiToHtml
-
encodeUrl
Deprecated.since 5.14 use com.atlassian.bamboo.utils.EscapeChars#forUrl instead- Parameters:
url-
-
addPrefixToLines
-
getInstanceForFreemarker
-