|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.catalina.resources.ResourceBean
Abstraction bean that represents the properties of a "resource" that may or may not be a "directory", in a fashion that is independent of the actual underlying medium used to represent those entries. Convenient constructors are provided to populate our properties from common sources, but it is feasible to do everything with property setters if necessary.
Field Summary | |
protected byte[] |
data
The data content of this resource. |
protected long |
lastModified
The last modified date/time for this resource, in milliseconds since the epoch. |
protected java.lang.String |
name
The normalized context-relative name of this resource. |
protected DirectoryBean |
parent
The parent resource (normally a directory entry) of this resource. |
protected long |
size
The size of this resource, in bytes. |
Constructor Summary | |
ResourceBean(java.lang.String name)
Construct a new resource bean for the named resource, with default properties. |
|
ResourceBean(java.lang.String name,
java.io.File file)
Construct a new resource bean for the named resource, with properties populated from the specified object. |
|
ResourceBean(java.lang.String name,
java.util.jar.JarEntry entry)
Construct a new resource bean for the named resource, with properties populated from the specified object. |
Method Summary | |
void |
cache(java.io.InputStream input)
Cache the data for this resource from the specified input stream. |
byte[] |
getData()
|
long |
getLastModified()
|
java.lang.String |
getName()
|
DirectoryBean |
getParent()
|
long |
getSize()
|
protected void |
populate(java.io.File file)
Populate our properties from the specified File object. |
protected void |
populate(java.util.jar.JarEntry entry)
Populate our properties from the specified JarEntry object. |
void |
setData(byte[] data)
|
void |
setLastModified(long lastModified)
|
void |
setName(java.lang.String name)
|
void |
setParent(DirectoryBean parent)
|
void |
setSize(long size)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected byte[] data
protected long lastModified
protected java.lang.String name
protected DirectoryBean parent
setParent()
explicitly if you wish to maintain this
relationship.protected long size
Constructor Detail |
public ResourceBean(java.lang.String name)
name
- Normalized context-relative name of this resourcepublic ResourceBean(java.lang.String name, java.io.File file)
setData()
is called.name
- Normalized context-relative name of this resourcefile
- File representing this resource entrypublic ResourceBean(java.lang.String name, java.util.jar.JarEntry entry)
setData()
is called.name
- Normalized context-relative name of this resourceentry
- JAR entry representing this resource entryMethod Detail |
public byte[] getData()
public void setData(byte[] data)
public long getLastModified()
public void setLastModified(long lastModified)
public java.lang.String getName()
public void setName(java.lang.String name)
public DirectoryBean getParent()
public void setParent(DirectoryBean parent)
public long getSize()
public void setSize(long size)
public void cache(java.io.InputStream input) throws java.io.IOException
input
- InputStream from which to read the data for this resourcejava.io.IOException
- if an input/output error occursprotected void populate(java.io.File file)
file
- File representing this entryprotected void populate(java.util.jar.JarEntry entry)
entry
- JarEntry representing this entry
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |