Object StringUtilities.Companion

  • All Implemented Interfaces:

    
    public class StringUtilities.Companion
    
                        

    String cleanup and the Mongo URI builder the web backend configures itself from.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String buildString(List<String> strings) Converts a list of Strings, for example from a list, into a concatenated String.
      final String buildString(String args) Converts a sequence of Strings, for example from a list, into a concatenated String.
      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.
      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.
      final Boolean checkForIllegalCharacters(String text) Check the passed string whether it contains any of the following characters:
      • /

      • <

      • >

      • :

      • "

      • \

      • |

      • ?

      • *

      • #

      • %

      • &

      • {

      • }

      • $

      • !

      • @

      • +

      • ´

      • `

      • =

      final Boolean checkForInvalidPathCharacters(String text) Check the passed string whether it contains characters invalid in a path-declaration:
      • <

      • >

      • :

      • "

      • |

      • ?

      • *

      • #

      • %

      • &

      • {

      • }

      • $

      • !

      • @

      • ´

      • `

      • =

      final String percentEncode(String input) Replace '$', ':', '/', '?
      final String createMongoUri(String user, String password, String host, Integer port, String database) Assemble the Mongo connection URI the web backend configures itself from.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.