summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/node-launcher-equinox/src/main/java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-02-20 20:10:37 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-02-20 20:10:37 +0000
commit3a8a64103bcc4891fb1a1f4cc4538f9d5b62a7ba (patch)
treeccd8919c277ad88c032acb3167fdd4645586cb07 /java/sca/modules/node-launcher-equinox/src/main/java
parent7b9fa54dced70baffa6578b0be902b06092584a7 (diff)
Start to implement the SCA policy framework 1.1 spec draft from OASIS OpenCSA
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@746356 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/node-launcher-equinox/src/main/java')
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
index 45870dd183..2a14657d21 100644
--- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
+++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
@@ -931,9 +931,22 @@ final class NodeLauncherUtil {
static Set<URL> manifestClassPath(URL jarFile) throws Exception {
Set<URL> urls = new HashSet<URL>();
if (jarFile != null) {
- JarInputStream jar = new JarInputStream(jarFile.openStream());
- Manifest mf = jar.getManifest();
- jar.close();
+ Manifest mf = null;
+ if ("file".equals(jarFile.getProtocol())) {
+ File f = file(jarFile);
+ if (f.isDirectory()) {
+ File mfFile = new File(f, "META-INF/MANIFEST.MF");
+ if (mfFile.isFile()) {
+ FileInputStream is = new FileInputStream(mfFile);
+ mf = new Manifest(is);
+ is.close();
+ }
+ } else if (f.isFile()) {
+ JarInputStream jar = new JarInputStream(jarFile.openStream());
+ mf = jar.getManifest();
+ jar.close();
+ }
+ }
if (mf != null) {
String cp = mf.getMainAttributes().getValue("Class-Path");
if (cp != null) {