Search code examples
osgiapache-karafosgi-bundlekaraf

karaf Accessing resources inside webinf folder


I have deployed a webbundle in karaf. In the web-inf folder i have kept some files. is there a way to access those using absolute path. Or do i need to keep the reources in karaf deploy folder.


Solution

  • There is no absolute path for resources deployed in a osgi environment as those resources aren't "unziped" to a working directory. So yes you need to access these resources via the bundle context classloader. Or keep those resources outside of your bundle, this is completely dependent on your use-case.