|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.camunda.commons.utils.IoUtil
public class IoUtil
| Field Summary | |
|---|---|
static Charset |
ENCODING_CHARSET
|
| Constructor Summary | |
|---|---|
IoUtil()
|
|
| Method Summary | |
|---|---|
static void |
closeSilently(Closeable closeable)
Close a closable ignoring any IO exception. |
static InputStream |
fileAsStream(File file)
Returns the input stream of a file. |
static InputStream |
fileAsStream(String filename)
Returns the input stream of a file with specified filename |
static String |
fileAsString(File file)
Returns the content of a File. |
static String |
fileAsString(String filename)
Returns the content of a file with specified filename |
static File |
getClasspathFile(String filename)
Returns the File for a filename. |
static File |
getClasspathFile(String filename,
ClassLoader classLoader)
Returns the File for a filename. |
static String |
inputStreamAsString(InputStream inputStream)
Returns the input stream as String. |
static String |
readerAsString(Reader reader)
Returns the Reader content as String. |
static InputStream |
stringAsInputStream(String string)
Returns the String as InputStream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Charset ENCODING_CHARSET
| Constructor Detail |
|---|
public IoUtil()
| Method Detail |
|---|
public static String inputStreamAsString(InputStream inputStream)
String.
inputStream - the input streampublic static String readerAsString(Reader reader)
Reader content as String.
reader - the Readerpublic static InputStream stringAsInputStream(String string)
String as InputStream.
string - the String to convert
InputStream containing the Stringpublic static void closeSilently(Closeable closeable)
closeable - the closable to closepublic static String fileAsString(String filename)
filename - name of the file to load
Stringpublic static String fileAsString(File file)
File.
file - the file to load
Stringpublic static InputStream fileAsStream(String filename)
filename - the name of a File to load
IoUtilException - if the file cannot be loadedpublic static InputStream fileAsStream(File file)
file - the File to load
IoUtilException - if the file cannot be loadedpublic static File getClasspathFile(String filename)
File for a filename.
filename - the filename to load
public static File getClasspathFile(String filename,
ClassLoader classLoader)
File for a filename.
filename - the filename to loadclassLoader - the classLoader to load file with, if null falls back to TCCL and then this class's classloader
IoUtilException - if the file cannot be loaded
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||