|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.util.BambooStringUtils
public class BambooStringUtils
Field Summary | |
---|---|
static char |
CHAR_APOSTROPHE
|
static char |
CHAR_BACKSLASH
|
static char |
CHAR_DOUBLE_QUOTE
|
static char |
CHAR_ELLIPSIS
|
static char |
CHAR_NONE
|
Method Summary | |
---|---|
static boolean |
containsRelaxedXssRelatedCharacters(java.lang.String string)
|
static com.google.common.base.Predicate<java.lang.String> |
containsString(java.lang.String string)
|
static boolean |
containsXssRelatedCharacters(java.lang.String string)
Returns true if the supplied string contains characters that could be used to deface a page or trigger an XSS exploit (characters: "&'<>\). |
static java.lang.String |
dos2unix(java.lang.String s)
Changes Dos-style line endings to Unix style line endings |
static java.lang.String |
encodeHtmlWithTagWhiteList(java.lang.String string)
Escapes string but preserves few defined tags. |
static com.google.common.base.Function<java.lang.String,java.lang.String> |
encodeHtmlWithTagWhiteListFunction()
|
static java.lang.String |
forceAlphaNumeric(java.lang.String str)
|
static java.lang.String |
forceValidHtmlId(java.lang.String id)
According to the HTML standard, ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). |
static java.lang.String |
getFirstRelaxedXssRelatedCharacter(java.lang.String string)
|
static java.lang.String |
getFirstXssRelatedCharacter(java.lang.String string)
Retrieves first unsafe character from supplied string |
static boolean |
in(java.lang.String needle,
java.lang.String... haystacks)
|
static int |
indexOf(java.lang.String haystack,
java.lang.String needle,
int n)
Returns n-th occurence of string (index is 0-based) |
static int |
indexOfRegex(java.lang.String haystack,
java.lang.String needle,
int occurence)
Returns n-th occurence of regex (index is 0-based) |
static java.lang.Iterable<java.lang.String> |
lineIterator(java.lang.String string)
|
static java.lang.String |
remove(java.lang.String quotedVarValue,
int index)
Removes a character at specified index from string |
static boolean |
startsWithAny(java.lang.String string,
java.util.Collection<java.lang.String> searchStrings)
|
static com.google.common.base.Function<java.lang.String,java.lang.String> |
stripFullyEnclosingQuotes()
|
static java.lang.String |
toCamelCase(java.lang.String string,
char separator)
Returns the string in camel case. |
static java.lang.String |
truncateAndAddEllipsis(java.lang.String string,
int maxLength)
Truncates a string to specified length. |
static java.lang.String |
unquote(java.lang.String quotedVarValue,
boolean processBackslashes)
Removes quotes from variable using shell rules. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char CHAR_NONE
public static final char CHAR_APOSTROPHE
public static final char CHAR_BACKSLASH
public static final char CHAR_DOUBLE_QUOTE
public static final char CHAR_ELLIPSIS
Method Detail |
---|
@NotNull public static java.lang.String forceAlphaNumeric(@Nullable java.lang.String str)
public static boolean containsXssRelatedCharacters(@Nullable java.lang.String string)
string
- string to check
@NotNull public static java.lang.String getFirstXssRelatedCharacter(@Nullable java.lang.String string)
string
- the string to check
public static boolean containsRelaxedXssRelatedCharacters(@Nullable java.lang.String string)
@NotNull public static java.lang.String getFirstRelaxedXssRelatedCharacter(@Nullable java.lang.String string)
@NotNull public static java.lang.String forceValidHtmlId(@NotNull java.lang.String id)
public static java.lang.Iterable<java.lang.String> lineIterator(java.lang.String string)
public static com.google.common.base.Predicate<java.lang.String> containsString(@NotNull java.lang.String string)
public static int indexOf(java.lang.String haystack, java.lang.String needle, int n)
haystack
- search hereneedle
- search forn
- n-the cocurence to return
public static int indexOfRegex(java.lang.String haystack, java.lang.String needle, int occurence)
haystack
- search hereneedle
- search foroccurence
- n-the occurence to return
public static boolean startsWithAny(java.lang.String string, java.util.Collection<java.lang.String> searchStrings)
StringUtils#startsWith(String, String[])
public static java.lang.String encodeHtmlWithTagWhiteList(java.lang.String string)
string
-
public static com.google.common.base.Function<java.lang.String,java.lang.String> encodeHtmlWithTagWhiteListFunction()
@NotNull public static java.lang.String unquote(@NotNull java.lang.String quotedVarValue, boolean processBackslashes)
quotedVarValue
- processBackslashes
- whether backslash should be treated as a special character or not
public static boolean in(java.lang.String needle, java.lang.String... haystacks)
@NotNull public static java.lang.String remove(@NotNull java.lang.String quotedVarValue, int index)
quotedVarValue
- index
-
@Nullable public static java.lang.String truncateAndAddEllipsis(@Nullable java.lang.String string, int maxLength)
string
- stringmaxLength
- maximum length of the string
public static com.google.common.base.Function<java.lang.String,java.lang.String> stripFullyEnclosingQuotes()
@NotNull public static java.lang.String dos2unix(@NotNull java.lang.String s)
public static java.lang.String toCamelCase(@NotNull java.lang.String string, char separator)
string
- separator
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |