Package org.apache.log4j.lf5.util
Class Resource
- java.lang.Object
-
- org.apache.log4j.lf5.util.Resource
-
public class Resource extends Object
Resource encapsulates access to Resources via the Classloader.- Author:
- Michael J. Sikorsky, Robert Shaw
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamgetInputStream()Get the InputStream for this Resource.InputStreamReadergetInputStreamReader()Get the InputStreamReader for this Resource.StringgetName()Get the name of the resource.URLgetURL()Get the URL of the Resource.voidsetName(String name)Set the name of the resource.
-
-
-
Field Detail
-
_name
protected String _name
-
-
Constructor Detail
-
Resource
public Resource()
Default, no argument constructor.
-
Resource
public Resource(String name)
Construct a Resource given a name.- See Also:
setName(String)
-
-
Method Detail
-
setName
public void setName(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 String getName()
Get the name of the resource. Set setName() for a description of a resource.- See Also:
setName(java.lang.String)
-
getInputStream
public InputStream getInputStream()
Get the InputStream for this Resource. Uses the classloader from this Resource.- See Also:
getInputStreamReader(),ResourceUtils
-
getInputStreamReader
public InputStreamReader getInputStreamReader()
Get the InputStreamReader for this Resource. Uses the classloader from this Resource.- See Also:
getInputStream(),ResourceUtils
-
getURL
public URL getURL()
Get the URL of the Resource. Uses the classloader from this Resource.- See Also:
ResourceUtils
-
-