Package com.clivern.decoy.util
Class FileReader
- java.lang.Object
-
- com.clivern.decoy.util.FileReader
-
public class FileReader extends java.lang.ObjectFile 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 directoryjava.lang.StringreadFileAsString(java.lang.String filePath)Read File as String
-
-
-
Method Detail
-
readFileAsString
public java.lang.String readFileAsString(java.lang.String filePath) throws java.lang.ExceptionRead 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.ExceptionGet 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
-
-