@Component
public final class StringUtilities
extends java.lang.Object
| Constructor and Description |
|---|
StringUtilities() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
buildString(java.util.List<java.lang.String> strings)
Converts a list of Strings, for example from a list, into a concatenated String.
|
java.lang.String |
buildString(java.lang.String... args)
Converts a sequence of Strings, for example from a list, into a concatenated String.
|
boolean |
checkForIllegalCharacters(java.lang.String text)
Check the passed string whether it contains any of the following characters:
/
<
>
:
"
\
|
?
*
#
%
&
{
}
$
!
@
+
´
`
=
|
java.lang.String |
pathSecureText(java.lang.String text)
Remove commonly forbidden characters from the passed string, making the resulting String safe
to use for files, paths, directories etc.
|
java.lang.String |
pathSecureTextAlternative(java.lang.String text)
Remove commonly forbidden characters from the passed string, making the resulting String safe
to use for files, paths, directories etc.
|
public java.lang.String buildString(java.util.List<java.lang.String> strings)
strings - List of strings that will be concatenated into one stringpublic java.lang.String buildString(java.lang.String... args)
args - Strings that will be concatenated into one stringpublic java.lang.String pathSecureText(java.lang.String text)
(  ) or a DOT( . ), they are also removed.text - The text which you want to be made safe.public java.lang.String pathSecureTextAlternative(java.lang.String text)
(  ) or a DOT( . ), they are also removed.pathSecureText(String), this method does NOT remove
/ or \.
Replaced/removed are:
text - The text which you want to be made safe.public boolean checkForIllegalCharacters(java.lang.String text)
text - The text you want to check.true if none of these characters were found.