Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » plugin access to a policy file
plugin access to a policy file [message #165002] Thu, 17 June 2004 14:07
Eclipse UserFriend
Originally posted by: michael.shopkowski.sas.com

I am developing a plugin that will use another groups jar file to do
various RMI things. The jar requires access to a policy file in the
plugin. The jar code uses code like that below to find the file, which
fails, I think, because it is done within a plugin.

cl = ClassLoader.getSystemClassLoader();
cl.getResource(policyName);

I have tried to trick things by doing the following before accessing the
file, which worked in 3.0M4 but fails in RC1...odd that.

Thread.currentThread().setContextClassLoader(MyPlugin.class. getClassLoader());


So the questions are

1) What is the correct way for a plugin to read a file that is part of the
plugin, installed who knows where.

2) Is there a simple way to force the Plugins classloader to be the
SystemClassLoader

3) Is there a better way or do I compell another groups generalized
solution to be modified for plugin access.
Previous Topic:Cool refactoring experience
Next Topic:Setting classpath programmatically
Goto Forum:
  


Current Time: Sun Jul 27 13:03:26 EDT 2025

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

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

Back to the top