Adding text file to an RCP and finding it from the RCP [message #452819] |
Mon, 17 July 2006 12:29 |
J. Michael Dean, M.D. 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.02810 seconds