Package io.hawt.util
Class Strings
java.lang.Object
io.hawt.util.Strings
String utility.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringNormalizes a path.static booleanstatic booleanisNotBlank(String text) static StringresolvePlaceholders(String value) static StringresolvePlaceholders(String value, Properties properties) Simple, recursively-safe property placeholder resolver.static StringwebContextPath(String first, String... more) Creates a web context path from components.
-
Constructor Details
-
Strings
public Strings()
-
-
Method Details
-
isBlank
-
isNotBlank
-
split
-
cleanPath
Normalizes a path. If the path contains a single '/' character it is returned unchanged, otherwise the path is:- stripped from all multiple consecutive occurrences of '/' characters
- stripped from trailing '/' character(s)
- Parameters:
path- path to normalize- Returns:
- normalized path
-
webContextPath
Creates a web context path from components. Concatenates all path components using '/' character as delimiter and the result is then:- prefixed with '/' character
- stripped from all multiple consecutive occurrences of '/' characters
- stripped from trailing '/' character(s)
- Returns:
- empty string or string which starts with a "/" character but does not end with a "/" character
-
resolvePlaceholders
-
resolvePlaceholders
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:
-