Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » FooPlugin.getDefault().getBundle().getEntry(relativePath).getPath() returns bad value in exported RC
FooPlugin.getDefault().getBundle().getEntry(relativePath).getPath() returns bad value in exported RC [message #459739] Wed, 06 December 2006 22:44 Go to next message
Eclipse UserFriend
R3.2.1, WinXP

Rather spontaneously (really) the call
FooPlugin.getDefault().getBundle().getEntry("bang.jar").getPath() changed from returning

"/C:/foo/bar/myFooPluginDirectory/bang.jar"

to returning

"file:C:/foo/bar/myFooPluginDirectory/bang.jar!"

(YES, with trailing "!")

Anyone have any clue why this would happen? Also, how to get the URL to just return the naked path
without the "file:" and the "!"?

thanks,
Paul
Re: FooPlugin.getDefault().getBundle().getEntry(relativePath).getPath() returns bad value in exporte [message #459746 is a reply to message #459739] Thu, 07 December 2006 03:55 Go to previous messageGo to next message
Eclipse UserFriend
Did you install the Eclipse Zip plugin as discussed on EclipseZone recently? It looks like it's returning a URL, and one of the semi-conventional ways of referring to a file inside a Jar is with a !

Alternatively, it may be the addition of a Zip implementation of EFS that's doing this.

Just guesses :-)

Alex.
Re: FooPlugin.getDefault().getBundle().getEntry(relativePath).getPath() returns bad value in exporte [message #459830 is a reply to message #459739] Thu, 07 December 2006 07:59 Go to previous messageGo to next message
Eclipse UserFriend
Paul Keyser wrote:
> R3.2.1, WinXP
>
> Rather spontaneously (really) the call
> FooPlugin.getDefault().getBundle().getEntry("bang.jar").getPath()
> changed from returning
>
> "/C:/foo/bar/myFooPluginDirectory/bang.jar"
>
> to returning
>
> "file:C:/foo/bar/myFooPluginDirectory/bang.jar!"
>
> (YES, with trailing "!")
>
> Anyone have any clue why this would happen? Also, how to get the URL to
> just return the naked path without the "file:" and the "!"?

Once you have URL url = bundle.getEntry(*), you need to use
FileLocator.toFileURL(url) and then it will be a proper URL to a file on
the file system.

Later,
PW
Re: FooPlugin.getDefault().getBundle().getEntry(relativePath).getPath() returns bad value in exporte [message #459838 is a reply to message #459830] Thu, 07 December 2006 11:34 Go to previous message
Eclipse UserFriend
Paul --
Excellent -- works like a champ. And my dummheit can be seen in the fact that I *knew* about
FileLocator.toFileURL(url), but was only using it when I retrieved the *install* URL. Go figure.

Alex --
I haven't installed the Eclipse Zip plugin as discussed on EclipseZone, although I did start using
the Java unzip code a month or so ago (but this error just showed up a day or so ago).

thanks,
Paul
Previous Topic:Spring plugin and the classpath
Next Topic:property view and multiple selection in editor
Goto Forum:
  


Current Time: Mon Mar 17 01:56:51 EDT 2025

Powered by FUDForum. Page generated in 0.07517 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top