|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.utils.FileUtility
public final class FileUtility
Utility class for working with files on the local file store.
Method Summary | |
---|---|
static java.io.File |
createFile(java.lang.String fileName)
Creates a File from a given fileName by looking in the classpath
of the FileUtility class. |
static java.io.File |
createFile(java.lang.String fileName,
java.lang.Class<?> clazz)
Creates a File from a given fileName by looking in the classpath of the given class. |
static java.lang.String |
fileToString(java.io.File file)
Returns the contents of a (text) file as a String object. |
static java.lang.String |
fileToString(java.lang.String fileName)
Returns the contents of a (text) file as a String object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String fileToString(java.io.File file) throws java.io.IOException
file
- the file that needs to be converted
java.io.IOException
- when something went wrong while reading the filepublic static java.lang.String fileToString(java.lang.String fileName) throws java.io.IOException
fileName
- a String representing the file name of the file to be read
java.io.IOException
- when something went wrong while reading the file
java.lang.NullPointerException
- when fileName is nullpublic static java.io.File createFile(java.lang.String fileName)
File
from a given fileName by looking in the classpath
of the FileUtility
class.
fileName
- the file name of the file on the file system
public static java.io.File createFile(java.lang.String fileName, java.lang.Class<?> clazz)
fileName
- the file name of the file on the file systemclazz
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |