Class AbstractFileSystemComponentRepository
- java.lang.Object
-
- com.zfabrik.components.provider.util.AbstractExtComponentRepository<RootBoundFSCRComponent,MultiRootFSComponentRepositoryDB>
-
- com.zfabrik.components.provider.fs.AbstractFileSystemComponentRepository
-
- All Implemented Interfaces:
com.zfabrik.components.provider.IComponentsRepository
,com.zfabrik.util.sync.ISynchronizer
public class AbstractFileSystemComponentRepository extends com.zfabrik.components.provider.util.AbstractExtComponentRepository<RootBoundFSCRComponent,MultiRootFSComponentRepositoryDB>
An abstract component repository implementation over a file system style storage. The defining characteristics is that there is no simpler way to determine some last modified information than a scan for last modified time stamps (up to some depths) over the repository and that scanning is acceptably fast.
-
-
Constructor Summary
Constructors Constructor Description AbstractFileSystemComponentRepository(java.lang.String name, int prio)
AbstractFileSystemComponentRepository(java.lang.String name, int prio, int checkDepth)
AbstractFileSystemComponentRepository(java.lang.String name, int prio, int checkDepth, boolean autoConfigure)
Constructor leaving a choice whether the repo completes configuration in the constructor (defaults to true with the other constructors).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
download(RootBoundFSCRComponent c, java.io.File folder)
Provide all resources for a component into a given folderjava.util.Map<java.lang.String,? extends IAbstractFileSystem>
getRoots()
MultiRootFSComponentRepositoryDB
scan(MultiRootFSComponentRepositoryDB current)
The FSCR is scanning at startup always completely.void
setRoots(java.util.Map<java.lang.String,? extends IAbstractFileSystem> roots)
Set roots within repo.java.lang.String
toString()
-
Methods inherited from class com.zfabrik.components.provider.util.AbstractExtComponentRepository
as, checkOfflineMode, complete, configure, configure, configure, findComponents, getCacheRoot, getComponent, getContext, getDB, getExpectedConfiguration, getModules, getName, getRevision, getRevision, getURL, has, isRelaxedMode, preInvalidation, preInvalidation, retrieve, setEvictionDelay, start, stop, test_setContext, test_setDb, test_setInited
-
-
-
-
Constructor Detail
-
AbstractFileSystemComponentRepository
public AbstractFileSystemComponentRepository(java.lang.String name, int prio, int checkDepth)
-
AbstractFileSystemComponentRepository
public AbstractFileSystemComponentRepository(java.lang.String name, int prio, int checkDepth, boolean autoConfigure)
Constructor leaving a choice whether the repo completes configuration in the constructor (defaults to true with the other constructors). If not chosen, theAbstractExtComponentRepository.configure(int)
method needs to be called explicitely before going into service. This may be useful ifAbstractExtComponentRepository.getExpectedConfiguration()
is used with non-default values or other configuration is changed.
-
AbstractFileSystemComponentRepository
public AbstractFileSystemComponentRepository(java.lang.String name, int prio)
-
-
Method Detail
-
getRoots
public java.util.Map<java.lang.String,? extends IAbstractFileSystem> getRoots()
-
setRoots
public void setRoots(java.util.Map<java.lang.String,? extends IAbstractFileSystem> roots)
Set roots within repo. Roots must be configured before first scan. Roots are pathes within the file system based repo without leading slash and always relative to the repository root folder.
-
scan
public MultiRootFSComponentRepositoryDB scan(MultiRootFSComponentRepositoryDB current)
The FSCR is scanning at startup always completely. Therefore we really don't care so much about the DB in terms of caching. But the DB will be used by workers nevertheless.- Specified by:
scan
in classcom.zfabrik.components.provider.util.AbstractExtComponentRepository<RootBoundFSCRComponent,MultiRootFSComponentRepositoryDB>
-
download
public void download(RootBoundFSCRComponent c, java.io.File folder)
Provide all resources for a component into a given folder- Specified by:
download
in classcom.zfabrik.components.provider.util.AbstractExtComponentRepository<RootBoundFSCRComponent,MultiRootFSComponentRepositoryDB>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classcom.zfabrik.components.provider.util.AbstractExtComponentRepository<RootBoundFSCRComponent,MultiRootFSComponentRepositoryDB>
-
-