Package io.goobi.viewer.controller
Class AbstractConfiguration
java.lang.Object
io.goobi.viewer.controller.AbstractConfiguration
- Direct Known Subclasses:
Configuration
Abstract configuration with base getters.
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder<org.apache.commons.configuration2.XMLConfiguration>
protected org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder<org.apache.commons.configuration2.XMLConfiguration>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.commons.configuration2.XMLConfiguration
protected org.apache.commons.configuration2.XMLConfiguration
protected boolean
getLocalBoolean
(String inPath, boolean inDefault) getLocalBoolean.protected org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>
getLocalConfigurationAt
(String inPath) getLocalConfigurationAt.protected List<org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>>
getLocalConfigurationsAt
(String inPath) getLocalConfigurationsAt.protected static List<org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>>
getLocalConfigurationsAt
(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config, org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> altConfig, String inPath) protected float
getLocalFloat
(String inPath) getLocalFloat.protected float
getLocalFloat
(String inPath, float inDefault) getLocalFloat.protected int
getLocalInt
(String inPath, int inDefault) getLocalInt.getLocalList
(String inPath) getLocalList.getLocalList
(String inPath, List<String> defaultList) getLocalList.getLocalList
(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config, org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> altConfig, String inPath, List<String> defaultList) getLocalList.getLocalNodeList
(String inPath) getLocalNodeList.protected String
getLocalString
(String inPath) getLocalString.protected String
getLocalString
(String inPath, String inDefault) getLocalString.void
overrideValue
(String property, Object value) Overrides values in the config file (for unit test purposes).
-
Field Details
-
builder
protected org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder<org.apache.commons.configuration2.XMLConfiguration> builder -
builderLocal
protected org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder<org.apache.commons.configuration2.XMLConfiguration> builderLocal
-
-
Constructor Details
-
AbstractConfiguration
public AbstractConfiguration()
-
-
Method Details
-
getConfig
protected org.apache.commons.configuration2.XMLConfiguration getConfig()- Returns:
XMLConfiguration
that is synced with the current state of the config file
-
getConfigLocal
protected org.apache.commons.configuration2.XMLConfiguration getConfigLocal()- Returns:
XMLConfiguration
that is synced with the current state of the config file
-
getLocalInt
getLocalInt.
- Parameters:
inPath
- aString
object.inDefault
- a int.- Returns:
- a int.
-
getLocalFloat
getLocalFloat.
- Parameters:
inPath
- aString
object.- Returns:
- a float.
-
getLocalFloat
getLocalFloat.
- Parameters:
inPath
- aString
object.inDefault
- a float.- Returns:
- a float.
-
getLocalString
getLocalString.
-
getLocalString
getLocalString.
-
getLocalNodeList
getLocalNodeList.
-
getLocalList
protected static List<String> getLocalList(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config, org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> altConfig, String inPath, List<String> defaultList) getLocalList.
- Parameters:
config
- Preferred configurationaltConfig
- Alternative configurationinPath
- XML pathdefaultList
- List of default values to return if none found in config- Returns:
- a
List
object.
-
getLocalList
getLocalList.
-
getLocalList
getLocalList.
- Parameters:
inPath
- aString
object.- Returns:
- configured list; empty list if none found
-
getLocalBoolean
getLocalBoolean.
- Parameters:
inPath
- aString
object.inDefault
- a boolean.- Returns:
- a boolean.
-
getLocalConfigurationsAt
protected static List<org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>> getLocalConfigurationsAt(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config, org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> altConfig, String inPath) - Parameters:
config
-altConfig
-inPath
-- Returns:
- List<HierarchicalConfiguration<ImmutableNode>>
-
getLocalConfigurationsAt
protected List<org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>> getLocalConfigurationsAt(String inPath) getLocalConfigurationsAt.
-
getLocalConfigurationAt
protected org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> getLocalConfigurationAt(String inPath) getLocalConfigurationAt.
- Parameters:
inPath
- aString
object.- Returns:
- a
HierarchicalConfiguration
object.
-
overrideValue
Overrides values in the config file (for unit test purposes).- Parameters:
property
- Property path (e.g. "accessConditions.fullAccessForLocalhost")value
- New value to set
-