Class SkinPropertyService
java.lang.Object
edu.ucsb.nceas.metacat.shared.BaseService
edu.ucsb.nceas.metacat.properties.SkinPropertyService
A suite of utility classes for the skin configuration utility
-
Field Summary
Fields inherited from class edu.ucsb.nceas.metacat.shared.BaseService
_serviceName
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Reports whether the metacat configuration utility should be run.void
static edu.ucsb.nceas.utilities.SortedProperties
getBackupProperties
(String skinName) Get the main backup properties file.static SkinPropertyService
Get the single instance of SkinPropertyService.static edu.ucsb.nceas.utilities.SortedProperties
getProperties
(String skinName) Get the main backup properties file.static String
getProperty
(String skinName, String propertyName) Utility method to get a property value from the properties file for a specific skin.getPropertyNames
(String skinName) Get a set of all property names for a given skin.getPropertyNamesByGroup
(String skinName, String groupName) Get a Set of all property names that start with the groupName prefix.boolean
void
stop()
Methods inherited from class edu.ucsb.nceas.metacat.shared.BaseService
refresh
-
Method Details
-
getInstance
Get the single instance of SkinPropertyService.- Returns:
- the single instance of SkinPropertyService
- Throws:
ServiceException
-
refreshable
public boolean refreshable()- Specified by:
refreshable
in classBaseService
-
doRefresh
- Specified by:
doRefresh
in classBaseService
- Throws:
ServiceException
-
stop
- Specified by:
stop
in classBaseService
- Throws:
ServiceException
-
getProperty
public static String getProperty(String skinName, String propertyName) throws edu.ucsb.nceas.utilities.PropertyNotFoundException Utility method to get a property value from the properties file for a specific skin.- Parameters:
skinName
- the skin for which we want to retrieve the propertypropertyName
- the name of the property requested- Returns:
- the String value for the property
- Throws:
edu.ucsb.nceas.utilities.PropertyNotFoundException
-
getPropertyNames
public static Vector<String> getPropertyNames(String skinName) throws edu.ucsb.nceas.utilities.PropertyNotFoundException Get a set of all property names for a given skin.- Parameters:
skinName
- the skin for which we want to retrieve the property names- Returns:
- List of property names
- Throws:
edu.ucsb.nceas.utilities.PropertyNotFoundException
-
getPropertyNamesByGroup
public static Vector<String> getPropertyNamesByGroup(String skinName, String groupName) throws edu.ucsb.nceas.utilities.PropertyNotFoundException Get a Set of all property names that start with the groupName prefix.- Parameters:
groupName
- the prefix of the keys to search for.- Returns:
- Vector of property names
- Throws:
edu.ucsb.nceas.utilities.PropertyNotFoundException
-
getProperties
Get the main backup properties file. These are configurable properties that are stored outside the metacat install directories so the user does not need to re-enter all the configuration information every time they do an upgrade.- Returns:
- a SortedProperties object with the backup properties
-
getBackupProperties
Get the main backup properties file. These are configurable properties that are stored outside the metacat install directories so the user does not need to re-enter all the configuration information every time they do an upgrade.- Returns:
- a SortedProperties object with the backup properties
-
bypassConfiguration
public static boolean bypassConfiguration()Reports whether the metacat configuration utility should be run. Returns false if -- dev.runConfiguration=false and -- backup properties file exists Note that dev.runConfiguration should only be set to false when reinstalling the same version of the application in developement.- Returns:
- a boolean that is false if dev.runConfiguration is false and the backup properties file exists.
-