Package io.hawt.util

Class Strings

java.lang.Object
io.hawt.util.Strings

public class Strings extends Object
String utility.
  • Constructor Details

    • Strings

      public Strings()
  • Method Details

    • isBlank

      public static boolean isBlank(String text)
    • isNotBlank

      public static boolean isNotBlank(String text)
    • split

      public static List<String> split(String text, String delimiter)
    • cleanPath

      public static String cleanPath(String path)
      Normalizes a path. If the path contains a single '/' character it is returned unchanged, otherwise the path is:
      1. stripped from all multiple consecutive occurrences of '/' characters
      2. stripped from trailing '/' character(s)
      Parameters:
      path - path to normalize
      Returns:
      normalized path
    • webContextPath

      public static String webContextPath(String first, String... more)
      Creates a web context path from components. Concatenates all path components using '/' character as delimiter and the result is then:
      1. prefixed with '/' character
      2. stripped from all multiple consecutive occurrences of '/' characters
      3. stripped from trailing '/' character(s)
      Returns:
      empty string or string which starts with a "/" character but does not end with a "/" character
    • resolvePlaceholders

      public static String resolvePlaceholders(String value)
    • resolvePlaceholders

      public static String resolvePlaceholders(String value, Properties properties)
      Simple, recursively-safe property placeholder resolver. Only system properties are used (for now). De-facto standard ${...} syntax is used. Unresolvable properties are not replaced and separators pass to resulting value.
      Parameters:
      value -
      Returns: