Class SaStringHelper

java.lang.Object
com.saperion.util.SaStringHelper

public final class SaStringHelper extends Object
Utility class for helper methods.
Author:
mak
  • Field Details

  • Method Details

    • isEmpty

      public static boolean isEmpty(String str)
      Test if the string is empty or not.
      Parameters:
      str - Incomming string
      Returns:
      True, if the string is empty
    • readerToString

      public static String readerToString(Reader is) throws IOException
      Reads the entire content of a Reader into a String.
      Parameters:
      is - input Reader
      Returns:
      String
      Throws:
      IOException - IOException
    • inputStreamToString

      public static String inputStreamToString(InputStream is) throws IOException
      Reads the content of a Stream into a String.
      Parameters:
      is - the input stream
      Returns:
      String
      Throws:
      IOException - IOException
    • toLowerCaseUnicode

      public static String toLowerCaseUnicode(String str)
      Parameters:
      str - original string
      Returns:
      the String, converted to lowercase.
    • toUpperCaseUnicode

      public static String toUpperCaseUnicode(String str)
      Parameters:
      str - original string
      Returns:
      the String, converted to uppercase.
    • collectionToString

      public static String collectionToString(String separator, Collection<String> collection)
      Creates a string containing all strings in the collection separated by the specified separator. It does not add whitespaces, so don't forget to add a whitespace to your separator if required.
      Parameters:
      separator - the separator
      collection - the collection
      Returns:
      the string
    • prepareDatabaseName

      public static String prepareDatabaseName(String dbName)
      Removes all '[', ']' and '"' from the passed string.
      Parameters:
      dbName - original database name
      Returns:
      cleaned database name