public class ConfigurationManager extends 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(String property)
Get a configuration property as a boolean.
|
static boolean |
getBooleanProperty(String property,
boolean defaultValue)
Get a configuration property as a boolean, with default.
|
static boolean |
getBooleanProperty(String module,
String property)
Get a module configuration property as a boolean.
|
static boolean |
getBooleanProperty(String module,
String property,
boolean defaultValue)
Get a module configuration property as a boolean, with default.
|
protected static File |
getConfigurationFile()
Deprecated.
Please remove all direct usage of the configuration file.
|
static String |
getDefaultSubmissionLicense()
Deprecated.
since 4.0
|
static int |
getIntProperty(String property)
Get a configuration property as an integer
|
static int |
getIntProperty(String property,
int defaultValue)
Get a configuration property as an integer, with default
|
static int |
getIntProperty(String module,
String property)
Get a module configuration property as an integer
|
static int |
getIntProperty(String module,
String property,
int defaultValue)
Get a module configuration property as an integer, with default
|
static String |
getLicenseText(String licenseFile)
Deprecated.
since 4.0
|
static long |
getLongProperty(String property)
Get a configuration property as a long
|
static long |
getLongProperty(String property,
int defaultValue)
Get a configuration property as an long, with default
|
static long |
getLongProperty(String module,
String property)
Get a module configuration property as a long
|
static long |
getLongProperty(String module,
String property,
int defaultValue)
Get a configuration property as an long, with default
|
static String |
getNewsFilePath()
Deprecated.
since 4.0
|
static Properties |
getProperties()
Returns all properties in main configuration
|
static Properties |
getProperties(String module)
Returns all properties for a given module
|
static String |
getProperty(String property)
Get a configuration property
|
static String |
getProperty(String module,
String property)
Get a module configuration property value.
|
static boolean |
isConfigured()
Identify if DSpace is properly configured
|
static boolean |
isConfigured(String module) |
static void |
loadConfig(String configFile)
Load the DSpace configuration properties.
|
static void |
main(String[] argv)
Command-line interface for running configuration tasks.
|
static Enumeration<?> |
propertyNames()
Returns an enumeration of all the keys in the DSpace configuration
|
static Enumeration<?> |
propertyNames(String module)
Returns an enumeration of all the keys in a module configuration
|
static String |
readNewsFile(String name)
Deprecated.
since 4.0
|
static void |
writeLicenseFile(String licenseFile,
String newLicense)
Deprecated.
since 4.0
|
static String |
writeNewsFile(String file,
String news)
Deprecated.
since 4.0
|
public static boolean isConfigured()
public static boolean isConfigured(String module)
public static Properties getProperties()
public static Properties getProperties(String module)
module - the name of the modulepublic static String getProperty(String property)
property - the name of the propertynull if the property
does not exist.public static String getProperty(String module, 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(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(String module, 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(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(String module, 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(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(String module, 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(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(String module, 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(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(String module, 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(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(String module, 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 Enumeration<?> propertyNames()
public static Enumeration<?> propertyNames(String module)
module - module, or null for regular propertynull if the module does not exist.protected static File getConfigurationFile()
public static void loadConfig(String configFile)
configFile - The dspace.cfg configuration file to use, or
null to try default locationspublic static String getNewsFilePath()
NewsManager.getNewsFilePath().public static String readNewsFile(String name)
NewsManager.readNewsFile(java.lang.String).public static String getLicenseText(String licenseFile)
LicenseManager.getLicenseText(java.lang.String).public static String getDefaultSubmissionLicense()
LicenseManager.getDefaultSubmissionLicense().public static void writeLicenseFile(String licenseFile, String newLicense)
public static void main(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 © 2014 DuraSpace. All Rights Reserved.