Package com.atlassian.bamboo.util
Class HtmlUtils
java.lang.Object
com.atlassian.bamboo.util.HtmlUtils
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
addPrefixToLines
(String prefix, String input) static String
appendUrls
(String url1, String url2) static String
colorizeAnsiToHtml
(String line) static String
Deprecated.since 5.14 use com.atlassian.bamboo.utils.EscapeChars#forUrl insteadstatic @NotNull String
getAsPreformattedText
(@Nullable Object o) Escapes the passed object as a string.static String
getFirstNCharactersWithTrailer
(@Nullable String s, int chars) static String
getFirstNLines
(String s, int lines) Returns the first n lines of the passed stringstatic String
getFirstNLinesWithTrailer
(String s, int lines) static HtmlUtils
static String
Changes 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
-