Skip to content
Access Java resources as .properties, File, XML or String
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Build Status Resource Utils

What is it?

Resource Utils provides straightforward access to Java resources in several formats so you don't have to write boilerplate conversions.

To get a resource as Properties:

Properties properties = ResourceUtils.getProperties("/com/github/davidcarboni/");

To get a resource as an XML Document:

Document document = ResourceUtils.getXml("/com/github/davidcarboni/app.xml");

To get a resource as a String:

String string = ResourceUtils.getString("/com/github/davidcarboni/string.resource");

To extract a resource to a temp File:

File temp = ResourceUtils.getFile("/com/github/davidcarboni/file.resource");

To get a resource as a Reader:

Reader reader = ResourceUtils.getReader("/com/github/davidcarboni/character.resource");

To get a resource as a good old InputStream:

InputStream input = ResourceUtils.getStream("/com/github/davidcarboni/");

Maven usage

To use resource-utils in your project:

You can’t perform that action at this time.