|
Re: how to extract additional file types from bundle [message #651534 is a reply to message #651521] |
Mon, 31 January 2011 15:24 |
|
On 01/31/2011 09:34 AM, Ens wrote:
> In our RCP app, we have a set of data files that are required to be read
> by in by one of our plug-ins. When the plug-in is extracted into
> "configuration/org.eclipse.osgi/bundles", these data files are not
> extracted from the plug-in jar file. How do I add support for these file
> types so they are extracted?
In general, you make sure the files are included in your bundle using
the build.properties file (for files that are in the root of your plugin
project, as resources within the source tree are included automatically).
If they really were resources, you simply use
getClass().getResourceAsStream(*).
If they were included in your plugin, you use Bundle.getEntry(*) to get
the InputStream from the URL.
If you need files on the disk ... first I'd ask why, then send you to
FileLocator (which for a given bundle entry, will return a URL that
points to a file on disk).
PW
--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03369 seconds