Class StreamUtils


  • public final class StreamUtils
    extends Object
    Utility methods for handling Streams. As this class depends on apache-common-io it is distributed only on the server side.
    Since:
    jadice server 4.3.1.1
    • Field Detail

      • ILLEGAL_FILENAME_CHARACTERS

        public static final char[] ILLEGAL_FILENAME_CHARACTERS
        Characters that are not legal as filename (control characters are filtered separately)
        See Also:
        #see
    • Method Detail

      • createSanitizedFilename

        public static String createSanitizedFilename​(StreamDescriptor descriptor,
                                                     String fallbackFilename)
        Utility method for retrieving a sanitized filename out of the data provided in the stream descriptor. Definition: A sanitized name contains only a base name and an extension, but no information about paths or such.

        The priority for the base name is:

        1. base name from StreamDescriptor.getFileName()
        2. base name from the fallbackFilename
        The priority for the filename extension is:
        1. extension that was determined in the StreamAnalysisNode
        2. extension from StreamDescriptor.getFileName()
        3. extension from the fallbackFilename
        Parameters:
        descriptor - Contains the filename information
        fallbackFilename - is used when no other information was provided
        Returns:
        a sanitized filename
        Since:
        4.3.1.1