Class DefaultMetaInf
- java.lang.Object
-
- org.apache.jackrabbit.vault.fs.config.DefaultMetaInf
-
- All Implemented Interfaces:
MetaInf
- Direct Known Subclasses:
JcrPackageDefinitionMetaInf
public class DefaultMetaInf extends Object implements MetaInf
Abstracts the way of accessing the vault specific meta-info of a checkout.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.vault.fs.config.MetaInf
CREATED, CREATED_BY, FORMAT_VERSION_1, FORMAT_VERSION_2, GENERATOR, PACKAGE_FORMAT_VERSION
-
-
Constructor Summary
Constructors Constructor Description DefaultMetaInf()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VaultFsConfig
getConfig()
Returns the vault config.WorkspaceFilter
getFilter()
Returns the workspace filter.Collection<NodeTypeSet>
getNodeTypes()
Returns the node types.int
getPackageFormatVersion()
Returns the package format version of this package.PackageProperties
getPackageProperties()
Returns the package properties.PrivilegeDefinitions
getPrivileges()
Returns custom privileges defined in the meta inf.Properties
getProperties()
Returns the properties.VaultSettings
getSettings()
Returns the vault settings.boolean
hasDefinition()
Checks if the meta-inf contains a serialized definition.boolean
load(@Nullable InputStream in, @NotNull String systemId)
Loads a setting based on the name of the system id.protected void
loadCNDs(@NotNull File metaDir)
protected void
loadConfig(@NotNull File metaDir)
void
loadConfig(@NotNull InputStream in, @NotNull String systemId)
The specified stream remains open after this method returns.protected void
loadFilter(@NotNull File metaDir, boolean vltMode)
void
loadFilter(@NotNull InputStream in, @NotNull String systemId)
The specified stream remains open after this method returns.protected void
loadPrivileges(@NotNull File metaDir)
void
loadPrivileges(@NotNull InputStream in, @NotNull String systemId)
The specified stream remains open after this method returns.protected void
loadProperties(@NotNull File metaDir)
void
loadProperties(@NotNull InputStream in, @NotNull String systemId)
The specified stream remains open after this method returns.protected void
loadSettings(@NotNull File metaDir)
void
loadSettings(@NotNull InputStream in, @NotNull String systemId)
void
save(@NotNull File metaDir)
protected void
saveConfig(@NotNull File metaDir)
protected void
saveFilter(@NotNull File metaDir)
protected void
saveProperties(@NotNull File metaDir)
protected void
saveSettings(@NotNull File metaDir)
void
setCNDs(Collection<NodeTypeSet> cnds)
void
setConfig(VaultFsConfig config)
void
setFilter(WorkspaceFilter filter)
void
setHasDefinition(boolean hasDefinition)
void
setProperties(Properties properties)
void
setSettings(VaultSettings settings)
-
-
-
Method Detail
-
getPackageFormatVersion
public int getPackageFormatVersion()
Returns the package format version of this package. If the package lacks this information,MetaInf.FORMAT_VERSION_2
is returned, since this feature was implemented recently.- Specified by:
getPackageFormatVersion
in interfaceMetaInf
- Returns:
- the package format version
- Since:
- 2.0
-
load
public boolean load(@Nullable @Nullable InputStream in, @NotNull @NotNull String systemId) throws IOException, ConfigurationException
Loads a setting based on the name of the system id.The specified stream remains open after this method returns.
- Parameters:
systemId
- the system id of the setting to loadin
- the input stream- Returns:
true
if the setting was loaded.- Throws:
IOException
- if an I/O error occurrsConfigurationException
- if a configuration error occurrs- Since:
- 3.1.32
-
loadFilter
public void loadFilter(@NotNull @NotNull InputStream in, @NotNull @NotNull String systemId) throws ConfigurationException, IOException
The specified stream remains open after this method returns.
- Parameters:
in
-systemId
-- Throws:
ConfigurationException
IOException
-
loadConfig
public void loadConfig(@NotNull @NotNull InputStream in, @NotNull @NotNull String systemId) throws ConfigurationException, IOException
The specified stream remains open after this method returns.
- Parameters:
in
-systemId
-- Throws:
ConfigurationException
IOException
-
loadSettings
public void loadSettings(@NotNull @NotNull InputStream in, @NotNull @NotNull String systemId) throws ConfigurationException, IOException
- Throws:
ConfigurationException
IOException
-
loadProperties
public void loadProperties(@NotNull @NotNull InputStream in, @NotNull @NotNull String systemId) throws IOException
The specified stream remains open after this method returns.
- Parameters:
in
-systemId
-- Throws:
IOException
-
loadPrivileges
public void loadPrivileges(@NotNull @NotNull InputStream in, @NotNull @NotNull String systemId) throws IOException
The specified stream remains open after this method returns.
- Parameters:
in
-systemId
-- Throws:
IOException
-
save
public void save(@NotNull @NotNull File metaDir) throws IOException
- Throws:
IOException
-
getSettings
public VaultSettings getSettings()
Returns the vault settings.- Specified by:
getSettings
in interfaceMetaInf
- Returns:
- the vault settings
-
setSettings
public void setSettings(VaultSettings settings)
-
getFilter
public WorkspaceFilter getFilter()
Returns the workspace filter.
-
setFilter
public void setFilter(WorkspaceFilter filter)
-
getConfig
public VaultFsConfig getConfig()
Returns the vault config.
-
setConfig
public void setConfig(VaultFsConfig config)
-
getProperties
public Properties getProperties()
Returns the properties.- Specified by:
getProperties
in interfaceMetaInf
- Returns:
- the properties
-
setProperties
public void setProperties(Properties properties)
-
getNodeTypes
public Collection<NodeTypeSet> getNodeTypes()
Returns the node types.- Specified by:
getNodeTypes
in interfaceMetaInf
- Returns:
- the node types
-
getPrivileges
public PrivilegeDefinitions getPrivileges()
Returns custom privileges defined in the meta inf.- Specified by:
getPrivileges
in interfaceMetaInf
- Returns:
- a collection of custom privileges
-
setCNDs
public void setCNDs(Collection<NodeTypeSet> cnds)
-
hasDefinition
public boolean hasDefinition()
Checks if the meta-inf contains a serialized definition.- Specified by:
hasDefinition
in interfaceMetaInf
- Returns:
true
if it contains a serialized definition
-
setHasDefinition
public void setHasDefinition(boolean hasDefinition)
-
loadSettings
protected void loadSettings(@NotNull @NotNull File metaDir) throws ConfigurationException, IOException
- Throws:
ConfigurationException
IOException
-
saveSettings
protected void saveSettings(@NotNull @NotNull File metaDir) throws IOException
- Throws:
IOException
-
loadConfig
protected void loadConfig(@NotNull @NotNull File metaDir) throws ConfigurationException, IOException
- Throws:
ConfigurationException
IOException
-
saveConfig
protected void saveConfig(@NotNull @NotNull File metaDir) throws IOException
- Throws:
IOException
-
loadFilter
protected void loadFilter(@NotNull @NotNull File metaDir, boolean vltMode) throws ConfigurationException, IOException
- Throws:
ConfigurationException
IOException
-
saveFilter
protected void saveFilter(@NotNull @NotNull File metaDir) throws IOException
- Throws:
IOException
-
loadProperties
protected void loadProperties(@NotNull @NotNull File metaDir) throws IOException
- Throws:
IOException
-
saveProperties
protected void saveProperties(@NotNull @NotNull File metaDir) throws IOException
- Throws:
IOException
-
loadPrivileges
protected void loadPrivileges(@NotNull @NotNull File metaDir) throws IOException
- Throws:
IOException
-
loadCNDs
protected void loadCNDs(@NotNull @NotNull File metaDir) throws IOException
- Throws:
IOException
-
getPackageProperties
public PackageProperties getPackageProperties()
Description copied from interface:MetaInf
Returns the package properties.- Specified by:
getPackageProperties
in interfaceMetaInf
- Returns:
- the package properties
-
-