Skip to main content



      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 18:11
Eclipse UserFriend
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: Wed Jul 16 23:48:10 EDT 2025

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

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

Back to the top