org.apache.catalina.resources
Class DirectoryBean

java.lang.Object
  |
  +--org.apache.catalina.resources.ResourceBean
        |
        +--org.apache.catalina.resources.DirectoryBean

public final class DirectoryBean
extends ResourceBean

Abstraction bean that represents the properties of a "resource" that is actually a "directory", in a fashion that 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.

IMPLEMENTATION NOTE: It is assumed that access to the set of resources associated with this directory are done in a thread safe manner. No internal synchronization is performed.

Version:
$Revision: 1.3 $ $Date: 2000/10/17 19:56:03 $
Author:
Craig R. McClanahan

Field Summary
protected static StringManager sm
          The string manager for this package.
 
Fields inherited from class org.apache.catalina.resources.ResourceBean
data, lastModified, name, parent, size
 
Constructor Summary
DirectoryBean(java.lang.String name)
          Construct a new directory bean for the named resource, with default properties.
DirectoryBean(java.lang.String name, java.io.File file)
          Construct a new directory bean for the named resource, with properties populated from the specified object.
DirectoryBean(java.lang.String name, java.util.jar.JarEntry entry)
          Construct a new directory bean for the named resource, with properties populated from the specified object.
 
Method Summary
 void addResource(ResourceBean resource)
          Add a new resource to this directory.
 ResourceBean[] findResources()
          Return the set of resources that belong to this directory, in alphabetical order based on their names.
 void removeResource(ResourceBean resource)
          Remove an existing resource from this directory.
 java.io.InputStream render(java.lang.String contextPath)
          Return an InputStream to an HTML representation of the contents of this directory.
 
Methods inherited from class org.apache.catalina.resources.ResourceBean
cache, getData, getLastModified, getName, getParent, getSize, populate, populate, setData, setLastModified, setName, setParent, setSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sm

protected static final StringManager sm
The string manager for this package.
Constructor Detail

DirectoryBean

public DirectoryBean(java.lang.String name)
Construct a new directory bean for the named resource, with default properties.
Parameters:
name - Normalized context-relative name of this resource

DirectoryBean

public DirectoryBean(java.lang.String name,
                     java.io.File file)
Construct a new directory bean for the named resource, with properties populated from the specified object. Note that the data content of this resource is not initialized unless and until setData() is called.
Parameters:
name - Normalized context-relative name of this resource
file - File representing this resource entry

DirectoryBean

public DirectoryBean(java.lang.String name,
                     java.util.jar.JarEntry entry)
Construct a new directory bean for the named resource, with properties populated from the specified object. Note that the data content of this resource is not initialized unless and until setData() is called.
Parameters:
name - Normalized context-relative name of this resource
entry - JAR entry representing this resource entry
Method Detail

addResource

public void addResource(ResourceBean resource)
Add a new resource to this directory.
Parameters:
entry - ResourceBean for the resource to be added

findResources

public ResourceBean[] findResources()
Return the set of resources that belong to this directory, in alphabetical order based on their names.

removeResource

public void removeResource(ResourceBean resource)
Remove an existing resource from this directory.
Parameters:
entry - ResourceBean for the resource to be removed

render

public java.io.InputStream render(java.lang.String contextPath)
Return an InputStream to an HTML representation of the contents of this directory.
Parameters:
contextPath - Context path to which our internal paths are relative


Copyright © 2000 Apache Software Foundation. All Rights Reserved.