Package com.jsql.util

Class StringUtil

java.lang.Object
com.jsql.util.StringUtil

public final class StringUtil extends Object
Utility class adding String operations like join() which are not part of standard JVM.
  • Field Details

  • Method Details

    • toHtmlDecimal

      public static String toHtmlDecimal(String text)
      Convert special characters like Chinese and Arabic letters to the corresponding html entities.
      Parameters:
      text - string to encode
      Returns:
      string encoded in html entities
    • hexstr

      public static String hexstr(String hex)
      Convert a hexadecimal String to String.
      Parameters:
      hex - Hexadecimal String to convert
      Returns:
      The string converted from hex
    • isUtf8

      public static boolean isUtf8(String text)
    • detectUtf8

      public static String detectUtf8(String text)
    • base32Encode

      public static String base32Encode(String s)
    • base32Decode

      public static String base32Decode(String s)
    • base58Encode

      public static String base58Encode(String s)
    • base58Decode

      public static String base58Decode(String s)
    • base16Encode

      public static String base16Encode(String s)
    • base16Decode

      public static String base16Decode(String s)
    • base64Decode

      public static String base64Decode(String s)
    • base64Encode

      public static String base64Encode(String s)
    • toHex

      public static String toHex(String text)
    • fromHex

      public static String fromHex(String text)
    • toHexZip

      public static String toHexZip(String text) throws IOException
      Throws:
      IOException
    • fromHexZip

      public static String fromHexZip(String text) throws IOException
      Throws:
      IOException
    • toBase64Zip

      public static String toBase64Zip(String text) throws IOException
      Throws:
      IOException
    • fromBase64Zip

      public static String fromBase64Zip(String text) throws IOException
      Throws:
      IOException
    • toHtml

      public static String toHtml(String text)
    • fromHtml

      public static String fromHtml(String text)
    • toUrl

      public static String toUrl(String text)
    • fromUrl

      public static String fromUrl(String text)
    • cleanSql

      public static String cleanSql(String query)
    • removeSqlComment

      public static String removeSqlComment(String query)
      Remove SQL comments except tamper /**\/ /*!...*\/ Negative lookahead: don't match tamper empty comment /**\/ or version comment /*!...*\/ JavaScript: (?!\/\*!.*\*\/|\/\*\*\/)\/\*.*\*\/
    • formatReport

      public static String formatReport(Color color, String text)
    • xor

      public static byte[] xor(byte[] plaintext, int key)
    • toHexChunks

      public static List<String> toHexChunks(byte[] fileData)
    • uncloak

      public static byte[] uncloak(byte[] fileData)