Interface MetaDirectory
-
public interface MetaDirectory
Provides an abstraction of a virtual directory that holds additional information about the files under vault control.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Synchronizes and closes this meta directory.void
create(String path)
Creates the internal structures for this meta directory and initializes it with the given path.void
delete()
Deletes the internal structures of this meta directoryboolean
exists()
Checks if this meta directory already exists on the filesystem.MetaFile
getBaseFile(String name, boolean create)
Returns a file from the internal base storage of this directory.VltEntries
getEntries()
Returns the entries that are recorded in this meta directoryFile
getFile()
Returns the underlying system file or directory.MetaFile
getFile(String name)
Returns a file of this meta directory.MetaFile
getFile(String name, boolean create)
Returns a file of this meta directory.String
getRepositoryUrl()
Returns the repository url defined for this meta directory.MetaFile
getTmpFile(String name, boolean create)
Returns a file from the internal temporary storage of this directory.boolean
hasFile(String name)
Checks if the file with the given name exists.void
setRepositoryUrl(String url)
Sets the repository url define for this meta directoryvoid
sync()
Synchronizes any internal changes to this meta directory with the underlying structures.
-
-
-
Method Detail
-
getFile
File getFile()
Returns the underlying system file or directory.- Returns:
- the system file.
-
exists
boolean exists()
Checks if this meta directory already exists on the filesystem.- Returns:
true
if this meta directory exists.
-
create
void create(String path) throws IOException
Creates the internal structures for this meta directory and initializes it with the given path.- Parameters:
path
- the platform path relative to the jcr_root of this meta directory.- Throws:
IOException
- if an I/O error occurs
-
delete
void delete() throws IOException
Deletes the internal structures of this meta directory- Throws:
IOException
- if an I/O error occurs
-
sync
void sync() throws IOException
Synchronizes any internal changes to this meta directory with the underlying structures.- Throws:
IOException
- if an I/O error occurs
-
close
void close() throws IOException
Synchronizes and closes this meta directory.- Throws:
IOException
- if an I/O error occurs
-
getRepositoryUrl
String getRepositoryUrl() throws IOException
Returns the repository url defined for this meta directory.- Returns:
- the url or
null
if not defined. - Throws:
IOException
- if an I/O error occurs
-
setRepositoryUrl
void setRepositoryUrl(String url) throws IOException
Sets the repository url define for this meta directory- Parameters:
url
- the url- Throws:
IOException
- if an I/O error occurs
-
getEntries
VltEntries getEntries() throws VltException
Returns the entries that are recorded in this meta directory- Returns:
- the entries.
- Throws:
VltException
- if an error during reading of the entries occurrs.
-
getFile
MetaFile getFile(String name) throws IOException
Returns a file of this meta directory.- Parameters:
name
- name of the file- Returns:
- the file or
null
if not found - Throws:
IOException
- if an I/O error occurs
-
getFile
MetaFile getFile(String name, boolean create) throws IOException
Returns a file of this meta directory.- Parameters:
name
- name of the filecreate
- iftrue
a new file will be created if not exists.- Returns:
- the file or
null
if not found and create isfalse
. - Throws:
IOException
- if an I/O error occurs
-
getTmpFile
MetaFile getTmpFile(String name, boolean create) throws IOException
Returns a file from the internal temporary storage of this directory.- Parameters:
name
- name of the file.create
- iftrue
a new file will be created if not exists.- Returns:
- the file or
null
if not found and create isfalse
. - Throws:
IOException
- if an I/O error occurs
-
getBaseFile
MetaFile getBaseFile(String name, boolean create) throws IOException
Returns a file from the internal base storage of this directory.- Parameters:
name
- name of the file.create
- iftrue
a new file will be created if not exists.- Returns:
- the file or
null
if not found and create isfalse
. - Throws:
IOException
- if an I/O error occurs
-
hasFile
boolean hasFile(String name) throws IOException
Checks if the file with the given name exists.- Parameters:
name
- name of the file.- Returns:
true
if the file exists.- Throws:
IOException
- if an I/O error occurs
-
-