Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Access data files in a jar file(URI is not hierarchical)
Access data files in a jar file [message #900096] Fri, 03 August 2012 22:11
Joaquin Morcate is currently offline Joaquin MorcateFriend
Messages: 52
Registered: March 2010
Member
Hi all,

I have to read some conf xml that are in a data folder at the same level that the icons folder. And I don't know how to do it. Everything that I try works well in the IDE but it fails when I try with a build product.

if I try:
    Bundle bundle = Platform.getBundle("com.example.mail");
    URL fileURL = bundle.getResource("/data/claudia.xml");

or:
    Bundle bundle = Platform.getBundle("com.example.mail");
    URL fileURL = bundle.getResource("/data/claudia.xml");

both return a null fileURL.

If I try:
	fileURL = new URL("platform:/plugin/com.example.mail/data/claudia.xml");
        File file = new File(FileLocator.resolve(fileURL).toURI());

I get:
java.lang.IllegalArgumentException: URI is not hierarchical

I've googled for hours and coul not find a solution. Any help, please?
Previous Topic:Add the "Create Project" button
Next Topic:How to add pop up menu using org.eclipse.ui.menus
Goto Forum:
  


Current Time: Fri Oct 04 00:17:00 GMT 2024

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

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

Back to the top