Package com.logicaldoc.util.config
Class ContextProperties
java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
com.logicaldoc.util.config.OrderedProperties
com.logicaldoc.util.config.ContextProperties
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
Object>
A configuration utility used to retrieve and alter context properties
- Since:
- 3.0
- Author:
- Marco Meschieri - LogicalDOC
- See Also:
-
Constructor Summary
ConstructorDescriptionContextProperties
(int maxBackups) ContextProperties
(File file) Creates new XMLBean from an input stream; XMLBean is read-only!!!ContextProperties
(String filePath) ContextProperties
(URL fileUrl) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getBoolean
(String property) boolean
getBoolean
(String property, boolean defaultValue) double
double
float
float
int
int
long
long
int
getProperties
(String prefix) Gets all the properties whose name starts with the given prefix.getProperty
(String property) Gets the property value replacing all variable referencesgetProperty
(String property, String defaultValue) getTenantProperties
(String tenant) getTenantProperty
(String tenant, String property) void
removeTenantProperties
(String tenant) Removes all the properties of a specific tenantvoid
replicateTenantSettings
(String tenant) Replicates the settings of the default tenant to a new tenantvoid
setMaxBackups
(int maxBackups) void
write()
This method saves the properties-file connected by ContextProperties.
NOTE: only call this on an ContextProperties _NOT_ created from an InputStream!Methods inherited from class com.logicaldoc.util.config.OrderedProperties
getKeys, keys, store
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
Constructor Details
-
ContextProperties
- Throws:
IOException
-
ContextProperties
- Throws:
IOException
-
ContextProperties
- Throws:
IOException
-
ContextProperties
- Throws:
IOException
-
ContextProperties
- Throws:
IOException
-
ContextProperties
Creates new XMLBean from an input stream; XMLBean is read-only!!!- Parameters:
is
- the stream that represents the XML to parse- Throws:
IOException
- raised when the stream cannot be read
-
-
Method Details
-
write
This method saves the properties-file connected by ContextProperties.
NOTE: only call this on an ContextProperties _NOT_ created from an InputStream!- Throws:
IOException
- raised when the file cannot be written
-
getBackups
- Throws:
IOException
-
getString
-
getString
-
getInt
-
getInt
-
getLong
-
getLong
-
getBoolean
-
getBoolean
-
getDouble
-
getDouble
-
getFloat
-
getFloat
-
getProperty
Gets the property value replacing all variable references- Overrides:
getProperty
in classProperties
- Parameters:
property
- name of the setting to process- Returns:
- the porperty's value with expanded variables
-
getProperty
- Overrides:
getProperty
in classProperties
-
getMaxBackups
public int getMaxBackups() -
setMaxBackups
public void setMaxBackups(int maxBackups) -
getTenantProperty
-
getTenantProperties
-
getProperties
Gets all the properties whose name starts with the given prefix.- Parameters:
prefix
- property's prefix- Returns:
- the map property_name = property_value
-
removeTenantProperties
Removes all the properties of a specific tenant- Parameters:
tenant
- name of the tenant
-
replicateTenantSettings
Replicates the settings of the default tenant to a new tenant- Parameters:
tenant
- name of the tenant
-