Class SingleFileRepository

java.lang.Object
helma.framework.repository.SingleFileRepository
All Implemented Interfaces:
Repository

public class SingleFileRepository extends Object implements Repository
  • Constructor Details

    • SingleFileRepository

      public SingleFileRepository(String initArgs)
      Constructs a SingleFileRepository using the given argument
      Parameters:
      initArgs - absolute path to the script file
    • SingleFileRepository

      public SingleFileRepository(File file)
      Constructs a SingleFileRepository using the given argument
      Parameters:
      file - the script file
    • SingleFileRepository

      public SingleFileRepository(File file, Repository parent)
      Constructs a SingleFileRepository using the given argument
      Parameters:
      file - the script file
      parent - the parent repository, or null
  • Method Details

    • getChecksum

      public long getChecksum() throws IOException
      Checksum of the repository and all its content. Implementations should make sure
      Specified by:
      getChecksum in interface Repository
      Returns:
      checksum
      Throws:
      IOException
    • getShortName

      public String getShortName()
      Returns the name of the repository.
      Specified by:
      getShortName in interface Repository
      Returns:
      name of the repository
    • getName

      public String getName()
      Returns the name of the repository; this is a full name including all parent repositories.
      Specified by:
      getName in interface Repository
      Returns:
      full 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
    • getParentRepository

      public Repository getParentRepository()
      Returns this repository's parent repository. Returns null if this repository already is the top-level repository
      Specified by:
      getParentRepository in interface Repository
      Returns:
      the parent repository
    • isScriptRoot

      public boolean isScriptRoot()
      Checks wether the repository is to be considered a top-level repository from a scripting point of view. For example, a zip file within a file repository is not a root repository from a physical point of view, but from the scripting point of view it is.
      Specified by:
      isScriptRoot in interface Repository
      Returns:
      true if the repository is to be considered a top-level script repository
    • create

      public void create() throws IOException
      Creates the repository if does not exist yet
      Specified by:
      create in interface Repository
      Throws:
      IOException
    • exists

      public boolean exists() throws IOException
      Checks wether the repository actually (or still) exists
      Specified by:
      exists in interface Repository
      Returns:
      true if the repository exists
      Throws:
      IOException
    • getRepositories

      public Repository[] getRepositories() throws IOException
      Returns this repository's direct child repositories
      Specified by:
      getRepositories in interface Repository
      Returns:
      direct repositories
      Throws:
      IOException
    • getAllResources

      public List getAllResources() throws IOException
      Returns all direct and indirect resources
      Specified by:
      getAllResources in interface Repository
      Returns:
      resources recursive
      Throws:
      IOException
    • getResources

      public Iterator getResources() throws IOException
      Returns all direct resources
      Specified by:
      getResources in interface Repository
      Returns:
      direct resources
      Throws:
      IOException
    • getResource

      public Resource getResource(String resourceName)
      Returns a specific direct resource of the repository
      Specified by:
      getResource in interface Repository
      Parameters:
      resourceName - name of the child resource to return
      Returns:
      specified child resource
    • lastModified

      public long lastModified() throws IOException
      Returns the date the repository was last modified.
      Specified by:
      lastModified in interface Repository
      Returns:
      last modified date
      Throws:
      IOException
    • getResource

      protected Resource getResource()
      Return our single resource.
      Returns:
      the wrapped resource
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object