Package helma.framework.repository
Class AbstractRepository
- java.lang.Object
-
- 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
Constructors Constructor Description AbstractRepository()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Resource
createResource(java.lang.String name)
Called to create a child resource for this repositoryjava.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 globallyRepository
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 repositoryjava.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
-
-
-
-
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 interfaceRepository
- 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 interfaceRepository
- Returns:
- name of the repository
-
getRootRepository
public Repository getRootRepository()
Get this repository's logical script root repository.- Specified by:
getRootRepository
in interfaceRepository
- Returns:
- top-level repository
-
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 whichexists()
returnsfalse
.
- Specified by:
getResource
in interfaceRepository
- 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 interfaceRepository
- Returns:
- direct resources
-
getRepositories
public Repository[] getRepositories()
Get an iterator over the sub-repositories contained in this repository.- Specified by:
getRepositories
in interfaceRepository
- Returns:
- direct repositories
-
getParentRepository
public Repository getParentRepository()
Get this repository's parent repository.- Specified by:
getParentRepository
in interfaceRepository
- 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 interfaceRepository
- Returns:
- resources recursive
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
Returns the repositories full name as string representation.- Overrides:
toString
in classjava.lang.Object
-
-