Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How to get classpath entries from Bundle?
How to get classpath entries from Bundle? [message #200972] Wed, 21 March 2007 21:36 Go to next message
Eclipse UserFriend
Originally posted by: pilgrim.us.ibm.com

I need to retrieve the classpath from plugin projects. When the project
is in the workspace, I can use this:
String[] lclClassPath =
JavaRuntime.computeDefaultRuntimeClassPath(javaProject);

When the plugin is installed in the platform, I can find the bundle that
contains my plugin:
Bundle bundle = Platform.getBundle(namespace);
Seems like there ought to be an api to get the classpath for that bundle
but I haven't been able to find one.
Re: How to get classpath entries from Bundle? [message #201027 is a reply to message #200972] Thu, 22 March 2007 01:02 Go to previous messageGo to next message
Charlie Kelly is currently offline Charlie KellyFriend
Messages: 276
Registered: July 2009
Senior Member
Hi Jeff,

See the following snippet for ideas:

schemaPlugin = SecurityClientActivator.getDefault();
String schemaFileNameFQ = "schema/schema-mail.ddl";

Path schemaPath = new Path(schemaFileNameFQ);
Bundle schemaBundle = schemaPlugin.getBundle();
URL schemaURL = FileLocator.find(schemaBundle, schemaPath, null);
if (null == schemaURL)
throw new Exception ("URL is null for: " + schemaFileNameFQ);
//////////////////////////////////////////////////////////// ////
boolean substituteArgumentsFlag = false;
InputStream schemaFileIS = FileLocator.openStream(schemaBundle,
schemaPath, substituteArgumentsFlag);
InputStreamReader inputStreamReader = new InputStreamReader
(schemaFileIS);
BufferedReader bufferedReader = new BufferedReader (inputStreamReader);


Charlie


Jeff wrote:
> I need to retrieve the classpath from plugin projects. When the project
> is in the workspace, I can use this:
> String[] lclClassPath =
> JavaRuntime.computeDefaultRuntimeClassPath(javaProject);
>
> When the plugin is installed in the platform, I can find the bundle that
> contains my plugin:
> Bundle bundle = Platform.getBundle(namespace);
> Seems like there ought to be an api to get the classpath for that bundle
> but I haven't been able to find one.
>
Re: How to get classpath entries from Bundle? [message #201467 is a reply to message #201027] Fri, 23 March 2007 18:45 Go to previous message
Eclipse UserFriend
Originally posted by: pilgrim.us.ibm.com

thanks, see the entry in the platform newsgroup.
Previous Topic:Character Encoding Problems
Next Topic:Creating a submenu for a custom view
Goto Forum:
  


Current Time: Thu Apr 18 14:37:35 GMT 2024

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

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

Back to the top