public class ResourceUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static File |
copyResourceTo(String resource,
File dir)
Copy a resource to the target directory.
|
static ByteBuffer |
getResourceAsByteBuffer(String resource)
Get the resource content as a byte buffer.
|
static byte[] |
getResourceAsBytes(String resource)
Get the resource content as a byte array.
|
static BufferedInputStream |
getResourceAsStream(String resource)
Get the resource as a buffered input stream.
|
static String |
getResourceAsString(String resource)
Get the resource content as a string.
|
static File |
writeContentTo(String content,
File target)
Write the file content to the target file.
|
public static File copyResourceTo(String resource, File dir)
resource - The resource path.dir - Target directory.public static File writeContentTo(String content, File target)
content - The file content.target - The file to write to.public static BufferedInputStream getResourceAsStream(String resource)
resource - The resource to get.public static byte[] getResourceAsBytes(String resource)
resource - The resource to read.public static ByteBuffer getResourceAsByteBuffer(String resource)
resource - The resource to read.Copyright © 2017. All rights reserved.