public final class ReportIoUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LINE_SEPARATOR
the default system line separator
|
static String |
SYSTEM_FILE_ENCODING
system file encoding
|
static String |
UTF8_ENCODING
utf-8 encoding
|
Modifier and Type | Method and Description |
---|---|
static File |
createFileFromClassPath(String classPath) |
static InputStream |
createInputStreamFromClassPath(String classPath) |
static FileInputStream |
createInputStreamFromFile(File file) |
static FileOutputStream |
createOutputStreamFromPath(String filePath) |
static FileOutputStream |
createOutputStreamFromPath(String filePath,
boolean append) |
static Reader |
createReaderFromClassPath(String classpath) |
static Reader |
createReaderFromClassPath(String classPath,
String encoding) |
static Reader |
createReaderFromFile(File file) |
static Reader |
createReaderFromFile(File file,
String encoding) |
static Reader |
createReaderFromPath(String filePath) |
static Reader |
createReaderFromPath(String filePath,
String encoding) |
static File |
createTempFile(String prefix)
creates a temporary file with the given previx and the .tmp extension
|
static File |
createTempFile(String prefix,
String extension)
creates a temporary file with the given prefix and extension.
|
static Writer |
createWriterFromFile(File file) |
static Writer |
createWriterFromFile(File file,
String encoding) |
static Writer |
createWriterFromPath(String filePath) |
static Writer |
createWriterFromPath(String filePath,
boolean append) |
static Writer |
createWriterFromPath(String filePath,
boolean append,
String encoding) |
static void |
deleteTempFileIfNotDebug(File tmpFile)
deletes the specified file only if DEBUG is not set to true.
|
public static final String SYSTEM_FILE_ENCODING
public static final String UTF8_ENCODING
public static final String LINE_SEPARATOR
public static Reader createReaderFromPath(String filePath)
filePath
- public static Reader createReaderFromPath(String filePath, String encoding)
filePath
- encoding
- public static Reader createReaderFromFile(File file)
file
- public static Reader createReaderFromFile(File file, String encoding)
file
- encoding
- public static Writer createWriterFromPath(String filePath)
filePath
- the complete file pathpublic static Writer createWriterFromPath(String filePath, boolean append)
filePath
- the complete file pathappend
- true if you want to create the file writer in append modepublic static Writer createWriterFromPath(String filePath, boolean append, String encoding)
filePath
- encoding
- public static Writer createWriterFromFile(File file)
file
- public static Writer createWriterFromFile(File file, String encoding)
file
- encoding
- public static Reader createReaderFromClassPath(String classpath)
classpath
- public static Reader createReaderFromClassPath(String classPath, String encoding)
classPath
- encoding
- public static InputStream createInputStreamFromClassPath(String classPath)
classPath
- public static FileOutputStream createOutputStreamFromPath(String filePath)
filePath
- the full path to the filepublic static FileOutputStream createOutputStreamFromPath(String filePath, boolean append)
filePath
- the full path to the fileappend
- if true the resulting output stream will be created in append modepublic static File createTempFile(String prefix)
prefix
- the prefix of the filepublic static File createTempFile(String prefix, String extension)
prefix
- the prefix of the fileextension
- extensionpublic static void deleteTempFileIfNotDebug(File tmpFile)
tmpFile
- the file to be deletedpublic static FileInputStream createInputStreamFromFile(File file)
file
- Copyright © 2006–2015. All rights reserved.