Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Loading files from a JAR at runtime
Loading files from a JAR at runtime [message #629160] Mon, 27 September 2010 11:27 Go to next message
Geejay is currently offline GeejayFriend
Messages: 160
Registered: February 2010
Senior Member
I would like to load resources from inside of a bundle at run-time.

The thing is, I do not know at runtime the names of these resources
(otherwise I would just use getResource() from the class loading mechanism.

I have also tried class.getProtectionDomain().getCodeSource() and then
opening up the JAR file from there, but it seems (when debugging) the path
from getLocation() is just a folder on my local file system. The same is
with BundleContext.getBundle().getLocation(); I get a path with "reference"
appended to it, but it is not a JAR.

Any tips on how I would do this?

Thanks

Greg
Re: Loading files from a JAR at runtime [message #629165 is a reply to message #629160] Mon, 27 September 2010 12:03 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Use Bundle.getEntries(*) or Bundle.findEntries(*)

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Loading files from a JAR at runtime [message #629235 is a reply to message #629165] Mon, 27 September 2010 14:09 Go to previous message
Geejay is currently offline GeejayFriend
Messages: 160
Registered: February 2010
Senior Member
Super. It looks good. Thanks

"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:i7q0p5$g1b$2@news.eclipse.org...
> Use Bundle.getEntries(*) or Bundle.findEntries(*)
>
> PW
>
> --
> Paul Webster
> http://wiki.eclipse.org/Platform_Command_Framework
> http://wiki.eclipse.org/Command_Core_Expressions
> http://wiki.eclipse.org/Menu_Contributions
> http://wiki.eclipse.org/Menus_Extension_Mapping
> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
Previous Topic:Class Cast Exception when casting to common interface
Next Topic:With Config Area readonly starting activator fails
Goto Forum:
  


Current Time: Fri Apr 19 14:25:02 GMT 2024

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

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

Back to the top