|
|
Re: Accessing properties file through jar [message #662394 is a reply to message #662323] |
Wed, 30 March 2011 14:10 |
|
It's actually much easier than that:
import org.osgi.framework.Bundle;
import org.eclipse.core.runtime.Platform;
...
Bundle bundle = Platform.getBundle("com.example.otherbundle.pluginid");
URL entry = bundle.getEntry("/path/to/properties"); // path is relative to the bundle (project) root, e.g. "/META-INF/app.properties"
From there you should be able to do what you need with the file. Be sure you check the build.properties of your project to be sure the file you need is included in the binary build or you will be surprised when you go to deploy, speaking from experience. If you need further help, the Equinox or OSGi newsgroups should be more helpful.
Cole
|
|
|
|
Powered by
FUDForum. Page generated in 0.07388 seconds