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 StringStrip out any annoying to deal with characters from a string when used as a file or directory namestatic StringsanitizeDirectory(String name) Also remove any dots in the directory namestatic Stringstatic StringtrimString(String value, int max) static StringwebContextPath(String first, String... more) Creates a web context path from components.
-
Constructor Details
-
Strings
public Strings()
-
-
Method Details
-
trimString
-
isBlank
-
isNotBlank
-
sanitize
Strip out any annoying to deal with characters from a string when used as a file or directory name -
sanitizeDirectory
Also remove any dots in the directory name -
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
-
strip
-