Class VaultFileSystemImpl
- java.lang.Object
-
- org.apache.jackrabbit.vault.fs.impl.VaultFileSystemImpl
-
- All Implemented Interfaces:
VaultFileSystem
public class VaultFileSystemImpl extends Object implements VaultFileSystem
The Vault filesystem provides an additional abstraction layer on top of the artifacts manager tree. It is used to map the artifacts node artifacts to individual java.io like files.
-
-
Constructor Summary
Constructors Constructor Description VaultFileSystemImpl(Aggregate rootAggregate, String rootPath, boolean ownMgr)Creates a new os file system that uses the given manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AggregateManagergetAggregateManager()Returns the attached artifacts manager.VaultFsConfiggetConfig()Returns the vault configuration that is usedVaultFilegetFile(String path)Returns the file at the given path.VaultFilegetFile(VaultFile parent, String path)Returns the file at the given path.VaultFilegetRoot()Returns the root fileWorkspaceFiltergetWorkspaceFilter()Returns the current workspace filtervoidinvalidate()Flushes the file cachebooleanisMounted()Checks if this tree is still mounted and if the attached session is still live.VaultFsTransactionstartTransaction()Starts a new transaction.voidunmount()Releases all resources attached to this Vault filesystem
-
-
-
Constructor Detail
-
VaultFileSystemImpl
public VaultFileSystemImpl(Aggregate rootAggregate, String rootPath, boolean ownMgr) throws IOException, RepositoryException
Creates a new os file system that uses the given manager.- Parameters:
rootAggregate- the root artifacts noderootPath- path of the root node in platform format (compare withPlatformNameFormat)ownMgr-trueif it's own manager- Throws:
IOException- if an I/O error occursRepositoryException- if a repository error occurs.
-
-
Method Detail
-
unmount
public void unmount() throws RepositoryExceptionDescription copied from interface:VaultFileSystemReleases all resources attached to this Vault filesystem- Specified by:
unmountin interfaceVaultFileSystem- Throws:
RepositoryException- if an error occurs.
-
isMounted
public boolean isMounted()
Description copied from interface:VaultFileSystemChecks if this tree is still mounted and if the attached session is still live.- Specified by:
isMountedin interfaceVaultFileSystem- Returns:
trueif still mounted
-
getRoot
public VaultFile getRoot()
Description copied from interface:VaultFileSystemReturns the root file- Specified by:
getRootin interfaceVaultFileSystem- Returns:
- the root file
-
getAggregateManager
public AggregateManager getAggregateManager()
Description copied from interface:VaultFileSystemReturns the attached artifacts manager.- Specified by:
getAggregateManagerin interfaceVaultFileSystem- Returns:
- the attached artifacts manager.
-
getFile
public VaultFile getFile(String path) throws IOException, RepositoryException
Description copied from interface:VaultFileSystemReturns the file at the given path. If the file does not existsnullis thrown.- Specified by:
getFilein interfaceVaultFileSystem- Parameters:
path- the path of the file- Returns:
- the file or
null - Throws:
IOException- if an I/O error occurs.RepositoryException- if a repository error occurs.
-
getFile
public VaultFile getFile(VaultFile parent, String path) throws IOException, RepositoryException
Description copied from interface:VaultFileSystemReturns the file at the given path. The path can be relative and may contain ".." path elements. If the file does not existsnullis returned.- Specified by:
getFilein interfaceVaultFileSystem- Parameters:
parent- the parent file.path- the path of the file- Returns:
- the file or
null - Throws:
IOException- if an I/O error occurs.RepositoryException- if a repository error occurs.
-
startTransaction
public VaultFsTransaction startTransaction()
Description copied from interface:VaultFileSystemStarts a new transaction.- Specified by:
startTransactionin interfaceVaultFileSystem- Returns:
- a new transaction.
-
invalidate
public void invalidate() throws RepositoryExceptionDescription copied from interface:VaultFileSystemFlushes the file cache- Specified by:
invalidatein interfaceVaultFileSystem- Throws:
RepositoryException- if an error occurs
-
getConfig
public VaultFsConfig getConfig()
Description copied from interface:VaultFileSystemReturns the vault configuration that is used- Specified by:
getConfigin interfaceVaultFileSystem- Returns:
- the vault configuration.
-
getWorkspaceFilter
public WorkspaceFilter getWorkspaceFilter()
Description copied from interface:VaultFileSystemReturns the current workspace filter- Specified by:
getWorkspaceFilterin interfaceVaultFileSystem- Returns:
- the workspace filter
-
-