Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to get the resources when the plugin install at eclipse??(How to get the resources when the plugin install at eclipse??)
How to get the resources when the plugin install at eclipse?? [message #909403] Fri, 07 September 2012 05:03 Go to next message
Joe Lin is currently offline Joe LinFriend
Messages: 10
Registered: September 2012
Junior Member
I develop a plugin which can copy a file from to another folder.
I can debug/running the plugin at workspaces.but can't running after drop it in plugins folder.
How can i get the resources under the plugin folder?

the code is
 Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
resourceFile = FileLocator.toFileURL(bundle.getResource(File.separatorChar +"template" + File.separatorChar + fileType.getName()));


error is:
java.lang.NullPointerException
at org.eclipse.core.internal.runtime.Activator.getURLConverter(Activator.java:321)
at org.eclipse.core.runtime.FileLocator.toFileURL(FileLocator.java:205)

[Updated on: Fri, 07 September 2012 05:19]

Report message to a moderator

Re: How to get the resources when the plugin install at eclipse?? [message #909408 is a reply to message #909403] Fri, 07 September 2012 05:11 Go to previous messageGo to next message
Joe Lin is currently offline Joe LinFriend
Messages: 10
Registered: September 2012
Junior Member
i also use the classloader to find the resources. but it's same as up!
resourceFile = this.getClass().getClassLoader().getResource(File.separatorChar + "template" + File.separatorChar + fileType.getName());
Re: How to get the resources when the plugin install at eclipse?? [message #909410 is a reply to message #909408] Fri, 07 September 2012 05:19 Go to previous message
Joe Lin is currently offline Joe LinFriend
Messages: 10
Registered: September 2012
Junior Member
anybody can help me?
eclipse version 3.6
JDK 6
Previous Topic:Incomplete code AST
Next Topic:Is there a way to annotate methods that are overridden in subclasses?
Goto Forum:
  


Current Time: Thu Mar 28 20:23:41 GMT 2024

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

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

Back to the top