public class IOUtils
extends org.apache.commons.io.IOUtils
| Modifier and Type | Field and Description |
|---|---|
protected static int |
bufferSize |
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static long |
copyLarge(InputStream input,
OutputStream output)
Re-implement copy method to allow buffer size to be configured.
|
static long |
copyLarge(Reader input,
Writer output)
Re-implement copy method to allow buffer size to be configured.
|
static InputStream |
getResourceAsStream(String resourceName,
Class callingClass)
Attempts to load a resource from the file system, from a URL, or from the
classpath, in that order.
|
static InputStream |
getResourceAsStream(String resourceName,
Class callingClass,
boolean tryAsFile,
boolean tryAsUrl)
Attempts to load a resource from the file system, from a URL, or from the
classpath, in that order.
|
static String |
getResourceAsString(String resourceName,
Class callingClass)
Attempts to load a resource from the file system, from a URL, or from the
classpath, in that order.
|
static URL |
getResourceAsUrl(String resourceName,
Class callingClass)
Attempts to load a resource from the file system or from the classpath, in
that order.
|
static URL |
getResourceAsUrl(String resourceName,
Class callingClass,
boolean tryAsFile,
boolean tryAsUrl)
Attempts to load a resource from the file system or from the classpath, in
that order.
|
static byte[] |
toByteArray(InputStream input)
This method wraps
IOUtils' toByteArray(InputStream)
method but catches any IOException and wraps it into a RuntimeException. |
static String |
toString(InputStream input)
This method wraps
IOUtils' toString(InputStream)
method but catches any IOException and wraps it into a RuntimeException. |
close, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, contentEquals, contentEquals, contentEqualsIgnoreEOL, copy, copy, copy, copy, copy, copy, copy, copy, copyLarge, copyLarge, copyLarge, copyLarge, copyLarge, copyLarge, lineIterator, lineIterator, lineIterator, read, read, read, read, readFully, readFully, readFully, readFully, readLines, readLines, readLines, readLines, skip, skip, skipFully, skipFully, toBufferedInputStream, toBufferedReader, toByteArray, toByteArray, toByteArray, toByteArray, toByteArray, toByteArray, toByteArray, toByteArray, toByteArray, toCharArray, toCharArray, toCharArray, toCharArray, toInputStream, toInputStream, toInputStream, toInputStream, toInputStream, toInputStream, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, writeLines, writeLines, writeLines, writeLinespublic static String getResourceAsString(String resourceName, Class callingClass) throws IOException
resourceName - The name of the resource to loadcallingClass - The Class object of the calling objectIOException - IO errorpublic static InputStream getResourceAsStream(String resourceName, Class callingClass) throws IOException
resourceName - The name of the resource to loadcallingClass - The Class object of the calling objectIOException - IO errorpublic static InputStream getResourceAsStream(String resourceName, Class callingClass, boolean tryAsFile, boolean tryAsUrl) throws IOException
resourceName - The name of the resource to loadcallingClass - The Class object of the calling objecttryAsFile - - try to load the resource from the local file systemtryAsUrl - - try to load the resource as a URLIOException - IO errorpublic static URL getResourceAsUrl(String resourceName, Class callingClass)
resourceName - The name of the resource to loadcallingClass - The Class object of the calling objectpublic static URL getResourceAsUrl(String resourceName, Class callingClass, boolean tryAsFile, boolean tryAsUrl)
resourceName - The name of the resource to loadcallingClass - The Class object of the calling objecttryAsFile - - try to load the resource from the local file systemtryAsUrl - - try to load the resource as a Url stringpublic static String toString(InputStream input)
IOUtils' toString(InputStream)
method but catches any IOException and wraps it into a RuntimeException.public static byte[] toByteArray(InputStream input)
IOUtils' toByteArray(InputStream)
method but catches any IOException and wraps it into a RuntimeException.public static long copyLarge(InputStream input, OutputStream output) throws IOException
IOExceptionpublic static long copyLarge(Reader input, Writer output) throws IOException
IOExceptionCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.