public class ConfigurationManager
extends java.lang.Object
The main configuration is by default read from the resource
/dspace.cfg.
To specify a different configuration, the system property
dspace.configuration should be set to the filename
of the configuration file.
Other configuration files are read from the config directory
of the DSpace installation directory (specified as the property
dspace.dir in the main configuration file.)
| Modifier | Constructor and Description |
|---|---|
protected |
ConfigurationManager() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getBooleanProperty(java.lang.String property)
Get a configuration property as a boolean.
|
static boolean |
getBooleanProperty(java.lang.String property,
boolean defaultValue)
Get a configuration property as a boolean, with default.
|
static boolean |
getBooleanProperty(java.lang.String module,
java.lang.String property)
Get a module configuration property as a boolean.
|
static boolean |
getBooleanProperty(java.lang.String module,
java.lang.String property,
boolean defaultValue)
Get a module configuration property as a boolean, with default.
|
protected static java.io.File |
getConfigurationFile()
Deprecated.
Please remove all direct usage of the configuration file.
|
static java.lang.String |
getDefaultSubmissionLicense()
Deprecated.
since 4.0
|
static int |
getIntProperty(java.lang.String property)
Get a configuration property as an integer
|
static int |
getIntProperty(java.lang.String property,
int defaultValue)
Get a configuration property as an integer, with default
|
static int |
getIntProperty(java.lang.String module,
java.lang.String property)
Get a module configuration property as an integer
|
static int |
getIntProperty(java.lang.String module,
java.lang.String property,
int defaultValue)
Get a module configuration property as an integer, with default
|
static java.lang.String |
getLicenseText(java.lang.String licenseFile)
Deprecated.
since 4.0
|
static long |
getLongProperty(java.lang.String property)
Get a configuration property as a long
|
static long |
getLongProperty(java.lang.String property,
int defaultValue)
Get a configuration property as an long, with default
|
static long |
getLongProperty(java.lang.String module,
java.lang.String property)
Get a module configuration property as a long
|
static long |
getLongProperty(java.lang.String module,
java.lang.String property,
int defaultValue)
Get a configuration property as an long, with default
|
static java.lang.String |
getNewsFilePath()
Deprecated.
since 4.0
|
static java.util.Properties |
getProperties()
Returns all properties in main configuration
|
static java.util.Properties |
getProperties(java.lang.String module)
Returns all properties for a given module
|
static java.lang.String |
getProperty(java.lang.String property)
Get a configuration property
|
static java.lang.String |
getProperty(java.lang.String module,
java.lang.String property)
Get a module configuration property value.
|
static boolean |
isConfigured()
Identify if DSpace is properly configured
|
static boolean |
isConfigured(java.lang.String module) |
static void |
loadConfig(java.lang.String configFile)
Load the DSpace configuration properties.
|
static void |
main(java.lang.String[] argv)
Command-line interface for running configuration tasks.
|
static java.util.Enumeration<?> |
propertyNames()
Returns an enumeration of all the keys in the DSpace configuration
|
static java.util.Enumeration<?> |
propertyNames(java.lang.String module)
Returns an enumeration of all the keys in a module configuration
|
static java.lang.String |
readNewsFile(java.lang.String name)
Deprecated.
since 4.0
|
static void |
writeLicenseFile(java.lang.String licenseFile,
java.lang.String newLicense)
Deprecated.
since 4.0
|
static java.lang.String |
writeNewsFile(java.lang.String file,
java.lang.String news)
Deprecated.
since 4.0
|
public static boolean isConfigured()
public static boolean isConfigured(java.lang.String module)
public static java.util.Properties getProperties()
public static java.util.Properties getProperties(java.lang.String module)
module - the name of the modulepublic static java.lang.String getProperty(java.lang.String property)
property - the name of the propertynull if the property
does not exist.public static java.lang.String getProperty(java.lang.String module,
java.lang.String property)
module - the name of the module, or null for regular configuration
propertyproperty - the name (key) of the propertynull if the
property does not existpublic static int getIntProperty(java.lang.String property)
property - the name of the property0 is returned if the
property does not exist. To differentiate between this case and
when the property actually is zero, use getProperty.public static int getIntProperty(java.lang.String module,
java.lang.String property)
module - the name of the moduleproperty - the name of the property0 is returned if the
property does not exist. To differentiate between this case and
when the property actually is zero, use getProperty.public static int getIntProperty(java.lang.String property,
int defaultValue)
property - the name of the propertydefaultValue - value to return if property is not found or is not an Integer.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.public static int getIntProperty(java.lang.String module,
java.lang.String property,
int defaultValue)
module - the name of the moduleproperty - the name of the propertydefaultValue - value to return if property is not found or is not an Integer.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.public static long getLongProperty(java.lang.String property)
property - the name of the property0 is returned if the
property does not exist. To differentiate between this case and
when the property actually is zero, use getProperty.public static long getLongProperty(java.lang.String module,
java.lang.String property)
module - the name of the moduleproperty - the name of the property0 is returned if the
property does not exist. To differentiate between this case and
when the property actually is zero, use getProperty.public static long getLongProperty(java.lang.String property,
int defaultValue)
property - the name of the propertydefaultValue - value to return if property is not found or is not a Long.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.public static long getLongProperty(java.lang.String module,
java.lang.String property,
int defaultValue)
module - the module, or null for regular propertyproperty - the name of the propertydefaultValue - value to return if property is not found or is not a Long.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.public static boolean getBooleanProperty(java.lang.String property)
TRUE or YES (case
insensitive.)property - the name of the propertyfalse is returned if
the property does not exist. To differentiate between this case
and when the property actually is false, use
getProperty.public static boolean getBooleanProperty(java.lang.String module,
java.lang.String property)
TRUE or YES (case
insensitive.)module - the module, or null for regular propertyproperty - the name of the propertyfalse is returned if
the property does not exist. To differentiate between this case
and when the property actually is false, use
getProperty.public static boolean getBooleanProperty(java.lang.String property,
boolean defaultValue)
TRUE or YES (case
insensitive.)property - the name of the propertydefaultValue - value to return if property is not found.default is returned if
the property does not exist. To differentiate between this case
and when the property actually is false, use
getProperty.public static boolean getBooleanProperty(java.lang.String module,
java.lang.String property,
boolean defaultValue)
TRUE or YES (case
insensitive.)module - module, or null for regular propertyproperty - the name of the propertydefaultValue - value to return if property is not found.default is returned if
the property does not exist. To differentiate between this case
and when the property actually is false, use
getProperty.public static java.util.Enumeration<?> propertyNames()
public static java.util.Enumeration<?> propertyNames(java.lang.String module)
module - module, or null for regular propertynull if the module does not exist.protected static java.io.File getConfigurationFile()
public static void loadConfig(java.lang.String configFile)
configFile - The dspace.cfg configuration file to use, or
null to try default locationspublic static java.lang.String getNewsFilePath()
NewsManager.getNewsFilePath().public static java.lang.String readNewsFile(java.lang.String name)
NewsManager.readNewsFile(java.lang.String).public static java.lang.String writeNewsFile(java.lang.String file,
java.lang.String news)
public static java.lang.String getLicenseText(java.lang.String licenseFile)
LicenseManager.getLicenseText(java.lang.String).public static java.lang.String getDefaultSubmissionLicense()
LicenseManager.getDefaultSubmissionLicense().public static void writeLicenseFile(java.lang.String licenseFile,
java.lang.String newLicense)
public static void main(java.lang.String[] argv)
-property name prints the value of the property
name from dspace.cfg to the standard
output. If the property does not exist, nothing is written.argv - command-line argumentsCopyright © 2013 DuraSpace. All Rights Reserved.