Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » get absolute path of file in plugin directory
get absolute path of file in plugin directory [message #249517] Fri, 04 June 2004 10:29 Go to next message
Eclipse UserFriend
Originally posted by: pieter.west.NOSPAM.nl

I need to read in a file that is located in my plugin directory.
How can I do this?
Re: get absolute path of file in plugin directory [message #249622 is a reply to message #249517] Fri, 04 June 2004 11:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

URL url = Platform.find(Platform.getBundle("your.plugin.id"), new
Path("yourfile-relative-to-plugin"));
if (url != null) {
InputStream is = url.openStream()
... use the stream to get contents ...
}


--
Thanks, Rich Kulp

Re: get absolute path of file in plugin directory [message #249631 is a reply to message #249517] Fri, 04 June 2004 11:43 Go to previous message
Eclipse UserFriend
Pieter schrieb:

> I need to read in a file that is located in my plugin directory.
> How can I do this?
>

Take a look at getBundle('/path/to/my/file'). And please be aware that a
plugin is _not_ guaranteed to be in a directory (might also be a jar or
somewhere else), so don't make any assumptions about directory or file
structures.

Ciao, Michael.
Previous Topic:Can we disable back button on Wizard Page?
Next Topic:Re: Re: CVS perspective - how to set up "Repository location"
Goto Forum:
  


Current Time: Wed May 14 10:25:36 EDT 2025

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

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

Back to the top