Object StringUtilities.Companion

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • buildString

         final String buildString(List<String> strings)

        Converts a list of Strings, for example from a list, into a concatenated String.

        Parameters:
        strings - List of strings that will be concatenated into one string
        Returns:

        Returns concatenated string that contains all provided values.

      • buildString

         final String buildString(String args)

        Converts a sequence of Strings, for example from a list, into a concatenated String.

        Parameters:
        args - Strings that will be concatenated into one string
        Returns:

        Returns concatenated string that contains all provided values.

      • pathSecureText

         final String pathSecureText(String text)

        Remove commonly forbidden characters from the passed string, making the resulting String safe to use for files, paths, directories etc. If the passed text ends with a SPACE(&#32;&#32;) or a DOT(&#32;.&#32;), they are also removed.

        Replaced/removed are:

        • /

        • <

        • >

        • :

        • "

        • \

        • |

        • ?

        • *

        • #

        • %

        • &

        • {

        • }

        • $

        • !

        • '

        • @

        • +

        • ´

        • `

        • =

        • [

        • ]

        Parameters:
        text - The text which you want to be made safe.
        Returns:

        The passed String safe for use for files, paths, directories etc.

      • pathSecureTextAlternative

         final String pathSecureTextAlternative(String text)

        Remove commonly forbidden characters from the passed string, making the resulting String safe to use for files, paths, directories etc. If the passed text ends with a SPACE(&#32;&#32;) or a DOT(&#32;.&#32;), they are also removed.

        Contrary to pathSecureText, this method does NOT remove / or \.

        Replaced/removed are:

        • <

        • >

        • :

        • "

        • |

        • ?

        • *

        • #

        • %

        • &

        • {

        • }

        • $

        • !

        • @

        • +

        • ´

        • `

        • =

        • [

        • ]

        Parameters:
        text - The text which you want to be made safe.
        Returns:

        The passed String safe for use for files, paths, directories etc.

      • checkForIllegalCharacters

         final Boolean checkForIllegalCharacters(String text)

        Check the passed string whether it contains any of the following characters:

        • /

        • <

        • >

        • :

        • "

        • \

        • |

        • ?

        • *

        • #

        • %

        • &

        • {

        • }

        • $

        • !

        • @

        • +

        • ´

        • `

        • =

        Parameters:
        text - The text you want to check.
        Returns:

        true if none of these characters were found.

      • checkForInvalidPathCharacters

         final Boolean checkForInvalidPathCharacters(String text)

        Check the passed string whether it contains characters invalid in a path-declaration:

        • <

        • >

        • :

        • "

        • |

        • ?

        • *

        • #

        • %

        • &

        • {

        • }

        • $

        • !

        • @

        • ´

        • `

        • =

        Parameters:
        text - The text you want to check.
        Returns:

        true if none of these characters were found.

      • percentEncode

         final String percentEncode(String input)

        Replace '$', ':', '/', '?', '#', '', '', '@' with percent-encoded characters, according to RFC3986.