Package org.apache.log4j.lf5.util
Class Resource
- java.lang.Object
-
- org.apache.log4j.lf5.util.Resource
-
public class Resource extends java.lang.ObjectResource encapsulates access to Resources via the Classloader.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String_name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamgetInputStream()Get the InputStream for this Resource.java.io.InputStreamReadergetInputStreamReader()Get the InputStreamReader for this Resource.java.lang.StringgetName()Get the name of the resource.java.net.URLgetURL()Get the URL of the Resource.voidsetName(java.lang.String name)Set the name of the resource.
-
-
-
Constructor Detail
-
Resource
public Resource()
Default, no argument constructor.
-
Resource
public Resource(java.lang.String name)
Construct a Resource given a name.- See Also:
setName(String)
-
-
Method Detail
-
setName
public void setName(java.lang.String name)
Set the name of the resource.A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.
The name of a resource is a "/"-separated path name that identifies the resource.
- See Also:
getName()
-
getName
public java.lang.String getName()
Get the name of the resource. Set setName() for a description of a resource.- See Also:
setName(java.lang.String)
-
getInputStream
public java.io.InputStream getInputStream()
Get the InputStream for this Resource. Uses the classloader from this Resource.- See Also:
getInputStreamReader(),ResourceUtils
-
getInputStreamReader
public java.io.InputStreamReader getInputStreamReader()
Get the InputStreamReader for this Resource. Uses the classloader from this Resource.- See Also:
getInputStream(),ResourceUtils
-
getURL
public java.net.URL getURL()
Get the URL of the Resource. Uses the classloader from this Resource.- See Also:
ResourceUtils
-
-