Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] Clarification in use of Platform.resolve() and Platform.asLocalURL()


The behavior of org.eclipse.core.runtime.resolve(URL) has changed in the latest eclipse 3.0 code.

This method used to resolve URL's that use the platform protocol to a URL that uses the file protocol.  As a result some code in eclipse is making the assumption that the returned URL will always be a file URL.  The Platform java doc does not restrict the URL returned from resolve() to a URL that uses the file protocol.  It could be any protocol that the platform URLhandler is using to connect to the actual URL resource.

Now that eclipse is running on top of OSGi the actual protocol that is being used by platform URLs is the bundle protocol.  So URL's returned by Platform.resolve() are no long just file URLs.  If you need to have an actual file URL then you must use the Platform.asLocalURL() method.  This method is the only guaranteed way to get a file URL from a platform URL.

Thomas Watson

Back to the top