Package helma.framework.repository
Class SingleFileRepository
java.lang.Object
helma.framework.repository.SingleFileRepository
- All Implemented Interfaces:
Repository
-
Constructor Summary
ConstructorsConstructorDescriptionSingleFileRepository
(File file) Constructs a SingleFileRepository using the given argumentSingleFileRepository
(File file, Repository parent) Constructs a SingleFileRepository using the given argumentSingleFileRepository
(String initArgs) Constructs a SingleFileRepository using the given argument -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Creates the repository if does not exist yetboolean
Indicates whether some other object is "equal to" this one.boolean
exists()
Checks wether the repository actually (or still) existsReturns all direct and indirect resourceslong
Checksum of the repository and all its content.getName()
Returns the name of the repository; this is a full name including all parent repositories.Returns this repository's parent repository.Returns this repository's direct child repositoriesprotected Resource
Return our single resource.getResource
(String resourceName) Returns a specific direct resource of the repositoryReturns all direct resourcesGet this repository's logical script root repository.Returns the name of the repository.int
hashCode()
Returns a hash code value for the object.boolean
Checks wether the repository is to be considered a top-level repository from a scripting point of view.long
Returns the date the repository was last modified.toString()
Returns a string representation of the object.
-
Constructor Details
-
SingleFileRepository
Constructs a SingleFileRepository using the given argument- Parameters:
initArgs
- absolute path to the script file
-
SingleFileRepository
Constructs a SingleFileRepository using the given argument- Parameters:
file
- the script file
-
SingleFileRepository
Constructs a SingleFileRepository using the given argument- Parameters:
file
- the script fileparent
- the parent repository, or null
-
-
Method Details
-
getChecksum
Checksum of the repository and all its content. Implementations should make sure- Specified by:
getChecksum
in interfaceRepository
- Returns:
- checksum
- Throws:
IOException
-
getShortName
Returns the name of the repository.- Specified by:
getShortName
in interfaceRepository
- Returns:
- name of the repository
-
getName
Returns the name of the repository; this is a full name including all parent repositories.- Specified by:
getName
in interfaceRepository
- Returns:
- full name of the repository
-
getRootRepository
Get this repository's logical script root repository.- Specified by:
getRootRepository
in interfaceRepository
- Returns:
- top-level repository
-
getParentRepository
Returns this repository's parent repository. Returns null if this repository already is the top-level repository- Specified by:
getParentRepository
in interfaceRepository
- 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 interfaceRepository
- Returns:
- true if the repository is to be considered a top-level script repository
-
create
Creates the repository if does not exist yet- Specified by:
create
in interfaceRepository
- Throws:
IOException
-
exists
Checks wether the repository actually (or still) exists- Specified by:
exists
in interfaceRepository
- Returns:
- true if the repository exists
- Throws:
IOException
-
getRepositories
Returns this repository's direct child repositories- Specified by:
getRepositories
in interfaceRepository
- Returns:
- direct repositories
- Throws:
IOException
-
getAllResources
Returns all direct and indirect resources- Specified by:
getAllResources
in interfaceRepository
- Returns:
- resources recursive
- Throws:
IOException
-
getResources
Returns all direct resources- Specified by:
getResources
in interfaceRepository
- Returns:
- direct resources
- Throws:
IOException
-
getResource
Returns a specific direct resource of the repository- Specified by:
getResource
in interfaceRepository
- Parameters:
resourceName
- name of the child resource to return- Returns:
- specified child resource
-
lastModified
Returns the date the repository was last modified.- Specified by:
lastModified
in interfaceRepository
- Returns:
- last modified date
- Throws:
IOException
-
getResource
Return our single resource.- Returns:
- the wrapped resource
-
equals
Indicates whether some other object is "equal to" this one. -
hashCode
public int hashCode()Returns a hash code value for the object. -
toString
Returns a string representation of the object.
-