helma.framework.repository
Class AbstractRepository

java.lang.Object
  extended by helma.framework.repository.AbstractRepository
All Implemented Interfaces:
Repository
Direct Known Subclasses:
FileRepository, ZipRepository

public abstract class AbstractRepository
extends java.lang.Object
implements Repository

Provides common methods and fields for the default implementations of the repository interface


Constructor Summary
AbstractRepository()
           
 
Method Summary
protected abstract  Resource createResource(java.lang.String name)
          Called to create a child resource for this repository
 java.util.List getAllResources()
          Get a deep list of this repository's resources, including all resources contained in sub-reposotories.
 java.lang.String getName()
          Get the full name that identifies this repository globally
 Repository getParentRepository()
          Get this repository's parent repository.
 Repository[] getRepositories()
          Get an iterator over the sub-repositories contained in this repository.
 Resource getResource(java.lang.String name)
          Get a resource contained in this repository identified by the given local name.
 java.util.Iterator getResources()
          Get an iterator over the resources contained in this repository.
 Repository getRootRepository()
          Get this repository's logical script root repository.
 java.lang.String getShortName()
          Get the local name that identifies this repository locally within its parent repository
 java.lang.String toString()
          Returns the repositories full name as string representation.
abstract  void update()
          Called to check the repository's content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface helma.framework.repository.Repository
create, exists, getChecksum, isScriptRoot, lastModified
 

Constructor Detail

AbstractRepository

public AbstractRepository()
Method Detail

update

public abstract void update()
Called to check the repository's content.


createResource

protected abstract Resource createResource(java.lang.String name)
Called to create a child resource for this repository


getName

public java.lang.String getName()
Get the full name that identifies this repository globally

Specified by:
getName in interface Repository
Returns:
full name of the repository

getShortName

public java.lang.String getShortName()
Get the local name that identifies this repository locally within its parent repository

Specified by:
getShortName in interface Repository
Returns:
name of the repository

getRootRepository

public Repository getRootRepository()
Get this repository's logical script root repository.

Specified by:
getRootRepository in interface Repository
Returns:
top-level repository
See Also:
{isScriptRoot()}

getResource

public Resource getResource(java.lang.String name)
Get a resource contained in this repository identified by the given local name. If the name can't be resolved to a resource, a resource object is returned for which exists() returns false.

Specified by:
getResource in interface Repository
Parameters:
name - name of the child resource to return
Returns:
specified child resource

getResources

public java.util.Iterator getResources()
Get an iterator over the resources contained in this repository.

Specified by:
getResources in interface Repository
Returns:
direct resources

getRepositories

public Repository[] getRepositories()
Get an iterator over the sub-repositories contained in this repository.

Specified by:
getRepositories in interface Repository
Returns:
direct repositories

getParentRepository

public Repository getParentRepository()
Get this repository's parent repository.

Specified by:
getParentRepository in interface Repository
Returns:
the parent repository

getAllResources

public java.util.List getAllResources()
                               throws java.io.IOException
Get a deep list of this repository's resources, including all resources contained in sub-reposotories.

Specified by:
getAllResources in interface Repository
Returns:
resources recursive
Throws:
java.io.IOException

toString

public java.lang.String toString()
Returns the repositories full name as string representation.

Overrides:
toString in class java.lang.Object
See Also:
{getName()}


Copyright © 1998-1998-${year} Helma.org. All Rights Reserved.