Class ServiceUtil

    • Constructor Detail

      • ServiceUtil

        public ServiceUtil()
    • Method Detail

      • iterableToString

        public String iterableToString​(Iterable<?> list)
      • saveRandomFile

        public static String saveRandomFile​(byte[] array,
                                            String baseDir,
                                            String extension)
                                     throws IOException
        Save file with random name with provided base directory and extension.
        Parameters:
        array - binary content of file.
        baseDir - Write to directory.
        extension - Filename extension.
        Returns:
        Return full path
        Throws:
        IOException
      • getObjectMapper

        public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      • readFully

        public static byte[] readFully​(InputStream is)
                                throws IOException
        Read all bytes from the supplied input stream. Closes the input stream.
        Parameters:
        is - Input stream
        Returns:
        All bytes
        Throws:
        IOException - If an I/O problem occurs