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 AggregateManager
getAggregateManager()
Returns the attached artifacts manager.VaultFsConfig
getConfig()
Returns the vault configuration that is usedVaultFile
getFile(String path)
Returns the file at the given path.VaultFile
getFile(VaultFile parent, String path)
Returns the file at the given path.VaultFile
getRoot()
Returns the root fileWorkspaceFilter
getWorkspaceFilter()
Returns the current workspace filtervoid
invalidate()
Flushes the file cacheboolean
isMounted()
Checks if this tree is still mounted and if the attached session is still live.VaultFsTransaction
startTransaction()
Starts a new transaction.void
unmount()
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
-true
if it's own manager- Throws:
IOException
- if an I/O error occursRepositoryException
- if a repository error occurs.
-
-
Method Detail
-
unmount
public void unmount() throws RepositoryException
Description copied from interface:VaultFileSystem
Releases all resources attached to this Vault filesystem- Specified by:
unmount
in interfaceVaultFileSystem
- Throws:
RepositoryException
- if an error occurs.
-
isMounted
public boolean isMounted()
Description copied from interface:VaultFileSystem
Checks if this tree is still mounted and if the attached session is still live.- Specified by:
isMounted
in interfaceVaultFileSystem
- Returns:
true
if still mounted
-
getRoot
public VaultFile getRoot()
Description copied from interface:VaultFileSystem
Returns the root file- Specified by:
getRoot
in interfaceVaultFileSystem
- Returns:
- the root file
-
getAggregateManager
public AggregateManager getAggregateManager()
Description copied from interface:VaultFileSystem
Returns the attached artifacts manager.- Specified by:
getAggregateManager
in interfaceVaultFileSystem
- Returns:
- the attached artifacts manager.
-
getFile
public VaultFile getFile(String path) throws IOException, RepositoryException
Description copied from interface:VaultFileSystem
Returns the file at the given path. If the file does not existsnull
is thrown.- Specified by:
getFile
in 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:VaultFileSystem
Returns the file at the given path. The path can be relative and may contain ".." path elements. If the file does not existsnull
is returned.- Specified by:
getFile
in 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:VaultFileSystem
Starts a new transaction.- Specified by:
startTransaction
in interfaceVaultFileSystem
- Returns:
- a new transaction.
-
invalidate
public void invalidate() throws RepositoryException
Description copied from interface:VaultFileSystem
Flushes the file cache- Specified by:
invalidate
in interfaceVaultFileSystem
- Throws:
RepositoryException
- if an error occurs
-
getConfig
public VaultFsConfig getConfig()
Description copied from interface:VaultFileSystem
Returns the vault configuration that is used- Specified by:
getConfig
in interfaceVaultFileSystem
- Returns:
- the vault configuration.
-
getWorkspaceFilter
public WorkspaceFilter getWorkspaceFilter()
Description copied from interface:VaultFileSystem
Returns the current workspace filter- Specified by:
getWorkspaceFilter
in interfaceVaultFileSystem
- Returns:
- the workspace filter
-
-