Class ContextProperties

All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public class ContextProperties extends OrderedProperties
A configuration utility used to retrieve and alter context properties
Since:
3.0
Author:
Marco Meschieri - LogicalDOC
See Also:
  • Constructor Details

  • Method Details

    • write

      public void write() throws IOException
      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

      public List<File> getBackups() throws IOException
      Throws:
      IOException
    • getString

      public String getString(String property)
    • getString

      public String getString(String property, String defaultValue)
    • getInt

      public int getInt(String property)
    • getInt

      public int getInt(String property, int defaultValue)
    • getLong

      public long getLong(String property)
    • getLong

      public long getLong(String property, long defaultValue)
    • getBoolean

      public boolean getBoolean(String property)
    • getBoolean

      public boolean getBoolean(String property, boolean defaultValue)
    • getDouble

      public double getDouble(String property)
    • getDouble

      public double getDouble(String property, double defaultValue)
    • getFloat

      public float getFloat(String property)
    • getFloat

      public float getFloat(String property, float defaultValue)
    • getProperty

      public String getProperty(String property)
      Gets the property value replacing all variable references
      Overrides:
      getProperty in class Properties
      Parameters:
      property - name of the setting to process
      Returns:
      the porperty's value with expanded variables
    • getProperty

      public String getProperty(String property, String defaultValue)
      Overrides:
      getProperty in class Properties
    • getMaxBackups

      public int getMaxBackups()
    • setMaxBackups

      public void setMaxBackups(int maxBackups)
    • getTenantProperty

      public String getTenantProperty(String tenant, String property)
    • getTenantProperties

      public Map<String,String> getTenantProperties(String tenant)
    • getProperties

      public Map<String,String> getProperties(String prefix)
      Gets all the properties whose name starts with the given prefix.
      Parameters:
      prefix - property's prefix
      Returns:
      the map property_name = property_value
    • removeTenantProperties

      public void removeTenantProperties(String tenant)
      Removes all the properties of a specific tenant
      Parameters:
      tenant - name of the tenant
    • replicateTenantSettings

      public void replicateTenantSettings(String tenant)
      Replicates the settings of the default tenant to a new tenant
      Parameters:
      tenant - name of the tenant