NextApp Echo3
v3.0.b4

nextapp.echo.webcontainer
Class ResourceRegistry

java.lang.Object
  extended by nextapp.echo.webcontainer.ResourceRegistry

public class ResourceRegistry
extends java.lang.Object

A registry of CLASSPATH resources which are provided to the client via the ResourceService. Only specifically added resources are provided, for obvious security reasons.


Constructor Summary
ResourceRegistry()
           
 
Method Summary
 void add(java.lang.String packageId, java.lang.String resourceName, ContentType contentType)
          Adds a resource to a package.
 void addPackage(java.lang.String packageId, java.lang.String location)
          Registers a new resource package.
 ContentType getContentType(java.lang.String packageId, java.lang.String resourceName)
          Determines the content type of a resource.
 java.lang.String getLocation(java.lang.String packageId, java.lang.String resourceName)
          Determines the location of a resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceRegistry

public ResourceRegistry()
Method Detail

addPackage

public void addPackage(java.lang.String packageId,
                       java.lang.String location)
Registers a new resource package.

Parameters:
packageId - the identifier to use for the package, e.g., "Echo" is used for core resources.
location - the root location from which package resources can be retrieved (resource locations are relative to this location)

add

public void add(java.lang.String packageId,
                java.lang.String resourceName,
                ContentType contentType)
Adds a resource to a package.

Parameters:
packageId - the package identifier
resourceName - the name of the resource (the location of the resource relative to the package root location)
contentType - the content type of the resource

getContentType

public ContentType getContentType(java.lang.String packageId,
                                  java.lang.String resourceName)
Determines the content type of a resource.

Parameters:
packageId - the package identifier
resourceName - the resource name
Returns:
the content type of the resource (or null if none exists)

getLocation

public java.lang.String getLocation(java.lang.String packageId,
                                    java.lang.String resourceName)
Determines the location of a resource.

Parameters:
packageId - the package identifier
resourceName - the resource name
Returns:
the location of the resource

NextApp Echo3
v3.0.b4