Class Util


  • public class Util
    extends Object
    Utility methods.
    • Method Detail

      • getExtension

        public static String getExtension​(String filename)
        Get the extension of a filename

        The extension is the string after the last '.' in the filename.

        Parameters:
        filename - the name of the file
        Returns:
        the extension or an empty string, if no dot is found in the filename
      • toString

        public static String toString​(InputStream is,
                                      Charset charset)
                               throws IOException
        Convert the input bytes as a string.
        Parameters:
        is - the input byte stream
        charset - the charset to use
        Returns:
        the converted string
        Throws:
        IOException - if an exception occurs