public class FileUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EXTENSION_SEPARATOR |
| Constructor and Description |
|---|
FileUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyFile(java.io.File source,
java.io.File destination)
Copies the source file to the destination filename.
|
static void |
deleteFiles(java.lang.String directoryName)
Deletes the files in the directory, but does not remove the directory.
|
static boolean |
directoryExists(java.lang.String directoryName)
Returns true if the given directory exists.
|
static java.lang.String |
extension(java.lang.String path) |
static java.util.List |
getContents(java.lang.String textFileName)
Returns a List of the String's in the text file, one per line.
|
static java.lang.String |
name(java.lang.String path) |
static java.lang.String |
readText(java.io.File file)
Gets the contents of a text file as a single String
|
static java.lang.String |
readText(java.lang.String filename) |
static void |
setContents(java.lang.String textFileName,
java.lang.String contents)
Saves the String with the given filename
|
public static final java.lang.String EXTENSION_SEPARATOR
public static java.lang.String name(java.lang.String path)
public static java.lang.String extension(java.lang.String path)
public static void deleteFiles(java.lang.String directoryName)
public static boolean directoryExists(java.lang.String directoryName)
public static java.util.List getContents(java.lang.String textFileName)
throws java.io.FileNotFoundException,
java.io.IOException
java.io.FileNotFoundExceptionjava.io.IOExceptionpublic static java.lang.String readText(java.lang.String filename)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String readText(java.io.File file)
throws java.io.IOException
file - java.io.IOExceptionpublic static void setContents(java.lang.String textFileName,
java.lang.String contents)
throws java.io.IOException
java.io.IOExceptionpublic static void copyFile(java.io.File source,
java.io.File destination)
throws java.io.IOException
java.io.IOException