java - this.getClass().getClassLoader().getResourceAsStream()is not working in RCP product -


this.getclass().getclassloader().getresourceasstream(image_url) working when trying run rcp application eclipse. but, when running product, not running.

this.getclass().getclassloader().getresourceasstream() returns `null´. clue how solve this?

note: have tried solve using activator.getdefault().getbundle(). not working. seems activator.getdefault() = null means plugin not actiavted. tried put break point there. indeed plugin variable in null in activator.

what should do?

use filelocator:

bundle bundle = frameworkutil.getbundle(getclass());  inputstream = filelocator.openstream(bundle, new path("relative path"), false); 

other methods of filelocator give url instead of stream.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -