Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to access files within an exported project
How to access files within an exported project [message #487171] Tue, 22 September 2009 10:07 Go to next message
Matthias is currently offline MatthiasFriend
Messages: 52
Registered: September 2009
Member
Hi,
in my application i need to access a configuration files e.g. "config/user.xml" to read and write the user settings.
while running the application in eclipse i can access the files using
Platform.getBundle("my.plugin.id").getEntry("/")

to find the plugin's root directory.

after exporting the project as a standalone application that doesn't work anymore since everything is bundled in the plugin's jar file.
How do you access files in your standalone RCP application?
regards, matthias
Re: How to access files within an exported project [message #487272 is a reply to message #487171] Tue, 22 September 2009 15:52 Go to previous messageGo to next message
Velganesh Subramanian is currently offline Velganesh SubramanianFriend
Messages: 69
Registered: July 2009
Member
Did you bundle the files? Check the options in 'Build' page of your
manifest.
Re: How to access files within an exported project [message #487278 is a reply to message #487171] Tue, 22 September 2009 16:13 Go to previous messageGo to next message
Tom Seidel is currently offline Tom SeidelFriend
Messages: 91
Registered: July 2009
Member
Matthias,

you can use org.eclipse.core.runtime.FileLocator#openStream(Bundle
bundle, IPath file, boolean substituteArgs)

Tom

matthias schrieb:
> Hi,
> in my application i need to access a configuration files e.g.
> "config/user.xml" to read and write the user settings.
> while running the application in eclipse i can access the files using
> Platform.getBundle("my.plugin.id").getEntry("/")
> to find the plugin's root directory.
>
> after exporting the project as a standalone application that doesn't
> work anymore since everything is bundled in the plugin's jar file.
> How do you access files in your standalone RCP application?
> regards, matthias
Re: How to access files within an exported project [message #487414 is a reply to message #487278] Wed, 23 September 2009 07:38 Go to previous message
Matthias is currently offline MatthiasFriend
Messages: 52
Registered: September 2009
Member
hi, thanks to both of you,
with FileLocator.openStream() it worked
one more question, as mention above i need to write back the user settings to that file. how can i manage that, since afaik the file is located in the plugin.jar
or is there better approach?
Previous Topic:How to get action for main menu item?
Next Topic:Check dirty file
Goto Forum:
  


Current Time: Sun Jan 26 06:54:13 GMT 2025

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

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

Back to the top