|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.unidu.is.util.IOUtilities
A class with utility methods for IO.
| Nested Class Summary | |
static interface |
IOUtilities.FileHandler
An interface whose instances can handle a file (for arbitrary usage). |
| Constructor Summary | |
IOUtilities()
|
|
| Method Summary | |
static void |
doForAllFiles(java.io.File dir,
IOUtilities.FileHandler handler)
Calls the file handler for every file (recursively) in this directory |
static java.io.File[] |
findFiles(java.io.File dir)
Returns all files (recursively) in the specified directory. |
static java.lang.String |
load(java.io.File file)
Loads the content of the file and returns it as a string. |
static java.lang.String |
load(java.io.Reader reader)
Loads the content of the reader and returns it as a string. |
static java.lang.String |
load(java.net.URL url)
Loads the content of the URL and returns it as a string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public IOUtilities()
| Method Detail |
public static java.lang.String load(java.io.File file)
throws java.io.FileNotFoundException,
java.io.IOException
file - file to be read
java.io.FileNotFoundException - if the file is not found
java.io.IOException - if an IO error occurs
public static java.lang.String load(java.net.URL url)
throws java.io.IOException
url - URL whoose content is to be read
java.io.IOException - if an IO error occurs
public static java.lang.String load(java.io.Reader reader)
throws java.io.IOException
reader - reader
java.io.IOException - if an IO error occurspublic static java.io.File[] findFiles(java.io.File dir)
doForAllFiles(File, FileHandler).
dir - directory to search
public static void doForAllFiles(java.io.File dir,
IOUtilities.FileHandler handler)
dir - directory to searchhandler - handler to be called for every file
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||