Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 08:15 Go to next message
Stephen is currently offline StephenFriend
Messages: 47
Registered: July 2009
Member
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 12:51 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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: Tue Dec 10 09:39:21 GMT 2024

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

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

Back to the top