in a bundle/plug-in context you have to use Activator.getDefault().getBundle().getEntry("resourcename") to get the right url. But be careful because the url is different concerning if the bundle is jarred or not.

By the way: Resources from within a jar are copied temporary to the active workspace. That is the target location which will be returned by the method mentioned above.