Package org.dspace.servicemanager.config
Class DSpaceEnvironmentConfiguration
- java.lang.Object
-
- org.apache.commons.configuration2.event.BaseEventSource
-
- org.apache.commons.configuration2.AbstractConfiguration
-
- org.apache.commons.configuration2.MapConfiguration
-
- org.dspace.servicemanager.config.DSpaceEnvironmentConfiguration
-
- All Implemented Interfaces:
Cloneable
,org.apache.commons.configuration2.Configuration
,org.apache.commons.configuration2.event.EventSource
,org.apache.commons.configuration2.ImmutableConfiguration
,org.apache.commons.configuration2.sync.SynchronizerSupport
public class DSpaceEnvironmentConfiguration extends org.apache.commons.configuration2.MapConfiguration
Bash does not allow environment variables that contain dots in their name. This Configuration loads environment variables that contains two underlines and replaces "__P__" -> "." and "__D__" -> "-" E.g.: dspace__P__dir will be read as dspace.dir. E.g.: my__D__dspace__P__prop will be read as my-dspace.prop. Most of this file was copied from org.apache.commons.configuration2.EnvironmentConfiguration.- Author:
- Pascal-Nicolas Becker -- dspace at pascal dash becker dot de
-
-
Constructor Summary
Constructors Constructor Description DSpaceEnvironmentConfiguration()
Create a Configuration based on the environment variables.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addPropertyDirect(String key, Object value)
Adds a property to this configuration.protected void
clearInternal()
Removes all properties from this configuration.protected void
clearPropertyDirect(String key)
Removes a property from this configuration.static Map<String,Object>
getModifiedEnvMap()
-
Methods inherited from class org.apache.commons.configuration2.MapConfiguration
clone, containsKeyInternal, getKeysInternal, getMap, getPropertyInternal, isEmptyInternal, isTrimmingDisabled, setTrimmingDisabled, sizeInternal, toString
-
Methods inherited from class org.apache.commons.configuration2.AbstractConfiguration
addErrorLogListener, addProperty, addPropertyInternal, append, beginRead, beginWrite, clear, clearProperty, cloneInterpolator, containsKey, copy, endRead, endWrite, get, get, getArray, getArray, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCollection, getCollection, getConfigurationDecoder, getConversionHandler, getDouble, getDouble, getDouble, getEncodedString, getEncodedString, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getKeys, getKeys, getKeysInternal, getList, getList, getList, getList, getListDelimiterHandler, getLogger, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, getSynchronizer, immutableSubset, initLogger, installInterpolator, interpolate, interpolate, interpolatedConfiguration, isEmpty, isScalarValue, isThrowExceptionOnMissing, lock, setConfigurationDecoder, setConversionHandler, setDefaultLookups, setInterpolator, setListDelimiterHandler, setLogger, setParentInterpolator, setPrefixLookups, setProperty, setPropertyInternal, setSynchronizer, setThrowExceptionOnMissing, size, subset, unlock
-
Methods inherited from class org.apache.commons.configuration2.event.BaseEventSource
addEventListener, clearErrorListeners, clearEventListeners, copyEventListeners, createErrorEvent, createEvent, fireError, fireEvent, getEventListenerRegistrations, getEventListeners, isDetailEvents, removeEventListener, setDetailEvents
-
-
-
-
Constructor Detail
-
DSpaceEnvironmentConfiguration
public DSpaceEnvironmentConfiguration()
Create a Configuration based on the environment variables.- See Also:
System.getenv()
-
-
Method Detail
-
addPropertyDirect
protected void addPropertyDirect(String key, Object value)
Adds a property to this configuration. Because this configuration is read-only, this operation is not allowed and will cause an exception.- Overrides:
addPropertyDirect
in classorg.apache.commons.configuration2.MapConfiguration
- Parameters:
key
- the key of the property to be addedvalue
- the property value
-
clearPropertyDirect
protected void clearPropertyDirect(String key)
Removes a property from this configuration. Because this configuration is read-only, this operation is not allowed and will cause an exception.- Overrides:
clearPropertyDirect
in classorg.apache.commons.configuration2.MapConfiguration
- Parameters:
key
- the key of the property to be removed
-
clearInternal
protected void clearInternal()
Removes all properties from this configuration. Because this configuration is read-only, this operation is not allowed and will cause an exception.- Overrides:
clearInternal
in classorg.apache.commons.configuration2.AbstractConfiguration
-
-