public class

ResourceUtils

extends Object
java.lang.Object
   ↳ org.apache.log4j.lf5.util.ResourceUtils

Class Overview

ResourceUtils. Provide a set of convenience methods for working with Resources.

See Also

Summary

Public Constructors
ResourceUtils()
Public Methods
static InputStream getResourceAsStream(Object object, Resource resource)
Get the InputStream for this resource.
static URL getResourceAsURL(Object object, Resource resource)
Get the URL for this resource.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ResourceUtils ()

Public Methods

public static InputStream getResourceAsStream (Object object, Resource resource)

Get the InputStream for this resource. Note: to convert an InputStream into an InputReader, use: new InputStreamReader(InputStream).

Parameters
object The object to grab the Classloader from. This parameter is quite important from a visibility of resources standpoint as the hierarchy of Classloaders plays a role.
resource The resource to load.
Returns
  • If the Resource was found, the InputStream, otherwise null.

public static URL getResourceAsURL (Object object, Resource resource)

Get the URL for this resource.

Parameters
object The object to grab the Classloader from. This parameter is quite important from a visibility of resources standpoint as the hierarchy of Classloaders plays a role.
resource The resource to load.
Returns
  • If the Resource was found, the URL, otherwise null.