<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Reading resources from a Eclipse plugin</title>
	<atom:link href="http://www.vogella.de/blog/2010/07/06/reading-resources-from-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vogella.de/blog/2010/07/06/reading-resources-from-plugin/</link>
	<description>Tips around Eclipse and Android programming</description>
	<lastBuildDate>Thu, 09 Feb 2012 16:32:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Lars Vogel</title>
		<link>http://www.vogella.de/blog/2010/07/06/reading-resources-from-plugin/comment-page-1/#comment-2401</link>
		<dc:creator>Lars Vogel</dc:creator>
		<pubDate>Tue, 06 Jul 2010 07:37:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.vogella.de/blog/?p=2783#comment-2401</guid>
		<description>@Alex at least you don&#039;t need to import Eclipse classes in the second approach which I believe is better.</description>
		<content:encoded><![CDATA[<p>@Alex at least you don&#8217;t need to import Eclipse classes in the second approach which I believe is better.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Blewitt</title>
		<link>http://www.vogella.de/blog/2010/07/06/reading-resources-from-plugin/comment-page-1/#comment-2400</link>
		<dc:creator>Alex Blewitt</dc:creator>
		<pubDate>Tue, 06 Jul 2010 07:32:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.vogella.de/blog/?p=2783#comment-2400</guid>
		<description>... was filed by me and says &quot;getEntry and getResource inconsistent&quot;) - basically, at runtime, bundle.getEntry and bundle.getResource load the same; but under PDE, resources are loaded from the root of your plugin whilst resources come from under the /bin or /classes directory. I don&#039;t believe that&#039;s fixed</description>
		<content:encoded><![CDATA[<p>&#8230; was filed by me and says &#8220;getEntry and getResource inconsistent&#8221;) &#8211; basically, at runtime, bundle.getEntry and bundle.getResource load the same; but under PDE, resources are loaded from the root of your plugin whilst resources come from under the /bin or /classes directory. I don&#8217;t believe that&#8217;s fixed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Blewitt</title>
		<link>http://www.vogella.de/blog/2010/07/06/reading-resources-from-plugin/comment-page-1/#comment-2399</link>
		<dc:creator>Alex Blewitt</dc:creator>
		<pubDate>Tue, 06 Jul 2010 07:30:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.vogella.de/blog/?p=2783#comment-2399</guid>
		<description>Both of these are Eclipse-specific, of course. It&#039;s actually a lot better/easier to use Class.getResourceAsStream() to pull the bytes out, which has the advantage of working across all OSGi systems and outside of OSGi too. Plus it uses the bundle of wherever the class was loaded from. 

There is a bug in PDE (don&#039;t have the ID but it wa</description>
		<content:encoded><![CDATA[<p>Both of these are Eclipse-specific, of course. It&#8217;s actually a lot better/easier to use Class.getResourceAsStream() to pull the bytes out, which has the advantage of working across all OSGi systems and outside of OSGi too. Plus it uses the bundle of wherever the class was loaded from. </p>
<p>There is a bug in PDE (don&#8217;t have the ID but it wa</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars Vogel</title>
		<link>http://www.vogella.de/blog/2010/07/06/reading-resources-from-plugin/comment-page-1/#comment-2398</link>
		<dc:creator>Lars Vogel</dc:creator>
		<pubDate>Tue, 06 Jul 2010 06:33:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.vogella.de/blog/?p=2783#comment-2398</guid>
		<description>@Chris: Thanks for the feedback

@dzim: I agree with you that the second method is the better one.</description>
		<content:encoded><![CDATA[<p>@Chris: Thanks for the feedback</p>
<p>@dzim: I agree with you that the second method is the better one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dzim</title>
		<link>http://www.vogella.de/blog/2010/07/06/reading-resources-from-plugin/comment-page-1/#comment-2397</link>
		<dc:creator>dzim</dc:creator>
		<pubDate>Tue, 06 Jul 2010 04:48:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.vogella.de/blog/?p=2783#comment-2397</guid>
		<description>Hi Lars,

The second option is really much more reliable!
I&#039;ve done something quite similar a week or two ago where I stumbled over the first method, when the file was bundled within the plugin jar.
The problem was: The files in question where somthing I called resource-jars - that means they where jars itself... That made me loads of trouble.
The final idea was there:
1) create an &quot;resource&quot; extension point
2) load the urls into a URLClassLoader
3) retrieve the resources from within the URClassLoader via theire specific class loader dependent URL

It works, but it still have the look of a major quick hack ;-)

Greetings,
Daniel</description>
		<content:encoded><![CDATA[<p>Hi Lars,</p>
<p>The second option is really much more reliable!<br />
I&#8217;ve done something quite similar a week or two ago where I stumbled over the first method, when the file was bundled within the plugin jar.<br />
The problem was: The files in question where somthing I called resource-jars &#8211; that means they where jars itself&#8230; That made me loads of trouble.<br />
The final idea was there:<br />
1) create an &#8220;resource&#8221; extension point<br />
2) load the urls into a URLClassLoader<br />
3) retrieve the resources from within the URClassLoader via theire specific class loader dependent URL</p>
<p>It works, but it still have the look of a major quick hack <img src='http://www.vogella.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Greetings,<br />
Daniel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Roberts</title>
		<link>http://www.vogella.de/blog/2010/07/06/reading-resources-from-plugin/comment-page-1/#comment-2393</link>
		<dc:creator>Chris Roberts</dc:creator>
		<pubDate>Tue, 06 Jul 2010 02:31:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.vogella.de/blog/?p=2783#comment-2393</guid>
		<description>Great tip!  Thank you!  Every time I&#039;ve tried to do this in the past, it&#039;s been a huge pain and I&#039;ve usually resorted to writing code that just seems messy and left me thinking &quot;there has to be a better way to do this.&quot;  Here are two better ways -- thanks!</description>
		<content:encoded><![CDATA[<p>Great tip!  Thank you!  Every time I&#8217;ve tried to do this in the past, it&#8217;s been a huge pain and I&#8217;ve usually resorted to writing code that just seems messy and left me thinking &#8220;there has to be a better way to do this.&#8221;  Here are two better ways &#8212; thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

