|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteios.util.FileUtil
public class FileUtil
This class collects some useful methods for file and stream handling.
| Constructor Summary | |
|---|---|
FileUtil()
|
|
| Method Summary | |
|---|---|
static long |
copy(InputStream in,
OutputStream out)
Copy from the input stream to the output stream until end of file is reached. |
static long |
copy(InputStream in,
OutputStream out,
AbsoluteProgressReporter progress)
Copy from the input stream to the output stream until end of file is reached. |
static Map<Directory,List<Directory>> |
getDirectoryTree(DbControl dc,
Directory directory)
Get the complete tree of subdirectories from a given directory. |
static InputStream |
getInputStream(File file)
Get a buffered InputStream object reading from
the specified file. |
static OutputStream |
getOutputStream(File file)
Get a buffered OutputStream object writing to
the specified file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileUtil()
| Method Detail |
|---|
public static long copy(InputStream in,
OutputStream out)
throws IOException
in - InputStream The InputStream to read from.out - OutputStream The OutputStream to write to.
IOException - This exception is thrown if there is an error
public static long copy(InputStream in,
OutputStream out,
AbsoluteProgressReporter progress)
throws IOException
in - InputStream The InputStream to read from.out - OutputStream The OutputStream to write to.progress - AbsoluteProgressReporter An optional progress reporter.
IOException - This exception is thrown if there is an error
public static InputStream getInputStream(File file)
throws IOException
InputStream object reading from
the specified file.
file - The path to the file to read from
InputStream
IOException - If the stream cannot be opened
public static OutputStream getOutputStream(File file)
throws IOException
OutputStream object writing to
the specified file.
file - The path to the file to write to
OutputStream
IOException - If the stream cannot be opened
public static Map<Directory,List<Directory>> getDirectoryTree(DbControl dc,
Directory directory)
throws InvalidDataException,
BaseException
directory - The directory to start with
Map which maps a directory to a
list of it's subdirectories. Directories without subdirectories
are not included in the map.
InvalidDataException - If the directory is null
BaseException - If there is another error
|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||