file path in plugin when runtime [message #447538] |
Mon, 10 April 2006 04:15  |
Eclipse User |
|
|
|
Hi,all:
I want to read a file which exists in plugin's root directory.How to
decide the file's path when runtime? By using
getBundle().getResource("fileName") i can get URL ,but is it the only way?
How can i get the absolute path?
Stephen.
|
|
|
Re: file path in plugin when runtime [message #447590 is a reply to message #447538] |
Tue, 11 April 2006 08:51  |
Eclipse User |
|
|
|
If you get the URL, you can get it's input stream. You can use that,
bridge it to InputStreamReader, etc.
If you really want the file, then you can use Platform.asLocalURL(*)
(which has been deprecated in 3.2 and replaced with
FileLocator#toFileURL(*)). But if the plugin was a jar, it will extract
the file into a temporary location.
Later,
PW
|
|
|
Powered by
FUDForum. Page generated in 0.03600 seconds