Package org.exoplatform.commons.utils
Class StringCommonUtils
- java.lang.Object
-
- org.exoplatform.commons.utils.StringCommonUtils
-
public class StringCommonUtils extends Object
Created by The eXo Platform SAS Author : eXoPlatform exo@exoplatform.com Dec 15, 2015
-
-
Constructor Summary
Constructors Constructor Description StringCommonUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static InputStreamcompress(String string)static StringdecodeSpecialCharToHTMLnumber(String s)static StringdecodeSpecialCharToHTMLnumber(String s, List<String> lIgnore)static StringdecodeSpecialCharToHTMLnumberIgnore(String str)Decode special chars to HTML number ignore char Less than '<' and Greater than '>'static Stringdecompress(InputStream is)static StringencodeSpecialCharForSimpleInput(String s)Encode special character, use for input title or name of the object.static StringencodeSpecialCharInHTML(String s)Encode special character, use for input content of object (only apply for input by CKEditer).static StringencodeSpecialCharInSearchTerm(String s)Encode special character, use for input searchstatic StringencodeSpecialCharToHTMLnumber(String s, String charIgnore, boolean isTitle)Encode special character to html number.static booleanisContainSpecialCharacter(String s)
-
-
-
Field Detail
-
EMPTY_STR
public static final String EMPTY_STR
- See Also:
- Constant Field Values
-
SEMICOLON
public static final String SEMICOLON
- See Also:
- Constant Field Values
-
SPACE
public static final String SPACE
- See Also:
- Constant Field Values
-
AMP_NUMBER
public static final String AMP_NUMBER
- See Also:
- Constant Field Values
-
LESS_THAN
public static final String LESS_THAN
- See Also:
- Constant Field Values
-
GREATER_THAN
public static final String GREATER_THAN
- See Also:
- Constant Field Values
-
QUOT
public static final String QUOT
- See Also:
- Constant Field Values
-
AMP_SPACE
public static final String AMP_SPACE
- See Also:
- Constant Field Values
-
AMP_HEX
public static final String AMP_HEX
- See Also:
- Constant Field Values
-
AMP
public static final String AMP
- See Also:
- Constant Field Values
-
-
Method Detail
-
compress
public static InputStream compress(String string) throws IOException
- Throws:
IOException
-
decompress
public static String decompress(InputStream is) throws IOException
- Throws:
IOException
-
encodeSpecialCharInSearchTerm
public static String encodeSpecialCharInSearchTerm(String s)
Encode special character, use for input search- Parameters:
s- the string input- Returns:
- String
-
encodeSpecialCharForSimpleInput
public static String encodeSpecialCharForSimpleInput(String s)
Encode special character, use for input title or name of the object.- Parameters:
s- the string input- Returns:
- String
-
encodeSpecialCharInHTML
public static String encodeSpecialCharInHTML(String s)
Encode special character, use for input content of object (only apply for input by CKEditer).- Parameters:
s- the string input- Returns:
- String
-
isContainSpecialCharacter
public static boolean isContainSpecialCharacter(String s)
-
encodeSpecialCharToHTMLnumber
public static String encodeSpecialCharToHTMLnumber(String s, String charIgnore, boolean isTitle)
Encode special character to html number. Ex: '/' is encoded to /- Parameters:
s- the string inputcharIgnore- the string content ignore some special character can not encode.isTitle- the boolean for check convert is title or not.- Returns:
- String
-
decodeSpecialCharToHTMLnumber
public static String decodeSpecialCharToHTMLnumber(String s, List<String> lIgnore)
-
-