Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Adding text file to an RCP and finding it from the RCP
Adding text file to an RCP and finding it from the RCP [message #452819] Mon, 17 July 2006 12:29 Go to next message
J. Michael Dean, M.D. is currently offline J. Michael Dean, M.D.Friend
Messages: 218
Registered: July 2009
Senior Member
I posted this originally to newcomer group, but not sure it doesn't better
belong here. I am developing an application that will process a text rules
file. The problem is finding the rules file. I have flailed for two days
and my development work around is to put in a FileDialog and find it by
hand, but obviously, I want the app to find the file automatically. I
cannot accomplish this in the Eclipse environment, much less in the exported
RCP. I HAVE figured out how to land the file in the root of an exported
product by including it in the feature.xml with a root=etc command.


In Eclipse development environment, I have the file in the root of the
project, and I cannot locate it:

> IPath path = GlucosePlugin.getDefault().getStateLocation();
> System.out.println("The state location is: "+ path.toString());
> factFile = new FileReader(path.toString() + "/Glucose.clp");

I had already tried the simpler factFile = new FileReader("Glucose.clp");
This was without success.

The state location is:
/Users/mdean/Documents/runtime-EclipseApplication/.metadata/ .plugins/edu.uta
h.cdmcc.decisionsupport.glucose


java.io.FileNotFoundException:
/Users/mdean/Documents/runtime-EclipseApplication/.metadata/ .plugins/edu.uta
h.cdmcc.decisionsupport.glucose/Glucose.clp (No such file or directory)


Cannot find the rules file.

When I examine the file, in the project, the properties view says this is
the path:

path /edu.utah.cdmcc.decisionsupport.glucose/Glucose.clp

And the location is reported as:

location
/Users/mdean/Documents/GlucoseWorkspace/edu.utah.cdmcc.decis ionsupport.gluco
se/Glucose.clp

I am baffled. I can export the application as an RCP using features, and
have landed the Glucose.clp file right next to the Glucose.app but it does
not locate the file. I think I have to solve this in the Eclipse
environment before exporting, anyway.

Thanks. I am posting this here because I think it is a newbie item.

- Mike
Re: Adding text file to an RCP and finding it from the RCP [message #452932 is a reply to message #452819] Wed, 19 July 2006 08:31 Go to previous message
Phill Perryman is currently offline Phill PerrymanFriend
Messages: 214
Registered: July 2009
Senior Member
The state location is the "guaranteed bit you can write to", your rcp is
installed at the platform.getLocation eg.

Platform.getLocation().addTrailingSeparator().append("Glucose.clp
").toFile();
Previous Topic:Extension Pop-Up Menu
Next Topic:How to communicate with eclipse internal web browser
Goto Forum:
  


Current Time: Thu Oct 03 17:15:36 GMT 2024

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

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

Back to the top