Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] initial@<url> related

Hi guys,

Can somebody explain or give me some pointers why the location of
bundles installed via the osgi.bundles is prepended with "initial@"?
The "problem" is that this bundles cannot be updated using
Bunlde#update() method or update console command. It will fail with an
java.net.MalformedURLException: no protocol: initial@... exception.
Indeed it fails only for those urls that are not "reference:urls". But
since "reference:" can only be used with file url, for any url that is
not an file url, it will then fail.

Tracking down the problem, in my view a simple change in
BaseAdaptor#mapLocationToURLConnection corrects this problem by
changing the line:
return (new URL(location).openConnection());
with:
if( location.startsWith( "initial@" ) )
{
  return new URL( location.substring( 8 ) ).openConnection();
}
else
{
  return new URL( location ).openConnection();
}

Because if location starts with "initial@" it will never be a valid url anyhow.

Thanx,
-- 
Alin Dreghiciu
http://www.ops4j.org - New Energy for OSS Communities - Open
Participation Software.
http://www.qi4j.org - New Energy for Java - Domain Driven Development.
http://www.codedragons.com - New Energy for Projects - Great People
working on Great Projects at Great Places


Back to the top