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
  • Field Details

  • Constructor Details

    • StringCommonUtils

      public StringCommonUtils()
  • Method Details

    • 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 input
      charIgnore - 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)
    • decodeSpecialCharToHTMLnumber

      public static String decodeSpecialCharToHTMLnumber(String s)
    • decodeSpecialCharToHTMLnumberIgnore

      public static String decodeSpecialCharToHTMLnumberIgnore(String str)
      Decode special chars to HTML number ignore char Less than '<' and Greater than '>'
      Parameters:
      str -
      Returns: