JerryCai
JerryCai

Reputation: 1693

How to get absolute jar path of bundle by org.osgi.framework.Bundle Object?

I've got a org.osgi.framework.Bundle instance, and I tried

bundle.getLocation();
bundle.getClass().getProtectionDomain().getCodeSource().getLocation();

none of them can return the absolute path of the specific dependency jar file. So my question is how to get the path by this bundle instance?

Upvotes: 0

Views: 708

Answers (1)

Peter Kriens
Peter Kriens

Reputation: 15372

You cannot ... since stackoverflow wants 30 chars minimum ... you really cannot get it ... Frameworks are free to store the JARs any way they see fit.

Upvotes: 5

Related Questions