|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.io.FileManager
public class FileManager
This class is for handling files. The most important methods of this class
are for writing a StringBuffer to or reading it from a file. This is useful
for all object that implement Storable
and should be saved in
or loaded from a file.
Storable
Method Summary | |
---|---|
static void |
copy(String from,
String to)
This method copies a file in a faster manner. |
static void |
copy(String from,
String to,
byte[] buffer)
This method copies a file in a faster manner using a specified buffer. |
static int |
copyDiff(File source,
File target,
Date date,
boolean recursive,
FileFilter filter)
This method copies all files and directories, if selected, from a source to a target that have been modified
after a predefined date |
static StringBuffer |
readFile(File file)
This method reads a StringBuffer from a given file. |
static void |
writeFile(File outputFile,
StringBuffer buffer)
This method saves a StringBuffer to a given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int copyDiff(File source, File target, Date date, boolean recursive, FileFilter filter) throws IllegalArgumentException, IOException
source
to a target
that have been modified
after a predefined date
source
- the source directorytarget
- the target directorydate
- the daterecursive
- a switch if this method should be used recursively in the
subdirectoriesfilter
- a filter for the files, taht enables the user to copy only
specific files
IllegalArgumentException
IOException
public static void copy(String from, String to) throws IOException
from
- the file name of the original fileto
- the file name of the copied file
IOException
- if something went wrongpublic static void copy(String from, String to, byte[] buffer) throws IOException
from
- the file name of the original fileto
- the file name of the copied filebuffer
- an array for reading the content of the original file, the size of the array determines how many byte
are read at ones.
IOException
- if something went wrongpublic static StringBuffer readFile(File file) throws IOException
file
- the file to be read
IOException
- if something went wrong with the filepublic static void writeFile(File outputFile, StringBuffer buffer) throws IOException
outputFile
- the file into which the output should be writtenbuffer
- the buffer to be written in a file
IOException
- if something went wrong with the file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |