Interface ApplicationProperties
- All Known Implementing Classes:
ApplicationPropertiesImpl,MockApplicationProperties
Once a key is placed in the database (via an upgrade task or UI interaction) then it will always be loaded from the database.
NOTE: Be careful with boolean property values. Because of the way OSPropertySets works, it's impossible to distinguish between properties that have a false value and properties that have NO value. Therefore, it is better to have a "String" property set to the value "true" or "false" and then use Boolean.valueOf() in it. This way it's possible to distinguish the absence of a property value from it being set to false.
-
Method Summary
Modifier and TypeMethodDescriptionasMap()This will return all application and typed values.booleangetDefaultBackedString(String name) Get the property from the application properties, but if not found, try to get from the default properties file.getDefaultBackedText(String name) Get the property from the application properties, but if not found, try to get from the default properties file.Get all the keys from the default propertiesReturns the defaultLocaleset up on the Jira instance.getDefaultString(String name) Get the default property (if the property is not set)Returns the encoding to be used by Jira from the application properties.default StringgetKeys()Convenience method to get the email encodingbooleanGet the option from the application properties, but if not found, try to get from the default properties file.Returns the value of the given key.getStringsWithPrefix(String prefix) voidrefresh()Refresh application properties object by refreshing the PropertiesManagervoidSets the boolean application property.voidSets the string application property.voidSet the text application property.
-
Method Details
-
exists
-
getText
-
getDefaultBackedText
Get the property from the application properties, but if not found, try to get from the default properties file. -
setText
Set the text application property. Once the property is set, this method publishes an instance ofStringApplicationPropertySetEvent.- Parameters:
key- the key of the application property.value- the value of the application property.- Throws:
IllegalArgumentException- if the property is editable only via the config file
-
getString
Returns the value of the given key.- Parameters:
key- the key to retrieve- Returns:
- the value of the key; may be null or an empty String
-
getDefaultKeys
Collection<String> getDefaultKeys()Get all the keys from the default properties -
getDefaultBackedString
Get the property from the application properties, but if not found, try to get from the default properties file. -
getDefaultString
Get the default property (if the property is not set)- Parameters:
name- the name of the property.
-
setString
Sets the string application property. Once the property is set, this method publishes an instance ofStringApplicationPropertySetEvent.- Parameters:
key- the key of the application property.value- the value of the application property.- Throws:
IllegalArgumentException- if the property is editable only via the config file
-
getOption
Get the option from the application properties, but if not found, try to get from the default properties file. -
getKeys
Collection<String> getKeys() -
setOption
Sets the boolean application property. Once the property is set, this method publishes an instance ofBooleanApplicationPropertySetEvent.- Parameters:
key- the key of the application property.value- the value of the application property.- Throws:
IllegalArgumentException- if the property is editable only via the config file
-
getEncoding
String getEncoding()Returns the encoding to be used by Jira from the application properties.If application properties are not available, it returns UTF-8 by default.
-
getMailEncoding
String getMailEncoding()Convenience method to get the email encoding -
getContentType
String getContentType() -
refresh
void refresh()Refresh application properties object by refreshing the PropertiesManager -
getDefaultLocale
Locale getDefaultLocale()Returns the defaultLocaleset up on the Jira instance.- Returns:
- the default locale.
-
getStringsWithPrefix
-
asMap
This will return all application and typed values. For example if the property is a boolean then aBooleanobject will be returned. If an application property has a null value, then the key will still be in theMap.keySet()WARNING: This method is somewhat expensive. Do not use it unless you really are doing something with all the application properties, such as for the system information page. If you are just retrieving a single property, then use one of the
getmethods instead. For most properties,getDefaultBackedString(String)orgetOption(String)will be the best choice.- Returns:
- a map of key to actual value object
-
getJiraBaseUrl
-