Problem loading files from other Plugin in Eclipse 3.3 [message #464476] |
Thu, 08 March 2007 09:33 |
Yves Harms Messages: 80 Registered: July 2009 |
Member |
|
|
Since Eclipse 3.3 I have a problem loading a file from a different
plugin. Before 3.3 it just works using the calling class to determine
the correct file URL.
PluginA calls a class in PluginB which tries to read a DTD file from
PluginA.
To make things even more complicated
- Both plugins are library plugins which don't know about Eclipse. So we
can't use any Eclipse framework classes to determine the file path.
- We can't use any Streams either since the API of a third party library
that we use here can only handle String paths.
For illustration a Test class that is called from PluginA
public InPluginB(Class usingClass) {
super();
final URL fileUrl
= usingClass.getResource("lago-config-1_0.dtd");
System.out.println(fileUrl.getFile());
System.out.println(new File(fileUrl.toExternalForm()).exists());
}
The second printout always return false.
Can anyone give me a hint how to determine the correct absolute path of
the file for use in the other plugin ?
I already tried to enable buddy classloading by registering PluginA in
PluginB - but with no success.
Regards,
Yves Harms
|
|
|
Powered by
FUDForum. Page generated in 0.03570 seconds