JBIDE-17153 : Initial implem. of IPropertiesProvider #257
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New IPropertiesProvider and its implementation
(VersionPropertiesProvider) reading IDE -wide properties from remote
resource bundle.
Provides properties depending on the context (project/product) it's
invoked in and the version of the context. Context and version are defined
by the current VersionPropertiesProvider instance.
Competing implementations can be found in the extension registry
(com.jboss.devstudio.core.central provides one implementation). The
provider with the highest priority will take precedence globally.
Consumers are expected to use :
org.jboss.tools.foundation.core.properties.PropertiesHelper.getPropertiesProvider()
Key/Value pairs are expected to be stored using the
key|context|version=value format.
If an exact matching version is not found for the requested key, the
properties provider will try to fall back to parent versions.
The version is provided by a locally Maven-filtered file
(currentversion.properties)
So, for instance, if the key 'foo' is requested in a VersionPropertiesProvider
provided by JBDS 8.0.0.Beta2-123456-65432 then :
It will return bar if foo|devstudio|8.0.0.Beta2=bar is set.
queried,
Properties are retrieved from a URI
(http://download.jboss.org/jbosstools/configuration/ide-config.properties
by default). This URI can be overridden using the
org.jboss.tools.foundation.core.config.properties.url VM argument. For
instance, to test a local properties file, the following argument needs to
be added to the JVM
-Dorg.jboss.tools.foundation.core.config.properties.url=file://path/to/resource.properties
Additionally, the org.jboss.tools.foundation.core.test plugin was turned into a
fragment, so we can test package visible methods.
Signed-off-by: Fred Bricon fbricon@gmail.com