<dependency> <groupId>org.osgi.enroute.webresource.angular</groupId> <artifactId>org.osgi.enroute.webresource.angular</artifactId> <version>1.0.0</version> </dependency> properties Private-Package: com.example.mypackage Web-Resource-Include: / Web-Resource-Processor: \ org.osgi.enroute.webresource.angular.AngularWebResourceProcessor import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; class MyService { public void getResource(BundleContext bundleContext) { Bundle bundle = bundleContext.getBundle(1); String resourcePath = bundle.getResource("/path/to/resource"); InputStream resourceStream = getClass().getResourceAsStream(resourcePath); // ... } }


上一篇:
下一篇:
切换中文