Package org.ringojs.repository
Interface Repository
-
- All Superinterfaces:
java.io.Serializable
,Trackable
- All Known Implementing Classes:
AbstractRepository
,FileRepository
,WebappRepository
,ZipRepository
public interface Repository extends Trackable
Repository represents an abstract container of resources (e.g. code, skins, ...). In addition to resources, repositories may contain other repositories, building a hierarchical structure.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SEPARATOR
String containing file separator characters.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Repository
getChildRepository(java.lang.String path)
Get a child repository with the given pathjava.lang.String
getRelativePath()
Get the path of this repository relative to its root repository.Repository[]
getRepositories()
Returns this repository's direct child repositoriesResource
getResource(java.lang.String resourceName)
Returns a specific direct resource of the repositoryResource[]
getResources()
Get a list of resources contained in this repository identified by the given local name.Resource[]
getResources(boolean recursive)
Get a list of resources contained in this repository identified by the given local name.Resource[]
getResources(java.lang.String resourcePath, boolean recursive)
Get a list of resources contained in this repository identified by the given local name.void
setRoot()
Mark this repository as root repository, disabling any parent access.-
Methods inherited from interface org.ringojs.repository.Trackable
exists, getChecksum, getModuleName, getName, getParentRepository, getPath, getRootRepository, getUrl, isAbsolute, lastModified, setAbsolute
-
-
-
-
Method Detail
-
getResource
Resource getResource(java.lang.String resourceName) throws java.io.IOException
Returns a specific direct resource of the repository- Parameters:
resourceName
- name of the child resource to return- Returns:
- specified child resource
- Throws:
java.io.IOException
-
getResources
Resource[] getResources() throws java.io.IOException
Get a list of resources contained in this repository identified by the given local name.- Returns:
- a list of all direct child resources
- Throws:
java.io.IOException
-
getResources
Resource[] getResources(boolean recursive) throws java.io.IOException
Get a list of resources contained in this repository identified by the given local name.- Parameters:
recursive
- whether to include nested resources- Returns:
- a list of all nested child resources
- Throws:
java.io.IOException
-
getResources
Resource[] getResources(java.lang.String resourcePath, boolean recursive) throws java.io.IOException
Get a list of resources contained in this repository identified by the given local name.- Parameters:
resourcePath
- the repository pathrecursive
- whether to include nested resources- Returns:
- a list of all nested child resources
- Throws:
java.io.IOException
-
getRepositories
Repository[] getRepositories() throws java.io.IOException
Returns this repository's direct child repositories- Returns:
- direct repositories
- Throws:
java.io.IOException
- an I/O error occurred
-
getChildRepository
Repository getChildRepository(java.lang.String path) throws java.io.IOException
Get a child repository with the given path- Parameters:
path
- the path of the repository- Returns:
- the child repository
- Throws:
java.io.IOException
- an IOException occurred
-
setRoot
void setRoot()
Mark this repository as root repository, disabling any parent access.
-
getRelativePath
java.lang.String getRelativePath()
Get the path of this repository relative to its root repository.- Specified by:
getRelativePath
in interfaceTrackable
- Returns:
- the repository path
-
-