Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2007-10-12 20:47:36 +0000
committerJohn Arthorne2007-10-12 20:47:36 +0000
commit347ec35768b80514d967b24fe831a674c1d84476 (patch)
tree361d809f92341eedebd6d26ecfdf5b87c21067a6 /bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/frameworkadmin/equinox/internal/EquinoxFwConfigFileParser.java
parentdd907868a8a7aa4f6dbe3480e65e115ff5151231 (diff)
downloadrt.equinox.p2-347ec35768b80514d967b24fe831a674c1d84476.tar.gz
rt.equinox.p2-347ec35768b80514d967b24fe831a674c1d84476.tar.xz
rt.equinox.p2-347ec35768b80514d967b24fe831a674c1d84476.zip
Bug 206202 First pass cleanup of equinox impl of framework admin
Diffstat (limited to 'bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/frameworkadmin/equinox/internal/EquinoxFwConfigFileParser.java')
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/frameworkadmin/equinox/internal/EquinoxFwConfigFileParser.java53
1 files changed, 18 insertions, 35 deletions
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/frameworkadmin/equinox/internal/EquinoxFwConfigFileParser.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/frameworkadmin/equinox/internal/EquinoxFwConfigFileParser.java
index 9097ee9e3..8b5a39ac6 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/frameworkadmin/equinox/internal/EquinoxFwConfigFileParser.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/frameworkadmin/equinox/internal/EquinoxFwConfigFileParser.java
@@ -31,14 +31,11 @@ public class EquinoxFwConfigFileParser {
KEY_OSGI_FRAMEWORK, //
KEY_ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR_CONFIGURL, //
KEY_ECLIPSE_PROV_DATA_AREA};
- private static final String[] URL_ARRAYS = new String[] {KEY_OSGI_BUNDLES, KEY_OSGI_BUNDLES_EXTRA_DATA};
private static boolean DEBUG = false;
- private final BundleContext context;
private static String USE_REFERENCE_STRING = null;
public EquinoxFwConfigFileParser(BundleContext context) {
- this.context = context;
if (context != null)
USE_REFERENCE_STRING = context.getProperty(EquinoxConstants.PROP_KEY_USE_REFERENCE);
@@ -105,11 +102,11 @@ public class EquinoxFwConfigFileParser {
// TODO I just added this "if" stmt because we were seeing an extra slash
// appearing in the resulting URL. was this the right thing to do? the indexes
// seem off in the loop below. (I'm on linux if that makes a difference)
-// if (!fwJarSt.startsWith("file:")) {
-// if (fwJarSt.length() > 5 && fwJarSt.charAt(4) != '/') {
-// fwJarSt = "file:/" + fwJarUrl.getFile();
-// }
-// }
+ // if (!fwJarSt.startsWith("file:")) {
+ // if (fwJarSt.length() > 5 && fwJarSt.charAt(4) != '/') {
+ // fwJarSt = "file:/" + fwJarUrl.getFile();
+ // }
+ // }
props.setProperty(EquinoxConstants.PROP_OSGI_FW, fwJarSt /* fwJar.getAbsolutePath() */);
}
@@ -148,12 +145,10 @@ public class EquinoxFwConfigFileParser {
}
private static boolean getMarkedAsStartedFormat(String msg, String original) {
- //boolean ret = false;
if (msg == null)
return false;
msg = msg.trim();
if (msg.equals("start")) {
- //ret = true;
return true;
}
if (!msg.equals(""))
@@ -180,23 +175,22 @@ public class EquinoxFwConfigFileParser {
// TODO Auto-generated catch block
e.printStackTrace();
}
-// location = location.substring("file:".length());
-// if (!location.startsWith("/"))
-// location = "/" + location;
-// // if (fwJarSt != null)
-// // if (fwJarSt.equals(location))
-// // continue;
-// location = Utils.replaceAll(location, File.separator, "/");
-// //String jarName = location.substring(location.lastIndexOf("/") + 1);
-// // if (jarName.startsWith(EquinoxConstants.FW_JAR_PLUGIN_NAME))
-// // continue;
-// bInfo.setLocation("file:" + location);
-// }
+ // location = location.substring("file:".length());
+ // if (!location.startsWith("/"))
+ // location = "/" + location;
+ // // if (fwJarSt != null)
+ // // if (fwJarSt.equals(location))
+ // // continue;
+ // location = Utils.replaceAll(location, File.separator, "/");
+ // //String jarName = location.substring(location.lastIndexOf("/") + 1);
+ // // if (jarName.startsWith(EquinoxConstants.FW_JAR_PLUGIN_NAME))
+ // // continue;
+ // bInfo.setLocation("file:" + location);
+ // }
}
/**
* @param value
- * @throws ManipulatorException
*/
private static void setInstallingBundles(Manipulator manipulator, String value) throws NumberFormatException {
ConfigData configData = manipulator.getConfigData();
@@ -231,26 +225,16 @@ public class EquinoxFwConfigFileParser {
int indexJ = slAndFlag.indexOf(":");
if (indexJ == -1) {
markedAsStarted = getMarkedAsStartedFormat(slAndFlag, token);
- // 3 or start
- // try {
- //startLevel = Integer.parseInt(slAndFlag);
configData.addBundle(new BundleInfo(location, markedAsStarted));
continue;
- // } catch (NumberFormatException nfe) {
- // throw new ManipulatorException("Invalid Format of bInfoStrings[" + i + "]=" + bInfoStrings[i], nfe, ManipulatorException.OTHERS);
- // }
} else if (indexJ == 0) {
markedAsStarted = getMarkedAsStartedFormat(slAndFlag.substring(indexJ + ":".length()), token);
configData.addBundle(new BundleInfo(location, startLevel, markedAsStarted));
continue;
}
- // try {
startLevel = Integer.parseInt(slAndFlag.substring(0, indexJ));
markedAsStarted = getMarkedAsStartedFormat(slAndFlag.substring(indexJ + ":".length()), bInfoStrings[i]);
configData.addBundle(new BundleInfo(location, startLevel, markedAsStarted));
- // } catch (NumberFormatException nfe) {
- // throw new ManipulatorException("Invalid Format of bInfoStrings[" + i + "]=" + bInfoStrings[i], nfe, ManipulatorException.OTHERS);
- // }
}
}
}
@@ -270,7 +254,7 @@ public class EquinoxFwConfigFileParser {
/**
* inputFile must be not a directory but a file.
*
- * @param configData
+ * @param manipulator
* @param inputFile
* @throws IOException
*/
@@ -461,7 +445,6 @@ public class EquinoxFwConfigFileParser {
try {
out.flush();
out.close();
- // Log.log(LogService.LOG_INFO, "out is closed successfully.");
} catch (IOException e) {
e.printStackTrace();
}

Back to the top