[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Problem specifying osgi.config.area using symbolic location (@user.home)

I'm experimenting with setting the Equinox configuration area to a
directory other than <install>/configuration. Specifically, I'd like
to take advantage of the symbolic location shortcuts described in "The
Eclipse runtime options".¹

As part of my application startup, while building the properties to
feed to EclipseStarter.setInitialProperties(), I have the following:

  props.setProperty( org.eclipse.core.runtime.adaptor.LocationManager.PROP_CONFIG_AREA,
                     "@user.home/.myapp" );

Now jump over to LocationManager.initializeLocations(). Around line
117, this function calls on mungeConfigurationLocation(), which takes
the "osgi.configuration.area" property and turns it into path by way
of an intermediate URL, apparently with respect to the current working
directory if the property value doesn't look like an absolute path.

Only after mungeConfigurationLocation() toys with the
"osgi.configuration.area" property does buildLocation() get a chance
to operate on it, around line 123 in LocationManager. It's within
buildLocation() that the symbolic location prefixes are expanded. My
attempted use of the prefix "@user.home" gets foiled by
mungeConfigurationLocation(), because by the time we get to
buildLocation(), the "osgi.configuration.area" property looks more
like:

  file:/C:/src/projects/<...>/@user.home/.myapp

Am I misinterpreting the documentation in expecting that this symbolic
location should be respected properly? Is this a bug?


Footnotes: 
¹ http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html

-- 
Steven E. Harris