Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to locate and load an XML configuration file?
How to locate and load an XML configuration file? [message #500283] Wed, 25 November 2009 15:06 Go to next message
moley harey is currently offline moley hareyFriend
Messages: 23
Registered: July 2009
Junior Member
Hi folks,

I have a set of properties in an XML file and I would like to load those configuration parameters in my Eclipse application.
The problem I have is that I do not know where I can put my XML file so when I generate with my product file the executable version of my app I can locate it easily, how can I do that?

Does Eclipse RCP provide any mechanism for working and loading configuration files?

Thanks in advance,

Mh
Re: How to locate and load an XML configuration file? [message #500486 is a reply to message #500283] Thu, 26 November 2009 10:43 Go to previous message
Michael Golovanov is currently offline Michael GolovanovFriend
Messages: 37
Registered: October 2009
Member
Hi, moley

You have some approaches to solve your problem:
1. Preferences framework. This is common way to store and read/write your plugins config params.

2. You can place your config file into plugin subfolder. In this case use this code snippet

Bundle bundle = Platform.getBundle(BUNDLE_ID);
URL connURL = FileLocator.find(bundle, new Path("icons/" + fileName), null);
... here read content of URL


3. Place your file inside your Eclipse RCP folder and get path to RCP app at runtime.

I recommed to use first approach
Previous Topic:How to have a Dialog be a ISelectionListener
Next Topic:Enable-disable command on click of a tab
Goto Forum:
  


Current Time: Thu Apr 25 22:42:57 GMT 2024

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

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

Back to the top