Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » file path in plugin when runtime
file path in plugin when runtime [message #447538] Mon, 10 April 2006 04:15 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Plugin class constructor and start method
Next Topic:Reuse extension point schema functionality
Goto Forum:
  


Current Time: Wed Jul 16 02:31:41 EDT 2025

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

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

Back to the top