How to load properties files in classes folder properly?

Hi guys, this is my plugin folder structure :

plugin

|-classes

|-db.properties

|-lib

|-…

|-plugin.xml

and I attempted to use classLoader.getResource(“db.properties”); to load properties files in classes folder, but it always returns null. I also browsed the userImportExport plugin, in which a xsd file was put in classes folder and successfully loaded. I copied precisely the code there to my plugin, but it still failed. Can anyone give some ideas about possible reason and solutions?

Hi guys, thank you for viewing this thread. I solved this by always using the plugin class loader to load resource files. The class loader can be got from the PluginManager.

Can you please elaborate on that

I have the same problem in accesing a file in classes folder of a plugin.

can you please put a sample code here.

see page below:

http://community.igniterealtime.org/message/220008#220008