Class FileReader


  • public class FileReader
    extends java.lang.Object
    File Reader Class
    • Constructor Summary

      Constructors 
      Constructor Description
      FileReader()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.ArrayList<java.lang.String> getFilesInDir​(java.lang.String directory)
      Get Files Abs Path from directory
      java.lang.String readFileAsString​(java.lang.String filePath)
      Read File as String
      • Methods inherited from class java.lang.Object

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

      • FileReader

        public FileReader()
    • Method Detail

      • readFileAsString

        public java.lang.String readFileAsString​(java.lang.String filePath)
                                          throws java.lang.Exception
        Read File as String
        Parameters:
        filePath - absolute path to file
        Returns:
        String file content as string
        Throws:
        java.lang.Exception - throws exception if file not exists
      • getFilesInDir

        public java.util.ArrayList<java.lang.String> getFilesInDir​(java.lang.String directory)
                                                            throws java.lang.Exception
        Get Files Abs Path from directory
        Parameters:
        directory - the dir path
        Returns:
        A list of files abs path
        Throws:
        java.lang.Exception - throws exception if dir not readable