Resource Utils

Convenience for dealing with Java resources as properties, files, text and input streams.

License

License

GroupId

GroupId

com.github.davidcarboni
ArtifactId

ArtifactId

resource-utils
Last Version

Last Version

1.2.2
Release Date

Release Date

Type

Type

jar
Description

Description

Resource Utils
Convenience for dealing with Java resources as properties, files, text and input streams.
Project URL

Project URL

https://github.com/davidcarboni/resource-utils
Project Organization

Project Organization

Carboni
Source Code Management

Source Code Management

https://github.com/davidcarboni/resource-utils

Download resource-utils

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.davidcarboni/resource-utils/ -->
<dependency>
    <groupId>com.github.davidcarboni</groupId>
    <artifactId>resource-utils</artifactId>
    <version>1.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.davidcarboni/resource-utils/
implementation 'com.github.davidcarboni:resource-utils:1.2.2'
// https://jarcasting.com/artifacts/com.github.davidcarboni/resource-utils/
implementation ("com.github.davidcarboni:resource-utils:1.2.2")
'com.github.davidcarboni:resource-utils:jar:1.2.2'
<dependency org="com.github.davidcarboni" name="resource-utils" rev="1.2.2">
  <artifact name="resource-utils" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.davidcarboni', module='resource-utils', version='1.2.2')
)
libraryDependencies += "com.github.davidcarboni" % "resource-utils" % "1.2.2"
[com.github.davidcarboni/resource-utils "1.2.2"]

Dependencies

compile (1)

Group / Artifact Type Version
commons-io : commons-io jar 2.4

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

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/app.properties");

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/resource.data");

Maven usage

To use resource-utils in your project:

	<dependency>
		<groupId>com.github.davidcarboni</groupId>
		<artifactId>resource-utils</artifactId>
		<version>1.1.0</version>
	</dependency>

Versions

Version
1.2.2
1.2.0
1.1.2
1.1.1
1.1.0
1.0.7