Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2008-08-08 21:22:11 +0000
committerJohn Arthorne2008-08-08 21:22:11 +0000
commit5d785938d0a94a5fb44114379c00be11f40dc31c (patch)
treebf332326e323d87cb60b37ed8346bab4c85905c9
parent3e70e73c8ef5d46ae84f98ccfebe4a6c73589533 (diff)
downloadrt.equinox.p2-5d785938d0a94a5fb44114379c00be11f40dc31c.tar.gz
rt.equinox.p2-5d785938d0a94a5fb44114379c00be11f40dc31c.tar.xz
rt.equinox.p2-5d785938d0a94a5fb44114379c00be11f40dc31c.zip
Bug 243302 Get rid of simpleconfigurator.manipulator util package
-rw-r--r--bundles/org.eclipse.equinox.simpleconfigurator.manipulator/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/Activator.java19
-rw-r--r--bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorImpl.java39
-rw-r--r--bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorConstants.java29
4 files changed, 32 insertions, 60 deletions
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/META-INF/MANIFEST.MF
index 9eafe6c93..7b8991e3f 100644
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.equinox.simpleconfigurator.manipulator;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.0.100.qualifier
Bundle-Localization: plugin
Bundle-Activator: org.eclipse.equinox.internal.simpleconfigurator.manipulator.Activator
Eclipse-LazyStart: true
@@ -15,8 +15,7 @@ Import-Package: org.eclipse.equinox.internal.frameworkadmin.equinox,
org.osgi.service.startlevel;version="1.0.0",
org.osgi.util.tracker
Bundle-Vendor: %providerName
-Export-Package: org.eclipse.equinox.internal.simpleconfigurator.manipulator;x-friends:="org.eclipse.equinox.p2.touchpoint.eclipse",
- org.eclipse.equinox.internal.simpleconfigurator.utils;x-internal:=true
+Export-Package: org.eclipse.equinox.internal.simpleconfigurator.manipulator;x-friends:="org.eclipse.equinox.p2.touchpoint.eclipse"
Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0,
J2SE-1.4
Require-Bundle: org.eclipse.equinox.common;bundle-version="3.4.0"
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/Activator.java b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/Activator.java
index 651027e79..a318f5f9a 100644
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/Activator.java
+++ b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/Activator.java
@@ -1,19 +1,16 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
+ * Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.equinox.internal.simpleconfigurator.manipulator;
import java.util.Dictionary;
import java.util.Hashtable;
import org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulator;
-import org.eclipse.equinox.internal.simpleconfigurator.utils.SimpleConfiguratorConstants;
import org.osgi.framework.*;
import org.osgi.util.tracker.ServiceTracker;
@@ -30,8 +27,8 @@ public class Activator implements BundleActivator {
private void registerConfiguratorManipulator() {
Dictionary props = new Hashtable();
- props.put(ConfiguratorManipulator.SERVICE_PROP_KEY_CONFIGURATOR_BUNDLESYMBOLICNAME, SimpleConfiguratorConstants.SERVICE_PROP_VALUE_CONFIGURATOR_SYMBOLICNAME);
- props.put(Constants.SERVICE_VENDOR, "Eclipse.org");
+ props.put(ConfiguratorManipulator.SERVICE_PROP_KEY_CONFIGURATOR_BUNDLESYMBOLICNAME, SimpleConfiguratorManipulatorImpl.SERVICE_PROP_VALUE_CONFIGURATOR_SYMBOLICNAME);
+ props.put(Constants.SERVICE_VENDOR, "Eclipse.org"); //$NON-NLS-1$
manipulator = new SimpleConfiguratorManipulatorImpl();
registration = context.registerService(ConfiguratorManipulator.class.getName(), manipulator, props);
}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorImpl.java b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorImpl.java
index 3e3698793..821be0550 100644
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorImpl.java
+++ b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorImpl.java
@@ -1,12 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
+ * Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.equinox.internal.simpleconfigurator.manipulator;
@@ -20,7 +18,6 @@ import org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFilePa
import org.eclipse.equinox.internal.frameworkadmin.utils.Utils;
import org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulator;
import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.eclipse.equinox.internal.simpleconfigurator.utils.SimpleConfiguratorConstants;
import org.osgi.framework.Constants;
public class SimpleConfiguratorManipulatorImpl implements ConfiguratorManipulator {
@@ -32,13 +29,21 @@ public class SimpleConfiguratorManipulatorImpl implements ConfiguratorManipulato
private final static boolean DEBUG = false;
- static String CONFIG_LOCATION = SimpleConfiguratorConstants.CONFIG_LIST;
+ static String CONFIG_LOCATION = SimpleConfiguratorManipulatorImpl.CONFIG_LIST;
private static final String FILE_PROTOCOL = "file:"; //$NON-NLS-1$
private static final BundleInfo[] NULL_BUNDLEINFOS = new BundleInfo[0];
private Set manipulators = new HashSet();
+ public static final String PARAMETER_BASEURL = "org.eclipse.equinox.simpleconfigurator.baseUrl"; //$NON-NLS-1$
+ public static final String PROP_KEY_EXCLUSIVE_INSTALLATION = "org.eclipse.equinox.simpleconfigurator.exclusiveInstallation"; //$NON-NLS-1$
+ public static final String CONFIG_LIST = "bundles.info"; //$NON-NLS-1$
+ public static final String CONFIGURATOR_FOLDER = "org.eclipse.equinox.simpleconfigurator"; //$NON-NLS-1$
+ public static final String PROP_KEY_CONFIGURL = "org.eclipse.equinox.simpleconfigurator.configUrl"; //$NON-NLS-1$
+ public static final String TARGET_CONFIGURATOR_NAME = "org.eclipse.equinox.simpleconfigurator"; //$NON-NLS-1$
+ public static final String SERVICE_PROP_VALUE_CONFIGURATOR_SYMBOLICNAME = TARGET_CONFIGURATOR_NAME;
+
/**
* Return the ConfiguratorConfigLocation which is determined
* by the parameters set in Manipulator.
@@ -73,8 +78,8 @@ public class SimpleConfiguratorManipulatorImpl implements ConfiguratorManipulato
}
}
try {
- baseDir = new File(baseDir, SimpleConfiguratorConstants.CONFIGURATOR_FOLDER);
- File targetFile = new File(baseDir, SimpleConfiguratorConstants.CONFIG_LIST);
+ baseDir = new File(baseDir, SimpleConfiguratorManipulatorImpl.CONFIGURATOR_FOLDER);
+ File targetFile = new File(baseDir, SimpleConfiguratorManipulatorImpl.CONFIG_LIST);
try {
Utils.createParentDir(targetFile);
} catch (IOException e) {
@@ -137,7 +142,7 @@ public class SimpleConfiguratorManipulatorImpl implements ConfiguratorManipulato
private static boolean isTargetConfiguratorBundle(String location) {
final String symbolic = Utils.getPathFromClause(Utils.getManifestMainAttributes(location, Constants.BUNDLE_SYMBOLICNAME));
- return (SimpleConfiguratorConstants.SERVICE_PROP_VALUE_CONFIGURATOR_SYMBOLICNAME.equals(symbolic));
+ return (SimpleConfiguratorManipulatorImpl.SERVICE_PROP_VALUE_CONFIGURATOR_SYMBOLICNAME.equals(symbolic));
}
private void algorithm(int initialSl, SortedMap bslToList, BundleInfo configuratorBInfo, List setToInitialConfig, List setToSimpleConfig, LocationInfo info) {
@@ -337,8 +342,8 @@ public class SimpleConfiguratorManipulatorImpl implements ConfiguratorManipulato
// (expectedState is an integer).
//System.out.println("line=" + line);
- if (line.startsWith(SimpleConfiguratorConstants.PARAMETER_BASEURL + "=")) {
- String baseUrlSt = line.substring((SimpleConfiguratorConstants.PARAMETER_BASEURL + "=").length());
+ if (line.startsWith(SimpleConfiguratorManipulatorImpl.PARAMETER_BASEURL + "=")) {
+ String baseUrlSt = line.substring((SimpleConfiguratorManipulatorImpl.PARAMETER_BASEURL + "=").length());
if (!baseUrlSt.endsWith("/"))
baseUrlSt += "/";
baseUrl = new URL(url, baseUrlSt);
@@ -428,7 +433,7 @@ public class SimpleConfiguratorManipulatorImpl implements ConfiguratorManipulato
new IllegalStateException("configuratorConfigUrl should start with \"file\".\nconfiguratorConfigUrl=" + configuratorConfigUrl);
File outputFile = new File(configuratorConfigUrl.getFile());
saveConfiguration(setToSimpleConfig, outputFile, EquinoxFwConfigFileParser.getOSGiInstallArea(manipulator.getLauncherData()), backup);
- configData.setFwIndependentProp(SimpleConfiguratorConstants.PROP_KEY_CONFIGURL, outputFile.toURL().toExternalForm());
+ configData.setFwIndependentProp(SimpleConfiguratorManipulatorImpl.PROP_KEY_CONFIGURL, outputFile.toURL().toExternalForm());
return orderingInitialConfig(setToInitialConfig);
}
@@ -629,7 +634,7 @@ public class SimpleConfiguratorManipulatorImpl implements ConfiguratorManipulato
}
Utils.appendProperties(properties, manipulator.getConfigData().getFwIndependentProps());
- boolean exclusiveInstallation = Boolean.valueOf(properties.getProperty(SimpleConfiguratorConstants.PROP_KEY_EXCLUSIVE_INSTALLATION)).booleanValue();
+ boolean exclusiveInstallation = Boolean.valueOf(properties.getProperty(SimpleConfiguratorManipulatorImpl.PROP_KEY_EXCLUSIVE_INSTALLATION)).booleanValue();
URL configuratorConfigUrl = getConfigLocation(manipulator);
BundleInfo[] toInstall = this.loadConfiguration(configuratorConfigUrl, EquinoxFwConfigFileParser.getOSGiInstallArea(manipulator.getLauncherData()));
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorConstants.java b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorConstants.java
deleted file mode 100644
index 2b0d81443..000000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorConstants.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.simpleconfigurator.utils;
-
-
-/**
- * Copied from org.eclipse.equinox.simpleconfigurator.
- *
- */
-public class SimpleConfiguratorConstants {
- public static final String PARAMETER_BASEURL = "org.eclipse.equinox.simpleconfigurator.baseUrl";
- public static final String PROP_KEY_EXCLUSIVE_INSTALLATION = "org.eclipse.equinox.simpleconfigurator.exclusiveInstallation";
-
- public static final String LAST_CONFIG_STAMP = "last.config.stamps"; //$NON-NLS-1$
- public static final String CONFIG_LIST = "bundles.info"; //$NON-NLS-1$
- public static final String CONFIGURATOR_FOLDER = "org.eclipse.equinox.simpleconfigurator"; //$NON-NLS-1$
- public static final String CONFIG_INI = "config.ini"; //$NON-NLS-1$
- public static final String PROP_KEY_CONFIGURL = "org.eclipse.equinox.simpleconfigurator.configUrl";
- public static final String TARGET_CONFIGURATOR_NAME = "org.eclipse.equinox.simpleconfigurator";
- public static final String SERVICE_PROP_VALUE_CONFIGURATOR_SYMBOLICNAME = TARGET_CONFIGURATOR_NAME;
-}

Back to the top