Class ConfigurationManager


  • public class ConfigurationManager
    extends Object
    Deprecated.
    Please use org.dspace.services.ConfigurationService. See examples below.
    Class for reading the DSpace system configuration. The main configuration is read in as properties from a standard properties file.

    To specify a different configuration, the system property dspace.dir should be set to the DSpace installation directory.

    Other configuration files are read from the config directory of the DSpace installation directory.

    Version:
    $Revision$
    Author:
    Robert Tansley, Larry Stone - Interpolated values., Mark Diggory - General Improvements to detection, logging and loading., Tim Donohue - Refactored to wrap ConfigurationService
    • Constructor Detail

      • ConfigurationManager

        protected ConfigurationManager()
        Deprecated.
    • Method Detail

      • isConfigured

        public static boolean isConfigured()
        Deprecated.
        Identify if DSpace is properly configured
        Returns:
        boolean true if configured, false otherwise
      • getProperties

        public static Properties getProperties()
        Deprecated.
        Returns all properties in main configuration
        Returns:
        properties - all non-modular properties
      • getProperties

        public static Properties getProperties​(String module)
        Deprecated.
        Returns all properties for a given module
        Parameters:
        module - the name of the module
        Returns:
        properties - all module's properties
      • getProperty

        public static String getProperty​(String property)
        Deprecated.
        Get a configuration property
        Parameters:
        property - the name of the property
        Returns:
        the value of the property, or null if the property does not exist.
      • getProperty

        public static String getProperty​(String module,
                                         String property)
        Deprecated.
        Get a module configuration property value.
        Parameters:
        module - the name of the module, or null for regular configuration property
        property - the name (key) of the property
        Returns:
        the value of the property, or null if the property does not exist
      • getIntProperty

        public static int getIntProperty​(String property)
        Deprecated.
        Get a configuration property as an integer
        Parameters:
        property - the name of the property
        Returns:
        the value of the property. 0 is returned if the property does not exist. To differentiate between this case and when the property actually is zero, use getProperty.
      • getIntProperty

        public static int getIntProperty​(String module,
                                         String property)
        Deprecated.
        Get a module configuration property as an integer
        Parameters:
        module - the name of the module
        property - the name of the property
        Returns:
        the value of the property. 0 is returned if the property does not exist. To differentiate between this case and when the property actually is zero, use getProperty.
      • getIntProperty

        public static int getIntProperty​(String property,
                                         int defaultValue)
        Deprecated.
        Get a configuration property as an integer, with default
        Parameters:
        property - the name of the property
        defaultValue - value to return if property is not found or is not an Integer.
        Returns:
        the value of the property. default is returned if the property does not exist or is not an Integer. To differentiate between this case and when the property actually is false, use getProperty.
      • getIntProperty

        public static int getIntProperty​(String module,
                                         String property,
                                         int defaultValue)
        Deprecated.
        Get a module configuration property as an integer, with default
        Parameters:
        module - the name of the module
        property - the name of the property
        defaultValue - value to return if property is not found or is not an Integer.
        Returns:
        the value of the property. default is returned if the property does not exist or is not an Integer. To differentiate between this case and when the property actually is false, use getProperty.
      • getLongProperty

        public static long getLongProperty​(String property)
        Deprecated.
        Get a configuration property as a long
        Parameters:
        property - the name of the property
        Returns:
        the value of the property. 0 is returned if the property does not exist. To differentiate between this case and when the property actually is zero, use getProperty.
      • getLongProperty

        public static long getLongProperty​(String module,
                                           String property)
        Deprecated.
        Get a module configuration property as a long
        Parameters:
        module - the name of the module
        property - the name of the property
        Returns:
        the value of the property. 0 is returned if the property does not exist. To differentiate between this case and when the property actually is zero, use getProperty.
      • getLongProperty

        public static long getLongProperty​(String property,
                                           int defaultValue)
        Deprecated.
        Get a configuration property as an long, with default
        Parameters:
        property - the name of the property
        defaultValue - value to return if property is not found or is not a Long.
        Returns:
        the value of the property. default is returned if the property does not exist or is not an Integer. To differentiate between this case and when the property actually is false, use getProperty.
      • getLongProperty

        public static long getLongProperty​(String module,
                                           String property,
                                           int defaultValue)
        Deprecated.
        Get a configuration property as an long, with default
        Parameters:
        module - the module, or null for regular property
        property - the name of the property
        defaultValue - value to return if property is not found or is not a Long.
        Returns:
        the value of the property. default is returned if the property does not exist or is not an Integer. To differentiate between this case and when the property actually is false, use getProperty.
      • getBooleanProperty

        public static boolean getBooleanProperty​(String property)
        Deprecated.
        Get a configuration property as a boolean. True is indicated if the value of the property is TRUE or YES (case insensitive.)
        Parameters:
        property - the name of the property
        Returns:
        the value of the property. false is returned if the property does not exist. To differentiate between this case and when the property actually is false, use getProperty.
      • getBooleanProperty

        public static boolean getBooleanProperty​(String module,
                                                 String property)
        Deprecated.
        Get a module configuration property as a boolean. True is indicated if the value of the property is TRUE or YES (case insensitive.)
        Parameters:
        module - the module, or null for regular property
        property - the name of the property
        Returns:
        the value of the property. false is returned if the property does not exist. To differentiate between this case and when the property actually is false, use getProperty.
      • getBooleanProperty

        public static boolean getBooleanProperty​(String property,
                                                 boolean defaultValue)
        Deprecated.
        Get a configuration property as a boolean, with default. True is indicated if the value of the property is TRUE or YES (case insensitive.)
        Parameters:
        property - the name of the property
        defaultValue - value to return if property is not found.
        Returns:
        the value of the property. default is returned if the property does not exist. To differentiate between this case and when the property actually is false, use getProperty.
      • getBooleanProperty

        public static boolean getBooleanProperty​(String module,
                                                 String property,
                                                 boolean defaultValue)
        Deprecated.
        Get a module configuration property as a boolean, with default. True is indicated if the value of the property is TRUE or YES (case insensitive.)
        Parameters:
        module - module, or null for regular property
        property - the name of the property
        defaultValue - value to return if property is not found.
        Returns:
        the value of the property. default is returned if the property does not exist. To differentiate between this case and when the property actually is false, use getProperty.
      • propertyNames

        public static Enumeration<?> propertyNames()
        Deprecated.
        Returns an enumeration of all the keys in the DSpace configuration

        As ConfigurationManager is now deprecated, older code using this method should consider using ConfigurationService.getPropertyKeys() directly.

        Returns:
        an enumeration of all the keys in the DSpace configuration
      • propertyNames

        public static Enumeration<?> propertyNames​(String module)
        Deprecated.
        Returns an enumeration of all the keys in a module configuration

        As ConfigurationManager is now deprecated, older code using this method should consider using ConfigurationService.getPropertyKeys(String prefix) directly.

        Parameters:
        module - module, or null for regular property
        Returns:
        an enumeration of all the keys in the module configuration, or null if the module does not exist.