Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » resource loading problem in jar
resource loading problem in jar [message #461248] Mon, 08 January 2007 02:09 Go to next message
Eclipse UserFriend
Originally posted by: filot97.nate.com

My development structure is follwing as :

myRCP\
.....\src
.........\rcpPackage\foo.java
......\property
...............\bar.txt

I just want to read bar.txt from foo.java.
foo.java and bar.txt files are not located in the same space.
How can I access it ?
Re: resource loading problem in jar [message #461249 is a reply to message #461248] Mon, 08 January 2007 06:56 Go to previous messageGo to next message
Cliff Liang is currently offline Cliff LiangFriend
Messages: 24
Registered: July 2009
Junior Member
You can access it with the follow

URL u = Platform.resolve(MyRCPPlugin.getDefault()
.getBundle().getEntry("/"));
String absolutePathName = u.getFile();
File file = new File(absolutePathName, "property/bar.txt");


"Oh Sangin" <filot97@nate.com>
??????:3968038.1168222212488.JavaMail.root@cp1.javalobby.org...
> My development structure is follwing as :
>
> myRCP\
> ....\src
> ........\rcpPackage\foo.java
> .....\property
> ..............\bar.txt
>
> I just want to read bar.txt from foo.java.
> foo.java and bar.txt files are not located in the same space.
> How can I access it ?
Re: resource loading problem in jar [message #461258 is a reply to message #461249] Mon, 08 January 2007 10:57 Go to previous message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
This is only going to work if you have your bundle unexpanded.

It's far better to move it into a Java Source folder, and then you can use getClass().getResourceAsStream() to access the resource.

Alex.
Previous Topic:Wordwarp in RTL languages
Next Topic:Workbench menus and NLS
Goto Forum:
  


Current Time: Fri Apr 26 15:59:10 GMT 2024

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

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

Back to the top