public final class LocalFile extends Object
Modifier | Constructor and Description |
---|---|
private |
LocalFile()
Private constructor to prevent instantiation of public utility class.
|
Modifier and Type | Method and Description |
---|---|
static void |
delete(String filePathParam)
Deletes specified file.
|
static String |
getContent(String fileName)
Returns content of specified file on disk.
|
static String[] |
getContentArray(String fileName)
Returns file lines as strings in an array.
|
static FileReader |
getFileReader(String fileName)
Returns file as file input stream.
|
static void |
putText(String filePathParam,
String fileContentParam)
Writes text string to new file.
|
private LocalFile()
public static void putText(String filePathParam, String fileContentParam)
filePathParam
- full or relative path to filefileContentParam
- text to write to new filepublic static void delete(String filePathParam)
filePathParam
- full or relative path to file to deletepublic static FileReader getFileReader(String fileName)
fileName
- Name of file to connectIllegalArgumentException
- on file not foundpublic static String getContent(String fileName)
fileName
- Name of file to read.IllegalArgumentException
- on file not foundCopyright © 2018. All rights reserved.