Class AbstractRepository

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

public abstract class AbstractRepository extends Object implements Repository
Provides common methods and fields for the default implementations of the repository interface
  • Constructor Details

    • AbstractRepository

      public AbstractRepository()
  • Method Details

    • update

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

      protected abstract Resource createResource(String name)
      Called to create a child resource for this repository
    • getName

      public 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 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
    • getResource

      public Resource getResource(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 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 List getAllResources() throws 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:
      IOException
    • toString

      public String toString()
      Returns the repositories full name as string representation.
      Overrides:
      toString in class Object