public class IOUtils extends Object
Constructor and Description |
---|
IOUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getFileAsString(String file)
Open a file and returns a string containing the content of the file
It terminates the execution in case of any type of error. |
static String |
getFileAsUTF8String(String file)
Returns a list where each element is a line of the UTF8 file
It terminates the execution in case of any type of error. |
static List<String> |
getLines(String file)
Returns a list where each element is a line of the file
It terminates the execution in case of any type of error. |
static BufferedReader |
getPlainOrCompressedReader(String file)
Opens a file.
|
static BufferedReader |
getPlainOrCompressedUTF8Reader(String file)
Opens an UTF8 file.
|
static BufferedWriter |
getPlainOrCompressedUTF8Writer(String file)
Opens a UTF8 file for writing.
|
static BufferedWriter |
getPlainOrCompressedWriter(String file)
Opens a file for writing.
|
public static BufferedReader getPlainOrCompressedReader(String file)
file
- - the path of the file to open.public static BufferedReader getPlainOrCompressedUTF8Reader(String file)
file
- - the path of the file to open.public static BufferedWriter getPlainOrCompressedWriter(String file)
file
- - the path of the file to open.public static BufferedWriter getPlainOrCompressedUTF8Writer(String file)
file
- - the path of the file to open.public static String getFileAsString(String file)
file
- - the path of the file to open.public static List<String> getLines(String file)
file
- the file to readCopyright © 2013. All rights reserved.