Class FileUtils


  • public class FileUtils
    extends java.lang.Object
    Utility to access files
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void deleteDirectory​(java.nio.file.Path path)
      delete a directory and all its content
      static java.io.File getFile​(java.lang.String fileName)
      Retrieve the File of the given file
      static java.lang.String getFileContent​(java.lang.String fileName)
      Retrieve the content of the given file
      static java.io.FileInputStream getFileInputStream​(java.lang.String fileName)
      Retrieve the FileInputStream of the given file
      static java.util.Optional<java.io.InputStream> getInputStreamFromFileNameAndClassLoader​(java.lang.String fileName, java.lang.ClassLoader classLoader)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getFile

        public static java.io.File getFile​(java.lang.String fileName)
        Retrieve the File of the given file
        Parameters:
        fileName -
        Returns:
      • getFileInputStream

        public static java.io.FileInputStream getFileInputStream​(java.lang.String fileName)
                                                          throws java.io.IOException
        Retrieve the FileInputStream of the given file
        Parameters:
        fileName -
        Returns:
        Throws:
        java.io.IOException
      • getFileContent

        public static java.lang.String getFileContent​(java.lang.String fileName)
                                               throws java.io.IOException
        Retrieve the content of the given file
        Parameters:
        fileName -
        Returns:
        Throws:
        java.io.IOException
      • getInputStreamFromFileNameAndClassLoader

        public static java.util.Optional<java.io.InputStream> getInputStreamFromFileNameAndClassLoader​(java.lang.String fileName,
                                                                                                       java.lang.ClassLoader classLoader)
        Parameters:
        fileName -
        classLoader -
        Returns:
      • deleteDirectory

        public static void deleteDirectory​(java.nio.file.Path path)
        delete a directory and all its content
        Parameters:
        path - path to the directory to delete