|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javatools.util.FileUtils
public class FileUtils
This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools). It is licensed under the Creative Commons Attribution License (see http://creativecommons.org/licenses/by/3.0) by the YAGO-NAGA team (see http://mpii.de/yago-naga) Some utility methods for arrays
Constructor Summary | |
---|---|
FileUtils()
|
Method Summary | |
---|---|
static java.util.Collection<java.io.File> |
getAllFiles(java.io.File directory)
Collects all non-directory files in the given input directory (recursively). |
static java.io.BufferedReader |
getBufferedUTF8Reader(java.io.File file)
Creates a BufferedReader for UTF-8-encoded files |
static java.io.BufferedReader |
getBufferedUTF8Reader(java.io.InputStream inputStream)
Creates a BufferedReader the UTF-8-encoded InputStream |
static java.io.BufferedReader |
getBufferedUTF8Reader(java.lang.String fileName)
Creates a BufferedReader for UTF-8-encoded files |
static java.io.BufferedWriter |
getBufferedUTF8Writer(java.io.File file)
Creates a BufferedWriter for UTF-8-encoded files |
static java.io.BufferedWriter |
getBufferedUTF8Writer(java.lang.String fileName)
Creates a BufferedWriter for UTF-8-encoded files |
static java.lang.String |
getFileContent(java.io.File file)
Returns the content of the (UTF-8 encoded) file as string. |
static void |
main(java.lang.String[] args)
|
static boolean |
verifyOrderedFile(java.io.File check,
boolean descending)
Verifies that a file is lexicographically order (ascending or descending) |
static void |
writeFileContent(java.io.File file,
java.lang.String content)
Writes the content of the string to the (UTF-8 encoded) file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileUtils()
Method Detail |
---|
public static java.io.BufferedReader getBufferedUTF8Reader(java.io.File file) throws java.io.FileNotFoundException
file
- File in UTF-8 encoding
java.io.FileNotFoundException
public static java.io.BufferedReader getBufferedUTF8Reader(java.lang.String fileName) throws java.io.FileNotFoundException
fileName
- Path to file in UTF-8 encoding
java.io.FileNotFoundException
public static java.io.BufferedReader getBufferedUTF8Reader(java.io.InputStream inputStream)
inputStream
- InputStream in UTF-8 encoding
public static java.io.BufferedWriter getBufferedUTF8Writer(java.io.File file) throws java.io.FileNotFoundException
file
- File in UTF-8 encoding
java.io.FileNotFoundException
public static java.io.BufferedWriter getBufferedUTF8Writer(java.lang.String fileName) throws java.io.FileNotFoundException
fileName
- Path to file in UTF-8 encoding
java.io.FileNotFoundException
public static java.lang.String getFileContent(java.io.File file) throws java.io.IOException
file
- File to get String content from
java.io.IOException
public static void writeFileContent(java.io.File file, java.lang.String content) throws java.io.IOException
file
- File to write String content to.
java.io.IOException
public static boolean verifyOrderedFile(java.io.File check, boolean descending) throws java.io.IOException
check
- File to checkdescending
- true if ordering should be descending, false if it should be ascending
java.io.IOException
public static java.util.Collection<java.io.File> getAllFiles(java.io.File directory)
directory
- Input directory.
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |