Package helma.framework.repository

# Class ZipRepository

java.lang.Object
helma.framework.repository.AbstractRepository
helma.framework.repository.ZipRepository

All Implemented Interfaces:
  `Repository`

public final class ZipRepository extends AbstractRepository

## Constructor Summary

Constructors
Constructor
Description
`ZipRepository(File file)`
Constructs a ZipRespository using the given argument
`ZipRepository(File file, Repository parent)`
Constructs a ZipRepository using the given zip file as top-level repository
`ZipRepository(String initArgs)`
Constructs a ZipRespository using the given argument

## Method Summary

Modifier and Type
Method
Description
`void`
`create()`
Creates the repository if does not exist yet
`protected Resource`
`createResource(String name)`
Called to create a child resource for this repository
`boolean`
`equals(Object obj)`
`boolean`
`exists()`
Checks wether the repository actually (or still) exists
`long`
`getChecksum()`
Checksum of the repository and all its content.
`protected ZipFile`
`getZipFile()`
Returns a java.util.zip.ZipFile for this repository.
`int`
`hashCode()`
`boolean`
`isScriptRoot()`
Checks wether the repository is to be considered a top-level repository from a scripting point of view.
`long`
`lastModified()`
Returns the date the repository was last modified.
`String`
`toString()`
Returns the repositories full name as string representation.
`void`
`update()`
Called to check the repository's content.

### Methods inherited from class helma.framework.repository.AbstractRepository

`getAllResources, getName, getParentRepository, getRepositories, getResource, getResources, getRootRepository, getShortName`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### ZipRepository

public ZipRepository(String initArgs)
Constructs a ZipRespository using the given argument

Parameters:
  `initArgs` - absolute path to the zip file

### ZipRepository

public ZipRepository(File file)
Constructs a ZipRespository using the given argument

Parameters:
  `file` - zip file

### ZipRepository

public ZipRepository(File file, Repository parent)
Constructs a ZipRepository using the given zip file as top-level repository

Parameters:
  `file` - a zip file
  `parent` - the parent repository, or null

## Method Details

### getZipFile

protected ZipFile getZipFile() throws IOException
Returns a java.util.zip.ZipFile for this repository. It is the caller's responsability to call close() in it when it is no longer needed.

Returns:
  a ZipFile for reading
Throws:
  `IOException`

### update

public void update()
Description copied from class: `AbstractRepository`
Called to check the repository's content.

Specified by:
  `update` in class `AbstractRepository`

### createResource

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

Specified by:
  `createResource` in class `AbstractRepository`

### getChecksum

public long getChecksum()
Description copied from interface: `Repository`
Checksum of the repository and all its content. Implementations should make sure

Returns:
  checksum

### exists

public boolean exists()
Description copied from interface: `Repository`
Checks wether the repository actually (or still) exists

Returns:
  true if the repository exists

### create

public void create()
Description copied from interface: `Repository`
Creates the repository if does not exist yet

### 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.

Returns:
  true if the repository is to be considered a top-level script repository

### lastModified

public long lastModified()
Description copied from interface: `Repository`
Returns the date the repository was last modified.

Returns:
  last modified date

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### toString

public String toString()
Description copied from class: `AbstractRepository`
Returns the repositories full name as string representation.

Overrides:
  `toString` in class `AbstractRepository`