DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page How to read file in RCP
Notices
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Feb 2009
Default How to read file in RCP - 02-28-2009, 04:57 AM

Hello,


I need to read and write a XML file from my Product, and I don't know how to do that ...

Where should I put my initial file.xml ? How can I tell eclipse to not copy this file in my .jar product ?


I try to read file using the usual reading o file in normal apps and it works
but when I try it in RCP apps to files to locate the file. I like an RCP apps
to read and write to a file just like any normal apps.

Thanks
Reply With Quote
  (#2 (permalink)) Old
Moderator
 
Posts: 119
Thanks: 0
Thanked 10 Times in 9 Posts
Join Date: Jan 2008
Default 03-03-2009, 09:40 AM

Is the XML file on the filesystem, or in the project itself? If that's the case you'll need to open the file relative to the plugin. Let me know and I'll try to help

James
Reply With Quote
  (#3 (permalink)) Old
Member
 
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Feb 2009
Default 03-04-2009, 12:31 AM

Thanks for your reply.
This is the situation. The file is relative to the project. In reading a file using a normal apps
(not an RCP apps) you just dot it like this File file = new File("conf/file.xml). But in RCP apps, it produce an error, Cannot find the specified path. I like to read the file relative to the project.
Reply With Quote
  (#4 (permalink)) Old
Moderator
 
Posts: 119
Thanks: 0
Thanked 10 Times in 9 Posts
Join Date: Jan 2008
Default 03-04-2009, 01:17 AM

You'll need to do something like this:
[news.eclipse.platform] Re: Finding absolute path to plugin's "plugin.xm

When using plugins, you'll always need to find the file relative to the plugin's install path.

James
Reply With Quote
  (#5 (permalink)) Old
Member
 
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Feb 2009
Default 03-07-2009, 12:26 PM

Thanks for this one James. That's really what Im looking for..

Rey.
Reply With Quote
Reply

Tags
rcp, read file

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any commercial product read MSExcel edmund Java 10 02-12-2009 12:06 AM
Unable to read value from underlying bridge: Cannot create a resource for ecore file ramesh_20 Eclipse 1 06-27-2008 01:00 PM
Read from Eclipse Output Console gamby Eclipse 6 02-14-2008 08:50 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com