Package com.logicaldoc.util.config
Class ContextProperties
java.lang.Object
java.util.Dictionary<Object,Object>
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
ConstructorsConstructorDescriptionContextProperties(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 TypeMethodDescriptionbooleanbooleangetBoolean(String property) booleangetBoolean(String property, boolean defaultValue) doubledoublefloatfloatintintlonglongintgetProperties(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) Gets the property value replacing all variable referencesgetTenantProperties(String tenant) getTenantProperty(String tenant, String property) inthashCode()voidremoveTenantProperties(String tenant) Removes all the properties of a specific tenantvoidreplicateTenantSettings(String tenant) Replicates the settings of the default tenant to a new tenantvoidsetMaxBackups(int maxBackups) setProperty(String key, String value) voidwrite()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, storeMethods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, forEach, get, getOrDefault, isEmpty, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, save, 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
-
setProperty
- Overrides:
setPropertyin classProperties
-
getProperty
Gets the property value replacing all variable references- Overrides:
getPropertyin classProperties- Parameters:
property- name of the setting to process- Returns:
- the porperty's value with expanded variables
-
getProperty
Gets the property value replacing all variable references- Overrides:
getPropertyin classProperties- Parameters:
property- name of the setting to processdefaultValue- default value returned in case of absence of property- Returns:
- the porperty's value with expanded variables
-
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
-
equals
-
hashCode
public int hashCode()
-