Skip to main content



      Home
Home » Eclipse Projects » Equinox » How to read files within a bundle
How to read files within a bundle [message #116886] Mon, 01 September 2008 08:29 Go to next message
Eclipse UserFriend
Originally posted by: wesendon.in.tum.de

Hi guys,

this might be a stupid question, but I dont manage to read a file within
a bundle. E.g. how do I read a properties file? How can I gain an
inputstream of these files in my bundle? Is it possible to get the
absolute path of these files (for new File(path)), is this necessary
actually?

My foldes:
src/
....
bin/
....
files/
a.file
config/
some.properties

Greetings,
Otto

ps: I also added the file in the build.properties
Re: How to read files within a bundle [message #116928 is a reply to message #116886] Mon, 01 September 2008 13:08 Go to previous messageGo to next message
Eclipse UserFriend
On Mon, 01 Sep 2008 14:29:40 +0200, Otto <wesendon@in.tum.de> wrote:

>Hi guys,
>
>this might be a stupid question, but I dont manage to read a file within
>a bundle. E.g. how do I read a properties file? How can I gain an
>inputstream of these files in my bundle? Is it possible to get the
>absolute path of these files (for new File(path)), is this necessary
>actually?
>

The FileLocator class should do the job.


Achim
--
Achim Lörke

Eclipse-Stammtisch in the Braunschweig, Germany area:
http://www.bredex.de/de/news/events.html
Re: How to read files within a bundle [message #116953 is a reply to message #116928] Mon, 01 September 2008 13:37 Go to previous message
Eclipse UserFriend
Achim Lörke schrieb:
> The FileLocator class should do the job.

Or just Bundle#getEntry(String) if you don't need the NLS specific path
substitutions. :)

http://www2.osgi.org/javadoc/r4/org/osgi/framework/Bundle.ht ml#getEntry(java.lang.String)

-Gunnar


--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Previous Topic:Equinox Security Incubator code broken
Next Topic:Unsupported Install
Goto Forum:
  


Current Time: Thu Jul 17 21:51:11 EDT 2025

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

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

Back to the top