public class ReadWriteTextFile extends Object
| Constructor and Description |
|---|
ReadWriteTextFile() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getContents(File aFile)
Fetch the entire contents of a text file, and return it in a String.
|
static void |
main(String... aArguments)
Simple test harness.
|
static void |
setContents(File aFile,
String aContents)
Change the contents of text file in its entirety, overwriting any
existing text.
|
public static String getContents(File aFile)
aFile - is a file which already exists and can be read.public static void setContents(File aFile, String aContents) throws FileNotFoundException, IOException
aFile - is an existing file which can be written to.IllegalArgumentException - if param does not comply.FileNotFoundException - if the file does not exist.IOException - if problem encountered during write.public static void main(String... aArguments) throws IOException
IOExceptionCopyright © 2015. All rights reserved.