|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.slashie.util.FileUtil
public class FileUtil
Eases input and output with files.
Constructor Summary | |
---|---|
FileUtil()
|
Method Summary | |
---|---|
static void |
copyFile(java.io.File source,
java.io.File destination)
Duplicates a file contents into another file |
static void |
deleteFile(java.lang.String fileName)
Deletes the specified file |
static boolean |
fileExists(java.lang.String filename)
Checks if the given file exists |
static java.io.BufferedReader |
getReader(java.lang.String fileName)
Acquires a Buffered reader usable to read the contents of a file |
static java.io.BufferedWriter |
getWriter(java.lang.String fileName)
Acquires a Buffered Writer usable to write a new file |
static void |
main(java.lang.String[] args)
Test Unit, can be changed |
static java.lang.String |
replaceFilename(java.lang.String fullPath,
java.lang.String newFilename)
Replaces the file part of a full path with a new file name and returns the modified full path |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileUtil()
Method Detail |
---|
public static void deleteFile(java.lang.String fileName)
fileName
- The file to be deletedpublic static void copyFile(java.io.File source, java.io.File destination) throws java.io.IOException
source
- The file to take the data fromdestination
- The filename to write the data to
java.io.IOException
public static java.io.BufferedReader getReader(java.lang.String fileName) throws java.io.IOException
fileName
- Name of the file that will be read
java.io.IOException
public static java.io.BufferedWriter getWriter(java.lang.String fileName) throws java.io.IOException
fileName
- The name of the file to be written
java.io.IOException
public static boolean fileExists(java.lang.String filename)
filename
-
public static java.lang.String replaceFilename(java.lang.String fullPath, java.lang.String newFilename)
fullPath
- newFilename
-
public static void main(java.lang.String[] args)
args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |