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 SummaryConstructorsConstructorDescriptionContextProperties(int maxBackups) ContextProperties(File file) Creates new XMLBean from an input stream; XMLBean is read-only!!!ContextProperties(String filePath) ContextProperties(URL fileUrl) 
- 
Method SummaryModifier 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.OrderedPropertiesgetKeys, keys, storeMethods inherited from class java.util.Propertiesclear, 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
 
- 
ContextPropertiesCreates 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- 
writeThis 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 class- Properties
 
- 
getPropertyGets the property value replacing all variable references- Overrides:
- getPropertyin class- Properties
- Parameters:
- property- name of the setting to process
- Returns:
- the porperty's value with expanded variables
 
- 
getPropertyGets the property value replacing all variable references- Overrides:
- getPropertyin class- Properties
- Parameters:
- property- name of the setting to process
- defaultValue- default value returned in case of absence of property
- Returns:
- the porperty's value with expanded variables
 
- 
getMaxBackupspublic int getMaxBackups()
- 
setMaxBackupspublic void setMaxBackups(int maxBackups) 
- 
getTenantProperty
- 
getTenantProperties
- 
getPropertiesGets all the properties whose name starts with the given prefix.- Parameters:
- prefix- property's prefix
- Returns:
- the map property_name = property_value
 
- 
removeTenantPropertiesRemoves all the properties of a specific tenant- Parameters:
- tenant- name of the tenant
 
- 
replicateTenantSettingsReplicates the settings of the default tenant to a new tenant- Parameters:
- tenant- name of the tenant
 
- 
equals
- 
hashCodepublic int hashCode()
 
-