public class IOUtils
extends org.apache.commons.io.IOUtils
IOUtils contains useful methods for dealing with I/O operations This is based on the mule core class so we can
have control over it| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
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 DataHandler |
toDataHandler(String name,
Object object,
org.mule.runtime.api.metadata.MediaType contentType)
Transforms an Object into a DataHandler of its corresponding type.
|
static Properties |
toProperties(File propertiesFile) |
static Properties |
toProperties(URL url) |
buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, close, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, closeQuietly, contentEquals, contentEquals, contentEqualsIgnoreEOL, copy, copy, copy, copy, copy, copy, copy, copy, copy, copyLarge, copyLarge, copyLarge, copyLarge, copyLarge, copyLarge, copyLarge, copyLarge, lineIterator, lineIterator, lineIterator, read, read, read, read, read, readFully, readFully, readFully, readFully, readFully, readFully, readLines, readLines, readLines, readLines, skip, skip, skip, skipFully, skipFully, skipFully, toBufferedInputStream, toBufferedInputStream, toBufferedReader, toBufferedReader, toByteArray, 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, toString, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, writeChunked, writeChunked, writeLines, writeLines, writeLines, writeLinespublic 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 DataHandler toDataHandler(String name, Object object, org.mule.runtime.api.metadata.MediaType contentType) throws IOException
name - the name of the attachment being handledobject - the attachment to be handledcontentType - the Content-Type of the attachment that is being handledDataHandler of the corresponding attachmentIOException - if the transformation fails.public static Properties toProperties(File propertiesFile) throws IOException
IOExceptionpublic static Properties toProperties(URL url) throws IOException
IOExceptionCopyright © 2018. All rights reserved.