public class FileRepository extends AbstractRepository
| Modifier and Type | Field and Description |
|---|---|
protected File |
directory |
protected long |
lastChecksum |
protected long |
lastChecksumTime |
protected long |
lastModified |
SEPARATOR| Modifier | Constructor and Description |
|---|---|
|
FileRepository(File dir)
Constructs a FileRepository using the given directory as top-level
repository
|
protected |
FileRepository(File dir,
FileRepository parent)
Constructs a FileRepository using the given directory and top-level
repository
|
|
FileRepository(String path)
Constructs a FileRepository using the given argument
|
| Modifier and Type | Method and Description |
|---|---|
AbstractRepository |
createChildRepository(String name)
Create a child repository with the given name
|
boolean |
equals(Object obj) |
boolean |
exists()
Check whether the repository exists.
|
long |
getChecksum()
Checksum of the repository and all its contained resources.
|
AbstractRepository |
getParentRepository()
Get this repository's parent repository.
|
Repository[] |
getRepositories()
Returns this repository's direct child repositories
|
protected void |
getResources(List<Resource> list,
boolean recursive)
Add the repository's resources into the list, optionally descending into
nested repositories.
|
URL |
getUrl()
Returns an url to the resource if the repository of this resource is
able to provide urls.
|
int |
hashCode() |
long |
lastModified()
Returns the date the repository was last modified.
|
protected Resource |
lookupResource(String name)
Called to create a child resource for this repository
|
String |
toString()
Returns the repositories full path as string representation.
|
getChildRepository, getModuleName, getName, getPath, getRelativePath, getResource, getResources, getResources, getResources, getRootRepository, isAbsolute, lookupRepository, resolve, setAbsolute, setRootprotected final File directory
protected long lastModified
protected long lastChecksum
protected long lastChecksumTime
public FileRepository(String path) throws IOException
path - absolute path to the directoryIOException - if canonical path couldn't be resolvedpublic FileRepository(File dir) throws IOException
dir - directoryIOException - if canonical path couldn't be resolvedprotected FileRepository(File dir, FileRepository parent) throws IOException
dir - directoryparent - top-level repositoryIOException - if canonical path couldn't be resolvedpublic boolean exists()
public AbstractRepository createChildRepository(String name) throws IOException
createChildRepository in class AbstractRepositoryname - the name of the repositoryIOException - an I/O error occurredpublic AbstractRepository getParentRepository()
getParentRepository in interface TrackablegetParentRepository in class AbstractRepositorypublic long lastModified()
public long getChecksum()
throws IOException
IOExceptionprotected Resource lookupResource(String name) throws IOException
lookupResource in class AbstractRepositoryname - the name of the child resourceIOException - an I/O error occurredprotected void getResources(List<Resource> list, boolean recursive) throws IOException
AbstractRepositorygetResources in class AbstractRepositorylist - the list to add the resources torecursive - whether to descend into nested repositoriesIOException - an I/O related error occurredpublic Repository[] getRepositories() throws IOException
RepositoryIOException - an I/O error occurredpublic URL getUrl() throws MalformedURLException
TrackableMalformedURLExceptionpublic String toString()
AbstractRepositorytoString in class AbstractRepositoryAbstractRepository.getPath()Copyright © 2016. All rights reserved.