This commit was manufactured by cvs2svn to create tag
'preQueryAPI-20091215'.
Sprout from R3_6_api_cleanup 2009-12-12 00:07:51 UTC Thomas Hallgren <thallgren> 'Bug 294691 - Create a QueryLanguage for p2 (attachment 153914)'
Cherrypick from master 2009-12-12 00:19:20 UTC Thomas Hallgren <thallgren> 'Bug 294691 - Create a QueryLanguage for p2 (attachment 153914)':
bundles/org.eclipse.equinox.p2.ql/.classpath
bundles/org.eclipse.equinox.p2.ql/.project
bundles/org.eclipse.equinox.p2.ql/.settings/org.eclipse.core.resources.prefs
bundles/org.eclipse.equinox.p2.ql/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.equinox.p2.ql/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.equinox.p2.ql/META-INF/MANIFEST.MF
bundles/org.eclipse.equinox.p2.ql/about.html
bundles/org.eclipse.equinox.p2.ql/build.properties
bundles/org.eclipse.equinox.p2.ql/model/p2ql.bnf
bundles/org.eclipse.equinox.p2.ql/plugin.properties
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/CapabilityIndex.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/Everything.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/FlattenIterator.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/IRepeatableIterator.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/MatchIteratorFilter.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/MultiVariableContext.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/ParameterContext.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/QLActivator.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/QueryContext.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/RepeatableIterator.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/SingleVariableContext.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/TranslationSupport.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/All.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/And.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Array.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Assignment.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/At.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Binary.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/BooleanFunction.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/CapabilityIndexFunction.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/ClassFunction.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Collect.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/CollectionFilter.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Compare.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Condition.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Constant.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/ContextExpression.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Equals.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Exists.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Expression.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/ExpressionFactory.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/FilterFunction.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/First.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Flatten.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Function.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/LambdaExpression.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Latest.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Limit.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/MatchExpression.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Matches.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Member.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/NAry.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Not.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Or.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Parameter.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/RangeFunction.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Select.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/SetFunction.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Traverse.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Unary.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/UnaryCollectionFilter.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Unique.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Variable.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/VersionFunction.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/WrappedIQuery.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/parser/ExpressionParser.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/parser/IParserConstants.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/ICapabilityIndex.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IContextExpression.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IEvaluationContext.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpression.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpressionFactory.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpressionParser.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpressionVisitor.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IMatchExpression.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IQueryContext.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/ITranslationSupport.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QL.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLContextQuery.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLMatchQuery.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLParseException.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLQuery.java
bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/SimplePattern.java
Delete:
bundles/org.eclipse.equinox.frameworkadmin.equinox/.classpath
bundles/org.eclipse.equinox.frameworkadmin.equinox/.project
bundles/org.eclipse.equinox.frameworkadmin.equinox/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.equinox.frameworkadmin.equinox/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.equinox.frameworkadmin.equinox/.settings/org.eclipse.pde.core.prefs
bundles/org.eclipse.equinox.frameworkadmin.equinox/META-INF/MANIFEST.MF
bundles/org.eclipse.equinox.frameworkadmin.equinox/OSGI-INF/fwadmin.xml
bundles/org.eclipse.equinox.frameworkadmin.equinox/about.html
bundles/org.eclipse.equinox.frameworkadmin.equinox/build.properties
bundles/org.eclipse.equinox.frameworkadmin.equinox/plugin.properties
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherImpl.java
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherParser.java
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxBundlesState.java
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxConstants.java
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxFrameworkAdminFactoryImpl.java
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxFwAdminImpl.java
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxFwConfigFileParser.java
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxLauncherData.java
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/Log.java
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/Messages.java
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/ParserUtils.java
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/messages.properties
bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/utils/FileUtils.java
bundles/org.eclipse.equinox.frameworkadmin.test/.classpath
bundles/org.eclipse.equinox.frameworkadmin.test/.project
bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.pde.core.prefs
bundles/org.eclipse.equinox.frameworkadmin.test/Framework Admin Test.launch
bundles/org.eclipse.equinox.frameworkadmin.test/META-INF/MANIFEST.MF
bundles/org.eclipse.equinox.frameworkadmin.test/about.html
bundles/org.eclipse.equinox.frameworkadmin.test/build.properties
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/bundle_1/META-INF/MANIFEST.MF
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/bundle_2/META-INF/MANIFEST.MF
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/dummy.frameworkextension_1.0.0.jar
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.equinox.launcher.jar
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.equinox.simpleconfigurator.jar
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.osgi.jar
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.osgi_3.4.0.jar
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest1/conf/config.ini
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest1/eclipse.ini
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest3/configuration/config.ini
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest3/eclipse.ini
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug267850/conf/config.ini
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug267850/eclipse.ini
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/conf/config.ini
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/eclipse.ini
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/sharedconfiguration/config.ini
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/sharedconfiguration/user-config.ini
bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/sharedconfiguration/user-noshare-config.ini
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AbstractFwkAdminTest.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Activator.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AllTests.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug196525.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug258370.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/CleanupTest.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/FrameworkExtensionTest.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/FwkAdminAndSimpleConfiguratorTest.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/LauncherConfigLocationTest.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/LauncherDataTest.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/MacOSLikeSetup.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ManipulatorTests.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/NoConfigurationValueInEclipseIni.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/NoRenamingLauncherIni.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/OSGiVersionChange.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest1.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest2.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest3.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest4.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest5.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug267850.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug285935.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RelativePathTest.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingABundle.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingAllBundles.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RenamingLauncherIni.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SharedConfigurationTest.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorComingAndGoing.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorTest.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestEclipseDataArea.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestRunningInstance.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestVMArg.java
bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/UtilsTest.java
bundles/org.eclipse.equinox.frameworkadmin/.classpath
bundles/org.eclipse.equinox.frameworkadmin/.project
bundles/org.eclipse.equinox.frameworkadmin/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.equinox.frameworkadmin/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.equinox.frameworkadmin/META-INF/MANIFEST.MF
bundles/org.eclipse.equinox.frameworkadmin/about.html
bundles/org.eclipse.equinox.frameworkadmin/build.properties
bundles/org.eclipse.equinox.frameworkadmin/plugin.properties
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Activator.java
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/SimpleBundlesState.java
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Utils.java
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/configuratormanipulator/ConfiguratorManipulator.java
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/configuratormanipulator/ConfiguratorManipulatorFactory.java
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/BundleInfo.java
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/BundlesState.java
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/ConfigData.java
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdmin.java
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminFactory.java
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminRuntimeException.java
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/LauncherData.java
bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/Manipulator.java
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.classpath
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.cvsignore
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.project
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/META-INF/MANIFEST.MF
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/OSGI-INF/configurator.xml
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/about.html
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/build.properties
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/plugin.properties
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/provisional/simpleconfigurator/manipulator/SimpleConfiguratorManipulator.java
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorFactoryImpl.java
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorImpl.java
bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java
bundles/org.eclipse.equinox.simpleconfigurator/.classpath
bundles/org.eclipse.equinox.simpleconfigurator/.cvsignore
bundles/org.eclipse.equinox.simpleconfigurator/.externalToolBuilders/Copy built version of simple configurator into metadata generator.launch
bundles/org.eclipse.equinox.simpleconfigurator/.project
bundles/org.eclipse.equinox.simpleconfigurator/.settings/org.eclipse.jdt.core.prefs
bundles/org.eclipse.equinox.simpleconfigurator/.settings/org.eclipse.jdt.ui.prefs
bundles/org.eclipse.equinox.simpleconfigurator/META-INF/MANIFEST.MF
bundles/org.eclipse.equinox.simpleconfigurator/about.html
bundles/org.eclipse.equinox.simpleconfigurator/build.properties
bundles/org.eclipse.equinox.simpleconfigurator/localbuild.xml
bundles/org.eclipse.equinox.simpleconfigurator/plugin.properties
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/provisional/configurator/Configurator.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/Activator.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorFactory.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorImpl.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/console/ApplyCommand.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/console/ConfiguratorCommandProvider.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/BundleInfo.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/EquinoxUtils.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorConstants.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/StateResolverUtils.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/URIUtil.java
bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/Utils.java
examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/.cvsignore
examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/.project
examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/Build Cloud Example.launch
examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/build.properties
examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/buildProduct.xml
examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/readme.txt
examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/.project
examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/Build PrestartUpdate Example.launch
examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/build.properties
examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/buildProduct.xml
examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/readme.txt
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.classpath
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.project
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/META-INF/MANIFEST.MF
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/build.properties
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/mail.ico
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.gif
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.icns
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample2.gif
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample3.gif
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/p2.inf
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/plugin.xml
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/product_lg.gif
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/sdknoautoupdates.product
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/splash.bmp
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Activator.java
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Application.java
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationActionBarAdvisor.java
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchAdvisor.java
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchWindowAdvisor.java
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ICommandIds.java
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/MessagePopupAction.java
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/NavigationView.java
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/OpenViewAction.java
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Perspective.java
examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/View.java
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/.classpath
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/.project
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/.settings/org.eclipse.jdt.core.prefs
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/META-INF/MANIFEST.MF
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/build.properties
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/mail.ico
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample.gif
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample.icns
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample2.gif
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample3.gif
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/p2.inf
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/plugin.xml
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/product_lg.gif
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/sdkui.product
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/splash.bmp
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Activator.java
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Application.java
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationActionBarAdvisor.java
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchAdvisor.java
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchWindowAdvisor.java
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ICommandIds.java
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/MessagePopupAction.java
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/NavigationView.java
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/OpenViewAction.java
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Perspective.java
examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/View.java
features/org.eclipse.equinox.p2.sdk/.project
features/org.eclipse.equinox.p2.sdk/build.properties
features/org.eclipse.equinox.p2.sdk/epl-v10.html
features/org.eclipse.equinox.p2.sdk/feature.properties
features/org.eclipse.equinox.p2.sdk/feature.xml
features/org.eclipse.equinox.p2.sdk/license.html
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/.classpath b/bundles/org.eclipse.equinox.frameworkadmin.equinox/.classpath
deleted file mode 100644
index 6f3b481..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/.project b/bundles/org.eclipse.equinox.frameworkadmin.equinox/.project
deleted file mode 100644
index 256472c..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/.project
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.equinox.frameworkadmin.equinox</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ds.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.frameworkadmin.equinox/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index f847166..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,340 +0,0 @@
-#Wed Jan 23 10:00:41 EST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.3
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=false
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
-org.eclipse.jdt.core.formatter.comment.format_line_comments=false
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=800
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.equinox.frameworkadmin.equinox/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index 51a3350..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Tue Nov 21 00:29:05 EST 2006
-eclipse.preferences.version=1
-pluginProject.equinox=false
-pluginProject.extensions=false
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.frameworkadmin.equinox/META-INF/MANIFEST.MF
deleted file mode 100644
index 40cd58e..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,27 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.equinox.frameworkadmin.equinox;singleton:=true
-Bundle-Version: 1.0.200.qualifier
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Import-Package: org.eclipse.core.runtime.internal.adaptor,
- org.eclipse.equinox.internal.frameworkadmin.utils,
- org.eclipse.equinox.internal.provisional.configuratormanipulator,
- org.eclipse.equinox.internal.provisional.frameworkadmin,
- org.eclipse.osgi.framework.internal.core,
- org.eclipse.osgi.service.datalocation;version="1.0.0";resolution:=optional,
- org.eclipse.osgi.service.environment;version="1.0.0";resolution:=optional,
- org.eclipse.osgi.service.resolver;version="1.1.0";resolution:=optional,
- org.eclipse.osgi.util;version="1.1.0",
- org.osgi.framework;version="1.3.0",
- org.osgi.service.log;version="1.3.0",
- org.osgi.service.startlevel;version="1.0.0",
- org.osgi.util.tracker;version="1.3.0"
-Export-Package: org.eclipse.equinox.internal.frameworkadmin.equinox;x-friends:="org.eclipse.equinox.p2.publisher,org.eclipse.equinox.p2.metadata.generator",
- org.eclipse.equinox.internal.frameworkadmin.equinox.utils;x-internal:=true
-Require-Bundle: org.eclipse.equinox.common
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
-Service-Component: OSGI-INF/fwadmin.xml
-Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/OSGI-INF/fwadmin.xml b/bundles/org.eclipse.equinox.frameworkadmin.equinox/OSGI-INF/fwadmin.xml
deleted file mode 100644
index e3f045a..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/OSGI-INF/fwadmin.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.equinox.frameworkadmin.equinox">
- <implementation class="org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwAdminImpl"/>
- <service>
- <provide interface="org.eclipse.equinox.internal.provisional.frameworkadmin.FrameworkAdmin"/>
- </service>
- <property name="org.eclipse.equinox.frameworkhandler.framework.name" type="String" value="Equinox"/>
- <property name="org.eclipse.equinox.frameworkhandler.framework.version" type="String" value="3.3"/>
- <property name="org.eclipse.equinox.frameworkhandler.launcher.name" type="String" value="Eclipse.exe"/>
- <property name="org.eclipse.equinox.frameworkhandler.launcher.version" type="String" value="3.2"/>
- <reference bind="setStartLevel" cardinality="1..1" interface="org.osgi.service.startlevel.StartLevel" name="StartLevel" policy="static"/>
- <reference bind="setPlatformAdmin" cardinality="1..1" interface="org.eclipse.osgi.service.resolver.PlatformAdmin" name="PlatformAdmin" policy="static"/>
-</scr:component>
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/about.html b/bundles/org.eclipse.equinox.frameworkadmin.equinox/about.html
deleted file mode 100644
index 4602330..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/build.properties b/bundles/org.eclipse.equinox.frameworkadmin.equinox/build.properties
deleted file mode 100644
index db8ea72..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html,\
- plugin.properties,\
- OSGI-INF/
-src.includes = about.html
-source.. = src/
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/plugin.properties b/bundles/org.eclipse.equinox.frameworkadmin.equinox/plugin.properties
deleted file mode 100644
index 121a7e4..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2009 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
-###############################################################################
-pluginName = Equinox Framework Admin for Equinox
-providerName = Eclipse.org - Equinox
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherImpl.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherImpl.java
deleted file mode 100644
index 8058023..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.equinox;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.LinkedList;
-import java.util.List;
-import org.eclipse.equinox.internal.frameworkadmin.utils.SimpleBundlesState;
-import org.eclipse.equinox.internal.frameworkadmin.utils.Utils;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.service.log.LogService;
-
-public class EclipseLauncherImpl {
- static String getStringOfCmd(String[] cmdarray) {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < cmdarray.length; i++) {
- sb.append(cmdarray[i]);
- sb.append(" "); //$NON-NLS-1$
- }
- return sb.toString();
- }
-
- EquinoxFwAdminImpl fwAdmin = null;
-
- EclipseLauncherImpl(EquinoxFwAdminImpl fwAdmin) {
- this.fwAdmin = fwAdmin;
- }
-
- public Process launch(Manipulator manipulator, File cwd) throws IllegalArgumentException, IOException, FrameworkAdminRuntimeException {
- SimpleBundlesState.checkAvailability(fwAdmin);
- Log.log(LogService.LOG_DEBUG, this, "launch(Manipulator , File )", ""); //$NON-NLS-1$ //$NON-NLS-2$
- LauncherData launcherData = manipulator.getLauncherData();
- if (launcherData.getLauncher() == null)
- return launchInMemory(manipulator, cwd);
- return launchByLauncher(manipulator, cwd);
- }
-
- private Process launchByLauncher(Manipulator manipulator, File cwd) throws IOException {
- LauncherData launcherData = manipulator.getLauncherData();
-
- if (launcherData.getLauncher() == null)
- throw new IllegalStateException(Messages.exception_launcherLocationNotSet);
- String[] cmdarray = new String[] {launcherData.getLauncher().getAbsolutePath()};
- if (cwd == null)
- cwd = launcherData.getLauncher().getParentFile();
- Process process = Runtime.getRuntime().exec(cmdarray, null, cwd);
- Log.log(LogService.LOG_DEBUG, "\t" + getStringOfCmd(cmdarray)); //$NON-NLS-1$
- return process;
- }
-
- private Process launchInMemory(Manipulator manipulator, File cwd) throws IOException {
- LauncherData launcherData = manipulator.getLauncherData();
- Utils.checkAbsoluteFile(launcherData.getFwJar(), "fwJar"); //$NON-NLS-1$
- Utils.checkAbsoluteDir(cwd, "cwd"); //$NON-NLS-1$
-
- List cmdList = new LinkedList();
- if (launcherData.getJvm() != null)
- cmdList.add(launcherData.getJvm().getAbsolutePath());
- else
- cmdList.add("java"); //$NON-NLS-1$
-
- if (launcherData.getJvmArgs() != null)
- for (int i = 0; i < launcherData.getJvmArgs().length; i++)
- cmdList.add(launcherData.getJvmArgs()[i]);
-
- cmdList.add("-jar"); //$NON-NLS-1$
- cmdList.add(Utils.getRelativePath(launcherData.getFwJar(), cwd));
-
- EquinoxManipulatorImpl.checkConsistencyOfFwConfigLocAndFwPersistentDataLoc(launcherData);
- cmdList.add(EquinoxConstants.OPTION_CONFIGURATION);
- cmdList.add(Utils.getRelativePath(launcherData.getFwPersistentDataLocation(), cwd));
-
- if (launcherData.isClean())
- cmdList.add(EquinoxConstants.OPTION_CLEAN);
-
- String[] cmdarray = new String[cmdList.size()];
- cmdList.toArray(cmdarray);
- Log.log(LogService.LOG_DEBUG, "In CWD = " + cwd + "\n\t" + getStringOfCmd(cmdarray)); //$NON-NLS-1$ //$NON-NLS-2$
- Process process = Runtime.getRuntime().exec(cmdarray, null, cwd);
- return process;
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherParser.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherParser.java
deleted file mode 100644
index d1ac79d..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherParser.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.frameworkadmin.equinox;
-
-import java.io.*;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.*;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.utils.FileUtils;
-import org.eclipse.equinox.internal.frameworkadmin.utils.Utils;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.FrameworkAdminRuntimeException;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.LauncherData;
-import org.eclipse.osgi.util.NLS;
-import org.osgi.service.log.LogService;
-
-public class EclipseLauncherParser {
- private static final String MAC_OS_APP_FOLDER = ".app/Contents/MacOS"; //$NON-NLS-1$
- private static final String CONFIGURATION_FOLDER = "configuration"; //$NON-NLS-1$
-
- //this figures out the location of the data area on partial data read from the <eclipse>.ini
- private URI getOSGiInstallArea(List lines, URI base) {
- File osgiInstallArea = ParserUtils.getOSGiInstallArea(lines, null, base);
- if (osgiInstallArea != null)
- return URIUtil.makeAbsolute(osgiInstallArea.toURI(), base);
- return null;
- }
-
- private void setInstall(List lines, LauncherData launcherData, File launcherFolder) {
- if (launcherData.getFwConfigLocation() == null || launcherData.getFwJar() == null) {
- ParserUtils.removeArgument(EquinoxConstants.OPTION_INSTALL, lines);
- return;
- }
- String launcherString = launcherFolder.getAbsolutePath().replace('\\', '/');
- if (launcherString.endsWith(MAC_OS_APP_FOLDER)) {
- //We can do 3 calls to getParentFile without checking because
- launcherFolder = launcherFolder.getParentFile().getParentFile().getParentFile();
- }
- if (!ParserUtils.fromOSGiJarToOSGiInstallArea(launcherData.getFwJar().getAbsolutePath()).equals(launcherFolder)) {
- ParserUtils.setValueForArgument(EquinoxConstants.OPTION_INSTALL, launcherFolder.getAbsolutePath().replace('\\', '/'), lines);
- }
- }
-
- void read(File launcherConfigFile, LauncherData launcherData) throws IOException {
- if (!launcherConfigFile.exists())
- return;
-
- List lines = FileUtils.loadFile(launcherConfigFile);
-
- URI launcherFolder = launcherData.getLauncher().getParentFile().toURI();
- getStartup(lines, launcherFolder);
- getFrameworkJar(lines, launcherFolder, launcherData);
- URI osgiInstallArea = getOSGiInstallArea(lines, launcherFolder);
- if (osgiInstallArea == null) {
- osgiInstallArea = launcherData.getFwJar() != null ? ParserUtils.fromOSGiJarToOSGiInstallArea(launcherData.getFwJar().getAbsolutePath()).toURI() : launcherFolder;
- }
- URI configArea = getConfigurationLocation(lines, osgiInstallArea, launcherData);
- if (configArea == null)
- throw new FrameworkAdminRuntimeException(Messages.exception_nullConfigArea, ""); //$NON-NLS-1$
- getPersistentDataLocation(lines, osgiInstallArea, configArea, launcherData);
- getLauncherLibrary(lines, launcherFolder);
- getJVMArgs(lines, launcherData);
- getProgramArgs(lines, launcherData);
- getVM(lines, launcherFolder, launcherData);
-
- Log.log(LogService.LOG_INFO, NLS.bind(Messages.log_configFile, launcherConfigFile.getAbsolutePath()));
- }
-
- private void getFrameworkJar(List lines, URI launcherFolder, LauncherData launcherData) {
- File fwJar = launcherData.getFwJar();
- if (fwJar != null)
- return;
- URI location = ParserUtils.getFrameworkJar(lines, launcherFolder);
- if (location != null)
- launcherData.setFwJar(URIUtil.toFile(location));
- }
-
- private void getPersistentDataLocation(List lines, URI osgiInstallArea, URI configArea, LauncherData launcherData) {
- //TODO The setting of the -clean could only do properly once config.ini has been read
- if (launcherData.getFwPersistentDataLocation() == null) {
- launcherData.setFwPersistentDataLocation(URIUtil.toFile(configArea), ParserUtils.isArgumentSet(EquinoxConstants.OPTION_CLEAN, lines));
- }
- }
-
- private void getVM(List lines, URI launcherFolder, LauncherData launcherData) {
- String vm = ParserUtils.getValueForArgument(EquinoxConstants.OPTION_VM, lines);
- if (vm == null)
- return;
-
- URI VMFullPath;
- try {
- VMFullPath = URIUtil.makeAbsolute(FileUtils.fromPath(vm), launcherFolder);
- launcherData.setJvm(URIUtil.toFile(VMFullPath));
- ParserUtils.setValueForArgument(EquinoxConstants.OPTION_VM, VMFullPath.toString(), lines);
- } catch (URISyntaxException e) {
- Log.log(LogService.LOG_ERROR, NLS.bind(Messages.log_failed_make_absolute, vm));
- return;
- }
- }
-
- private void setVM(List lines, File vm, URI launcherFolder) {
- if (vm == null) {
- ParserUtils.removeArgument(EquinoxConstants.OPTION_VM, lines);
- return;
- }
- URI VMRelativePath = launcherFolder.relativize(vm.toURI());
- ParserUtils.setValueForArgument(EquinoxConstants.OPTION_VM, FileUtils.toPath(VMRelativePath).replace('\\', '/'), lines);
- }
-
- private void getJVMArgs(List lines, LauncherData launcherData) {
- ArrayList vmargs = new ArrayList(lines.size());
- boolean foundVmArgs = false;
- for (Iterator iterator = lines.iterator(); iterator.hasNext();) {
- String line = (String) iterator.next();
- if (!foundVmArgs) {
- if (EquinoxConstants.OPTION_VMARGS.equals(line))
- foundVmArgs = true;
- continue;
- }
- vmargs.add(line);
- }
-
- launcherData.setJvmArgs(null);
- launcherData.setJvmArgs((String[]) vmargs.toArray(new String[vmargs.size()]));
- }
-
- private void setJVMArgs(List lines, LauncherData launcherData) {
- ParserUtils.removeArgument(EquinoxConstants.OPTION_VMARGS, lines);
- if (launcherData.getJvmArgs() == null || launcherData.getJvmArgs().length == 0)
- return;
- String[] args = launcherData.getJvmArgs();
- lines.add(EquinoxConstants.OPTION_VMARGS);
- for (int i = 0; i < args.length; i++) {
- lines.add(args[i]);
- }
- }
-
- private void getProgramArgs(List lines, LauncherData launcherData) {
- ArrayList args = new ArrayList(lines.size());
- for (Iterator iterator = lines.iterator(); iterator.hasNext();) {
- String line = (String) iterator.next();
- if (EquinoxConstants.OPTION_VMARGS.equals(line))
- break;
- args.add(line);
- }
- launcherData.setProgramArgs(null);
- launcherData.setProgramArgs((String[]) args.toArray(new String[args.size()]));
- }
-
- private URI getLauncherLibrary(List lines, URI launcherFolder) {
- String launcherLibrary = ParserUtils.getValueForArgument(EquinoxConstants.OPTION_LAUNCHER_LIBRARY, lines);
- if (launcherLibrary == null)
- return null;
- URI result = null;
- try {
- result = URIUtil.makeAbsolute(FileUtils.fromPath(launcherLibrary), launcherFolder);
- ParserUtils.setValueForArgument(EquinoxConstants.OPTION_LAUNCHER_LIBRARY, result.toString(), lines);
- } catch (URISyntaxException e) {
- Log.log(LogService.LOG_ERROR, NLS.bind(Messages.log_failed_make_absolute, launcherLibrary));
- return null;
- }
- return result;
- }
-
- private void setLauncherLibrary(List lines, URI launcherFolder) {
- String launcherLibrary = ParserUtils.getValueForArgument(EquinoxConstants.OPTION_LAUNCHER_LIBRARY, lines);
- if (launcherLibrary == null)
- return;
-
- try {
- URI result = URIUtil.makeRelative(FileUtils.fromPath(launcherLibrary), launcherFolder);
- ParserUtils.setValueForArgument(EquinoxConstants.OPTION_LAUNCHER_LIBRARY, FileUtils.toPath(result).replace('\\', '/'), lines);
- } catch (URISyntaxException e) {
- Log.log(LogService.LOG_ERROR, NLS.bind(Messages.log_failed_make_absolute, launcherLibrary));
- return;
- }
- }
-
- private URI getConfigurationLocation(List lines, URI osgiInstallArea, LauncherData data) {
- String configuration = ParserUtils.getValueForArgument(EquinoxConstants.OPTION_CONFIGURATION, lines);
- if (configuration == null)
- try {
- return URIUtil.makeAbsolute(new URI(CONFIGURATION_FOLDER), osgiInstallArea);
- } catch (URISyntaxException e1) {
- //ignore
- }
-
- URI result = null;
- try {
- result = URIUtil.makeAbsolute(FileUtils.fromPath(configuration), osgiInstallArea);
- ParserUtils.setValueForArgument(EquinoxConstants.OPTION_CONFIGURATION, result.toString(), lines);
- data.setFwConfigLocation(URIUtil.toFile(result));
- } catch (URISyntaxException e) {
- Log.log(LogService.LOG_ERROR, NLS.bind(Messages.log_failed_make_absolute, configuration));
- return null;
- }
- return result;
- }
-
- private void setConfigurationLocation(List lines, URI osgiInstallArea, LauncherData data) {
- String result = FileUtils.toPath(URIUtil.makeRelative(data.getFwConfigLocation().toURI(), osgiInstallArea));
- //We don't write the default
- if (CONFIGURATION_FOLDER.equals(result)) {
- if (ParserUtils.getValueForArgument(EquinoxConstants.OPTION_CONFIGURATION, lines) != null)
- ParserUtils.removeArgument(EquinoxConstants.OPTION_CONFIGURATION, lines);
- return;
- }
-
- if (ParserUtils.getValueForArgument(EquinoxConstants.OPTION_CONFIGURATION, lines) == null) {
- ParserUtils.setValueForArgument(EquinoxConstants.OPTION_CONFIGURATION, result.replace('\\', '/'), lines);
- }
- return;
- }
-
- private URI getStartup(List lines, URI launcherFolder) {
- String startup = ParserUtils.getValueForArgument(EquinoxConstants.OPTION_STARTUP, lines);
- if (startup == null)
- return null;
-
- URI result = null;
- try {
- result = URIUtil.makeAbsolute(FileUtils.fromPath(startup), launcherFolder);
- ParserUtils.setValueForArgument(EquinoxConstants.OPTION_STARTUP, result.toString(), lines);
- } catch (URISyntaxException e) {
- Log.log(LogService.LOG_ERROR, NLS.bind(Messages.log_failed_make_absolute, startup));
- return null;
- }
- return result;
- }
-
- private void setStartup(List lines, URI launcherFolder) {
- String startup = ParserUtils.getValueForArgument(EquinoxConstants.OPTION_STARTUP, lines);
- if (startup == null)
- return;
-
- try {
- URI result = URIUtil.makeRelative(FileUtils.fromPath(startup), launcherFolder);
- ParserUtils.setValueForArgument(EquinoxConstants.OPTION_STARTUP, FileUtils.toPath(result).replace('\\', '/'), lines);
- } catch (URISyntaxException e) {
- Log.log(LogService.LOG_ERROR, NLS.bind(Messages.log_failed_make_relative, startup));
- return;
- }
- }
-
- void save(EquinoxLauncherData launcherData, boolean backup) throws IOException {
- File launcherConfigFile = EquinoxManipulatorImpl.getLauncherConfigLocation(launcherData);
-
- if (launcherConfigFile == null)
- throw new IllegalStateException(Messages.exception_launcherLocationNotSet);
- if (!Utils.createParentDir(launcherConfigFile)) {
- throw new IllegalStateException(Messages.exception_failedToCreateDir);
- }
- //Tweak all the values to make them relative
- File launcherFolder = launcherData.getLauncher().getParentFile();
- List newlines = new ArrayList();
- newlines.addAll(Arrays.asList(launcherData.getProgramArgs()));
-
- setStartup(newlines, launcherFolder.toURI());
- setInstall(newlines, launcherData, launcherFolder);
- //Get the osgi install area
- File osgiInstallArea = ParserUtils.getOSGiInstallArea(newlines, null, launcherData);
- //setInstall(lines, osgiInstallArea, launcherFolder);
- setConfigurationLocation(newlines, osgiInstallArea.toURI(), launcherData);
- setLauncherLibrary(newlines, launcherFolder.toURI());
- // setFrameworkJar(newlines, launcherData.getFwJar());
- setVM(newlines, launcherData.getJvm(), launcherFolder.toURI());
-
- //We are done, let's update the program args in the launcher data
- launcherData.setProgramArgs(null);
- launcherData.setProgramArgs((String[]) newlines.toArray(new String[newlines.size()]));
-
- //append jvm args
- setJVMArgs(newlines, launcherData);
-
- // backup file if exists.
- if (backup)
- if (launcherConfigFile.exists()) {
- File dest = Utils.getSimpleDataFormattedFile(launcherConfigFile);
- if (!launcherConfigFile.renameTo(dest))
- throw new IOException(NLS.bind(Messages.exception_failedToRename, launcherConfigFile, dest));
- Log.log(LogService.LOG_INFO, this, "save()", NLS.bind(Messages.log_renameSuccessful, launcherConfigFile, dest)); //$NON-NLS-1$
- }
-
- BufferedWriter bw = null;
- try {
- bw = new BufferedWriter(new FileWriter(launcherConfigFile));
- for (int j = 0; j < newlines.size(); j++) {
- String arg = (String) newlines.get(j);
- if (arg == null)
- continue;
- bw.write(arg);
- bw.newLine();
- }
- bw.flush();
- Log.log(LogService.LOG_INFO, NLS.bind(Messages.log_launcherConfigSave, launcherConfigFile));
- } finally {
- if (bw != null)
- bw.close();
- File previousLauncherIni = launcherData.getPreviousLauncherIni();
- if (previousLauncherIni != null && !previousLauncherIni.equals(launcherConfigFile))
- previousLauncherIni.delete();
- }
- launcherData.setLauncherConfigLocation(launcherConfigFile);
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxBundlesState.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxBundlesState.java
deleted file mode 100644
index 9aed538..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxBundlesState.java
+++ /dev/null
@@ -1,729 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.frameworkadmin.equinox;
-
-import java.io.File;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.*;
-import org.eclipse.core.runtime.internal.adaptor.EclipseEnvironmentInfo;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.utils.FileUtils;
-import org.eclipse.equinox.internal.frameworkadmin.utils.SimpleBundlesState;
-import org.eclipse.equinox.internal.frameworkadmin.utils.Utils;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
-import org.eclipse.osgi.service.resolver.*;
-import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.*;
-import org.osgi.service.log.LogService;
-
-public class EquinoxBundlesState implements BundlesState {
- static final long DEFAULT_TIMESTAMP = 0L;
- private static final boolean DEBUG = false;
- // While we recognize the amd64 architecture, we change
- // this internally to be x86_64.
- private static final String INTERNAL_AMD64 = "amd64"; //$NON-NLS-1$
- private static final String INTERNAL_ARCH_I386 = "i386"; //$NON-NLS-1$
- public static final String[] PROPS = {"osgi.os", "osgi.ws", "osgi.nl", "osgi.arch", Constants.FRAMEWORK_SYSTEMPACKAGES, "osgi.resolverMode", Constants.FRAMEWORK_EXECUTIONENVIRONMENT, "osgi.resolveOptional", "osgi.genericAliases"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
-
- static boolean checkFullySupported() {
- //TODO - This was previously doing a bogus check by attempting to instantiate a particular class - it's not clear what this is trying to do
- return true;
- }
-
- /**
- * eclipse.exe will launch a fw where plugins/org.eclipse.osgi_*.*.*.*.jar
- * is an implementation of fw.
- *
- * @param launcherData
- * @param configData
- * @return File of fwJar to be used.
- */
- static File getFwJar(LauncherData launcherData, ConfigData configData) {
- return getFwJar(launcherData, configData, true);
- //
- // // EclipseLauncherParser launcherParser = new
- // EclipseLauncherParser(launcherData);
- // // launcherParser.read();
- // if (launcherData.getFwJar() != null)
- // return launcherData.getFwJar();
- //
- // // check -D arguments of jvmArgs ?
- // String[] jvmArgs = launcherData.getJvmArgs();
- // String location = null;
- // for (int i = 0; i < jvmArgs.length; i++) {
- // if (jvmArgs[i].endsWith("-D" + "osgi.framework=")) {
- // location = jvmArgs[i].substring(("-D" + "osgi.framework=").length());
- // }
- // }
- // if (location != null)
- // return new File(location);
- //
- // File ret = getSystemBundleFromBundleInfos(launcherData, configData);
- // if (ret != null)
- // return ret;
- // return getSystemBundleBySearching(launcherData);
- }
-
- private static File getFwJar(LauncherData launcherData, ConfigData configData, boolean checkBundleInfos) {
- if (launcherData.getFwJar() != null) {
- return launcherData.getFwJar();
- }
-
- // check -D arguments of jvmArgs ?
- String[] jvmArgs = launcherData.getJvmArgs();
- String location = null;
- for (int i = 0; i < jvmArgs.length; i++) {
- if (jvmArgs[i].endsWith("-D" + "osgi.framework=")) { //$NON-NLS-1$ //$NON-NLS-2$
- location = jvmArgs[i].substring(("-D" + "osgi.framework=").length()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- if (location != null) {
- return new File(location);
- }
-
- if (checkBundleInfos) {
- File ret = getSystemBundleFromBundleInfos(configData);
- if (ret != null) {
- return ret;
- }
- }
- return null;
- // return getSystemBundleBySearching(launcherData);
- }
-
- private static long getMaxId(State state) {
- BundleDescription[] bundleDescriptions = state.getBundles();
- long maxId = DEFAULT_TIMESTAMP;
- for (int i = 0; i < bundleDescriptions.length; i++)
- if (maxId < bundleDescriptions[i].getBundleId()) {
- maxId = bundleDescriptions[i].getBundleId();
- }
- return maxId;
- }
-
- private static File getSystemBundleFromBundleInfos(BundleInfo[] bundleInfos) {
- for (int i = 0; i < bundleInfos.length; i++) {
- File match = isSystemBundle(bundleInfos[i]);
- if (match != null)
- return match;
- }
- return null;
- }
-
- protected static File getSystemBundleFromBundleInfos(ConfigData configData) {
- BundleInfo[] bundleInfos = configData.getBundles();
- return getSystemBundleFromBundleInfos(bundleInfos);
- }
-
- static long getTimeStamp(File fwPersistentDataLocation) {
- if (fwPersistentDataLocation == null)
- return DEFAULT_TIMESTAMP;
-
- File file = new File(fwPersistentDataLocation, EquinoxConstants.PERSISTENT_DIR_NAME);
- if (!file.exists() || !file.isDirectory())
- return DEFAULT_TIMESTAMP;
- long ret = file.lastModified();
- File[] lists = file.listFiles();
- if (lists == null)
- return ret;
- for (int i = 0; i < lists.length; i++)
- if (ret < lists[i].lastModified())
- ret = lists[i].lastModified();
- return ret;
- }
-
- public static File isSystemBundle(BundleInfo bundleInfo) {
- if (bundleInfo == null || bundleInfo.getLocation() == null)
- return null;
- URI bundleLocation = bundleInfo.getLocation();
- try {
- String[] clauses = Utils.getClausesManifestMainAttributes(bundleLocation, Constants.BUNDLE_SYMBOLICNAME);
- if (bundleLocation.getPath().indexOf(EquinoxConstants.FW_SYMBOLIC_NAME) > 0)
- if (EquinoxConstants.PERSISTENT_DIR_NAME.equals(Utils.getPathFromClause(clauses[0])))
- return new File(bundleLocation);
- } catch (RuntimeException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- // "osgi.os", "osgi.ws", "osgi.nl", "osgi.arch",
- // Constants.FRAMEWORK_SYSTEMPACKAGES, "osgi.resolverMode",
- // Constants.FRAMEWORK_EXECUTIONENVIRONMENT, "osgi.resolveOptional"
- static Properties setDefaultPlatformProperties() {
- Properties platformProperties = new Properties();
- // set default value
-
- String nl = Locale.getDefault().toString();
- platformProperties.setProperty("osgi.nl", nl); //$NON-NLS-1$
-
- // TODO remove EclipseEnvironmentInfo
- String os = EclipseEnvironmentInfo.guessOS(System.getProperty("os.name"));//$NON-NLS-1$);
- platformProperties.setProperty("osgi.os", os); //$NON-NLS-1$
-
- String ws = EclipseEnvironmentInfo.guessWS(os);
- platformProperties.setProperty("osgi.ws", ws); //$NON-NLS-1$
-
- // if the user didn't set the system architecture with a command line
- // argument then use the default.
- String arch = null;
- String name = FrameworkProperties.getProperty("os.arch");//$NON-NLS-1$
- // Map i386 architecture to x86
- if (name.equalsIgnoreCase(INTERNAL_ARCH_I386))
- arch = org.eclipse.osgi.service.environment.Constants.ARCH_X86;
- // Map amd64 architecture to x86_64
- else if (name.equalsIgnoreCase(INTERNAL_AMD64))
- arch = org.eclipse.osgi.service.environment.Constants.ARCH_X86_64;
- else
- arch = name;
- platformProperties.setProperty("osgi.arch", arch); //$NON-NLS-1$
-
- platformProperties.setProperty(Constants.FRAMEWORK_SYSTEMPACKAGES, FrameworkProperties.getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES));
- platformProperties.setProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, FrameworkProperties.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT));
- platformProperties.setProperty("osgi.resolveOptional", "" + "true".equals(FrameworkProperties.getProperty("osgi.resolveOptional"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return platformProperties;
- }
-
- EquinoxFwAdminImpl fwAdmin = null;
- BundleContext context;
- Manipulator manipulator = null;
- Properties platfromProperties = new Properties();
- long maxId = DEFAULT_TIMESTAMP;
- StateObjectFactory soFactory = null;
- State state = null;
-
- /**
- * Map of String->BundleDescription, where the key is the bundle location.
- */
- private HashMap locationStateIndex = new HashMap();
-
- /**
- * Map of String->BundleDescription, where the key is the bundle name
- * and version as defined by the {@link #getKey(BundleDescription)} method.
- */
- private HashMap nameVersionStateIndex = new HashMap();
- private final PlatformAdmin platformAdmin;
-
- /**
- * If useFwPersistentData flag equals false, this constructor will not take
- * a framework persistent data into account. Otherwise, it will.
- *
- * @param context
- * @param fwAdmin
- * @param manipulator
- * @param useFwPersistentData
- */
- EquinoxBundlesState(BundleContext context, EquinoxFwAdminImpl fwAdmin, Manipulator manipulator, PlatformAdmin admin, boolean useFwPersistentData) {
- this.context = context;
- this.fwAdmin = fwAdmin;
- this.platformAdmin = admin;
- // copy manipulator object for avoiding modifying the parameters of the
- // manipulator.
- this.manipulator = fwAdmin.getManipulator();
- this.manipulator.setConfigData(manipulator.getConfigData());
- this.manipulator.setLauncherData(manipulator.getLauncherData());
- initialize(useFwPersistentData);
- }
-
- /**
- * This constructor does NOT take a framework persistent data into account.
- * It will create State object based on the specified platformProperties.
- *
- * @param context
- * @param fwAdmin
- * @param manipulator
- * @param platformProperties
- */
- EquinoxBundlesState(BundleContext context, EquinoxFwAdminImpl fwAdmin, Manipulator manipulator, PlatformAdmin admin, Properties platformProperties) {
- super();
- this.context = context;
- this.fwAdmin = fwAdmin;
- this.platformAdmin = admin;
- // copy manipulator object for avoiding modifying the parameters of the
- // manipulator.
- this.manipulator = fwAdmin.getManipulator();
- this.manipulator.setConfigData(manipulator.getConfigData());
- this.manipulator.setLauncherData(manipulator.getLauncherData());
- LauncherData launcherData = manipulator.getLauncherData();
- ConfigData configData = manipulator.getConfigData();
- BundleInfo[] bInfos = configData.getBundles();
- this.composeNewState(launcherData, configData, platformProperties, bInfos);
- }
-
- /**
- * compose new state without reading framework persistent data. The
- * configData.getFwDependentProps() is used for the composition.
- *
- * @param launcherData
- * @param configData
- * @param bInfos
- */
- private void composeNewState(LauncherData launcherData, ConfigData configData, BundleInfo[] bInfos) {
- this.composeNewState(launcherData, configData, configData.getProperties(), bInfos);
- }
-
- /**
- * compose new state without reading framework persistent data. The given
- * properties is used for the composition. If system bundle is not included
- * in the given bInfos, the fw jar launcherData contains will be used.
- *
- * @param launcherData
- * @param configData
- * @param properties
- * @param bInfos
- */
- private void composeNewState(LauncherData launcherData, ConfigData configData, Properties properties, BundleInfo[] bInfos) {
- //Note, there use to be a lot more code in this method
- File fwJar = getSystemBundleFromBundleInfos(configData);
- launcherData.setFwJar(fwJar);
- this.setFwJar(fwJar);
- composeState(configData.getBundles(), properties, null);
- resolve(true);
- }
-
- /**
- * compose state. If it cannot compose it by somehow, false is returned.
- *
- * @param bInfos
- * @param props
- * @param fwPersistentDataLocation
- * @return if it cannot compose it by somehow, false is returned.
- * @throws IllegalArgumentException
- * @throws FrameworkAdminRuntimeException
- */
- private boolean composeState(BundleInfo[] bInfos, Dictionary props, File fwPersistentDataLocation) throws IllegalArgumentException, FrameworkAdminRuntimeException {
- BundleInfo[] infos = manipulator.getConfigData().getBundles();
- this.manipulator.getConfigData().setBundles(null);
- SimpleBundlesState.checkAvailability(fwAdmin);
- this.setStateObjectFactory();
- state = null;
- boolean flagNewState = false;
- if (fwPersistentDataLocation != null) {
- //NOTE Here there was a big chunk of code reading the framework state persisted on disk
- // and I removed it because it was causing various problems. See in previous revision
- this.manipulator.getConfigData().setBundles(infos);
- return false;
- }
- state = soFactory.createState(true);
- createStateIndexes();
- flagNewState = true;
- if (props == null) {
- this.manipulator.getConfigData().setBundles(infos);
- return false;
- }
- setPlatformPropertiesToState(props);
- setPlatformProperties(state);
-
- try {
- maxId = state.getHighestBundleId();
- } catch (NoSuchMethodError e) {
- maxId = getMaxId(state);
- }
- if (DEBUG) {
- System.out.println(""); //$NON-NLS-1$
- Log.log(LogService.LOG_DEBUG, this, "composeExpectedState()", "installBundle():"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (flagNewState) {
- int indexSystemBundle = -1;
- for (int j = 0; j < bInfos.length; j++)
- if (isSystemBundle(bInfos[j]) != null) {
- indexSystemBundle = j;
- break;
- }
-
- if (indexSystemBundle > 0) {
- BundleInfo[] newBundleInfos = new BundleInfo[bInfos.length];
- newBundleInfos[0] = bInfos[indexSystemBundle];
- System.arraycopy(bInfos, 0, newBundleInfos, 1, indexSystemBundle);
- if (indexSystemBundle < bInfos.length - 1)
- System.arraycopy(bInfos, indexSystemBundle + 1, newBundleInfos, indexSystemBundle + 1, bInfos.length - indexSystemBundle - 1);
- bInfos = newBundleInfos;
- }
- }
- for (int j = 0; j < bInfos.length; j++) {
- if (DEBUG)
- Log.log(LogService.LOG_DEBUG, this, "composeExpectedState()", "bInfos[" + j + "]=" + bInfos[j]); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- try {
- this.installBundle(bInfos[j]);
- // System.out.println("install bInfos[" + j + "]=" + bInfos[j]);
- } catch (RuntimeException e) {
- //catch the exception and continue
- Log.log(LogService.LOG_ERROR, this, "composeExpectedState()", "BundleInfo:" + bInfos[j], e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return true;
- }
-
- private BundleInfo convertSystemBundle(BundleDescription toConvert) {
- // Converting the System Bundle
- boolean markedAsStarted = false;
- int sl = BundleInfo.NO_LEVEL;
-
- URI location = null;
- String symbolicNameTarget = toConvert.getSymbolicName();
- Version versionTarget = toConvert.getVersion();
- try {
- File fwJar = manipulator.getLauncherData().getFwJar();
- if (fwJar != null) {
- URI fwJarLocation = fwJar.toURI();
- String[] clauses = Utils.getClausesManifestMainAttributes(fwJarLocation, Constants.BUNDLE_SYMBOLICNAME);
- String fwJarSymbolicName = Utils.getPathFromClause(clauses[0]);
- String fwJarVersionSt = Utils.getManifestMainAttributes(fwJarLocation, Constants.BUNDLE_VERSION);
- if (fwJarSymbolicName.equals(symbolicNameTarget) && fwJarVersionSt.equals(versionTarget.toString())) {
- location = fwJarLocation;
- markedAsStarted = true;
- }
- }
- } catch (FrameworkAdminRuntimeException e1) {
- Log.log(LogService.LOG_ERROR, "", e1); //$NON-NLS-1$
- }
- return createBundleInfo(toConvert, markedAsStarted, sl, location, null);
- }
-
- private BundleInfo createBundleInfo(BundleDescription toConvert, boolean markedAsStarted, int sl, URI location, String fragmentHost) {
- BundleInfo result = new BundleInfo();
- result.setSymbolicName(toConvert.getSymbolicName());
- result.setVersion(toConvert.getVersion().toString());
- result.setLocation(location);
- result.setResolved(toConvert.isResolved());
- result.setMarkedAsStarted(markedAsStarted);
- result.setStartLevel(sl);
- result.setBundleId(toConvert.getBundleId());
- result.setFragmentHost(fragmentHost);
- return result;
- }
-
- public BundleInfo[] convertState(BundleDescription[] bundles) {
- BundleInfo[] originalBInfos = manipulator.getConfigData().getBundles();
- Map bundleInfoMap = new HashMap();
- for (int i = 0; i < originalBInfos.length; i++) {
- bundleInfoMap.put(originalBInfos[i].getLocation(), originalBInfos[i]);
- }
-
- BundleInfo[] result = new BundleInfo[bundles.length];
- for (int i = 0; i < bundles.length; i++) {
- if (bundles[i].getBundleId() == 0 && EquinoxConstants.FW_SYMBOLIC_NAME.equals(bundles[i].getSymbolicName())) {
- result[i] = convertSystemBundle(bundles[i]);
- continue;
- }
-
- boolean markedAsStarted = false;
- int sl = BundleInfo.NO_LEVEL;
-
- //URI location = FileUtils.getEclipseRealLocation(manipulator, bundles[i].getLocation());
- //TODO: I believe this is always an absolute URI
- URI location;
- try {
- location = new URI(bundles[i].getLocation());
- } catch (URISyntaxException e) {
- e.printStackTrace();
- throw new IllegalStateException("BundleDescription conversion problem" + e.getMessage()); //$NON-NLS-1$ //TODO path_fun
- }
- String fragmentHost = null;
- BundleInfo original = (BundleInfo) bundleInfoMap.get(location);
- if (original != null) {
- markedAsStarted = original.isMarkedAsStarted();
- sl = getStartLevel(original.getStartLevel());
- fragmentHost = original.getFragmentHost();
- }
- result[i] = createBundleInfo(bundles[i], markedAsStarted, sl, location, fragmentHost);
- }
- return result;
- }
-
- public BundleInfo[] getExpectedState() throws FrameworkAdminRuntimeException {
- SimpleBundlesState.checkAvailability(fwAdmin);
- return convertState(state.getBundles());
- }
-
- Properties getPlatformProperties() {
- return platfromProperties;
- }
-
- public BundleInfo[] getPrerequisteBundles(BundleInfo bInfo) {
- Set set = new HashSet();
- URI realLocation = bInfo.getLocation();
- BundleDescription bundle = getBundleByLocation(realLocation);
- ImportPackageSpecification[] imports = bundle.getImportPackages();
- for (int i = 0; i < imports.length; i++) {
- BaseDescription supplier = imports[i].getSupplier();
- if (supplier == null) {
- if (!imports[i].getDirective(Constants.RESOLUTION_DIRECTIVE).equals(ImportPackageSpecification.RESOLUTION_OPTIONAL))
- throw new IllegalStateException("Internal error: import supplier should not be null"); //$NON-NLS-1$
- } else
- set.add(supplier.getSupplier());
- }
- BundleDescription[] requires = bundle.getResolvedRequires();
- for (int i = 0; i < requires.length; i++) {
- set.add(requires[i]);
- }
- BundleDescription[] bundles = new BundleDescription[set.size()];
- set.toArray(bundles);
- return convertState(bundles);
- }
-
- private int getStartLevel(int startLevel) {
- return (startLevel == BundleInfo.NO_LEVEL ? manipulator.getConfigData().getInitialBundleStartLevel() : startLevel);
- }
-
- public BundleInfo getSystemBundle() {
- BundleDescription bundle = this.getSystemBundleDescription();
- return (bundle != null ? convertSystemBundle(bundle) : null);
- }
-
- private BundleDescription getSystemBundleDescription() {
- BundleDescription bundle = state.getBundle(0);
- if (bundle == null || bundle.getHost() != null) { // null or a
- // fragment bundle.
- return null;
- }
- return (EquinoxConstants.FW_SYMBOLIC_NAME.equals(bundle.getSymbolicName()) ? bundle : null);
- }
-
- public BundleInfo[] getSystemFragmentedBundles() {
- BundleDescription bundle = this.getSystemBundleDescription();
- if (bundle == null)
- return null;
- return convertState(bundle.getFragments());
- }
-
- public String[] getUnsatisfiedConstraints(BundleInfo bInfo) {
- URI realLocation = bInfo.getLocation();
- BundleDescription description = getBundleByLocation(realLocation);
- StateHelper helper = platformAdmin.getStateHelper();
- VersionConstraint[] constraints = helper.getUnsatisfiedConstraints(description);
- String[] ret = new String[constraints.length];
- for (int i = 0; i < constraints.length; i++)
- ret[i] = constraints[i].toString();
- return ret;
- }
-
- private void initialize(boolean useFwPersistentData) {
- LauncherData launcherData = manipulator.getLauncherData();
- ConfigData configData = manipulator.getConfigData();
- BundleInfo[] bInfos = configData.getBundles();
-
- if (!useFwPersistentData) {
- composeNewState(launcherData, configData, bInfos);
- return;
- }
-
- EquinoxManipulatorImpl.checkConsistencyOfFwConfigLocAndFwPersistentDataLoc(launcherData);
- if (launcherData.isClean()) {
- composeNewState(launcherData, configData, bInfos);
- } else {
- if (manipulator.getLauncherData().getFwPersistentDataLocation() == null) {
- File installArea = ParserUtils.getOSGiInstallArea(Arrays.asList(launcherData.getProgramArgs()), configData.getProperties(), launcherData);
- if (DEBUG)
- Log.log(LogService.LOG_DEBUG, this, "initialize(useFwPersistentDat)", "installArea=" + installArea); //$NON-NLS-1$ //$NON-NLS-2$
- if (installArea == null)
- throw new IllegalStateException(Messages.exception_noInstallArea);
- File fwPersistentDataLocation = new File(installArea, "configuration"); //$NON-NLS-1$
- manipulator.getLauncherData().setFwPersistentDataLocation(fwPersistentDataLocation, false);
- }
- if (!composeState(bInfos, null, manipulator.getLauncherData().getFwPersistentDataLocation()))
- composeNewState(launcherData, configData, bInfos);
- resolve(true);
- }
- }
-
- public void installBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
- SimpleBundlesState.checkAvailability(fwAdmin);
-
- URI realLocation = bInfo.getLocation();
- if (getBundleByLocation(realLocation) != null)
- return;
-
- Dictionary manifest = Utils.getOSGiManifest(realLocation);
- if (manifest == null)
- return;
-
- String newSymbolicName = (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME);
- int position = newSymbolicName.indexOf(";"); //$NON-NLS-1$
- if (position >= 0)
- newSymbolicName = newSymbolicName.substring(0, position).trim();
- String newVersion = (String) manifest.get(Constants.BUNDLE_VERSION);
-
- if (getBundleByNameVersion(newSymbolicName, newVersion) != null)
- return;
-
- try {
- bInfo.setBundleId(++maxId);
- BundleDescription newBundleDescription = soFactory.createBundleDescription(state, manifest, realLocation.toString(), bInfo.getBundleId());
- addBundleToState(newBundleDescription);
- manipulator.getConfigData().addBundle(bInfo);
- } catch (BundleException e) {
- Log.log(LogService.LOG_WARNING, this, "installBundle(BundleInfo)", e); //$NON-NLS-1$
- }
- }
-
- public boolean isFullySupported() {
- return true;
- }
-
- public boolean isResolved() {
- return state.isResolved();
- }
-
- public boolean isResolved(BundleInfo bInfo) {
- URI realLocation = bInfo.getLocation();
- BundleDescription description = getBundleByLocation(realLocation);
- if (description == null)
- return false;
- return description.isResolved();
- }
-
- public void resolve(boolean increment) {
- state.resolve(increment);
- }
-
- void setFwJar(File fwJar) {
- manipulator.getLauncherData().setFwJar(fwJar);
- }
-
- /**
- * get platforme properties from the given state.
- *
- * @param state
- */
- private void setPlatformProperties(State state) {
- Dictionary platformProperties = state.getPlatformProperties()[0];
- platfromProperties.clear();
- if (platformProperties != null) {
- for (Enumeration enumeration = platformProperties.keys(); enumeration.hasMoreElements();) {
- String key = (String) enumeration.nextElement();
- Object value = platformProperties.get(key);
- platfromProperties.setProperty(key, (String) value);
- }
- }
- if (DEBUG)
- Utils.printoutProperties(System.out, "PlatformProperties[0]", platfromProperties); //$NON-NLS-1$
- }
-
- /**
- * set platfromProperties required to compose state object into
- * platformProperties of this state.
- *
- * @param props
- */
- private void setPlatformPropertiesToState(Dictionary props) {
- Properties platformProperties = setDefaultPlatformProperties();
-
- for (Enumeration enumeration = props.keys(); enumeration.hasMoreElements();) {
- String key = (String) enumeration.nextElement();
- for (int i = 0; i < PROPS.length; i++) {
- if (key.equals(PROPS[i])) {
- platformProperties.put(key, props.get(key));
- break;
- }
- }
- }
- state.setPlatformProperties(platformProperties);
- }
-
- private void setStateObjectFactory() {
- if (soFactory == null)
- soFactory = platformAdmin.getFactory();
- }
-
- public String toString() {
- if (state == null)
- return null;
- StringBuffer sb = new StringBuffer();
- BundleDescription[] bundleDescriptions = state.getBundles();
- for (int i = 0; i < bundleDescriptions.length; i++) {
- sb.append(bundleDescriptions[i].getBundleId() + ":"); //$NON-NLS-1$
- sb.append(bundleDescriptions[i].toString() + "("); //$NON-NLS-1$
- sb.append(bundleDescriptions[i].isResolved() + ")"); //$NON-NLS-1$
- String[] ees = bundleDescriptions[i].getExecutionEnvironments();
- for (int j = 0; j < ees.length; j++)
- sb.append(ees[j] + " "); //$NON-NLS-1$
- sb.append("\n"); //$NON-NLS-1$
- }
- sb.append("PlatformProperties:\n"); //$NON-NLS-1$
- Dictionary[] dics = state.getPlatformProperties();
- for (int i = 0; i < dics.length; i++) {
- for (Enumeration enumeration = dics[i].keys(); enumeration.hasMoreElements();) {
- String key = (String) enumeration.nextElement();
- String value = (String) dics[i].get(key);
- sb.append(" (" + key + "," + value + ")\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
- sb.append("\n"); //$NON-NLS-1$
- return sb.toString();
- }
-
- public void uninstallBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
- SimpleBundlesState.checkAvailability(fwAdmin);
- long id = DEFAULT_TIMESTAMP;
- URI realLocation = bInfo.getLocation();
- BundleDescription bundle = getBundleByLocation(bInfo.getLocation());
- if (bundle != null)
- id = bundle.getBundleId();
-
- if (id != DEFAULT_TIMESTAMP) {
- try {
- Dictionary manifest = Utils.getOSGiManifest(bInfo.getLocation());
- if (manifest == null) {
- Log.log(LogService.LOG_WARNING, this, "uninstallBundle(BundleInfo)", NLS.bind(Messages.exception_bundleManifest, bInfo.getLocation())); //$NON-NLS-1$
- return;
- }
- BundleDescription bundleDescription = soFactory.createBundleDescription(state, manifest, realLocation.toString(), id);
- removeBundleFromState(bundleDescription);
- manipulator.getConfigData().removeBundle(bInfo);
- } catch (BundleException e) {
- Log.log(LogService.LOG_WARNING, this, "uninstallBundle(BundleInfo)", e); //$NON-NLS-1$
- }
- }
- }
-
- private BundleDescription getBundleByLocation(URI location) {
- if (location == null)
- return null;
- return (BundleDescription) locationStateIndex.get(location);
- }
-
- private BundleDescription getBundleByNameVersion(String bundleSymbolicName, String bundleVersion) {
- return (BundleDescription) nameVersionStateIndex.get(bundleSymbolicName + ";" + bundleVersion); //$NON-NLS-1$
- }
-
- /**
- * Returns a key for a bundle description containing the bundle name and version,
- * for use in the name/version state index map.
- */
- private String getKey(BundleDescription bundle) {
- return bundle.getSymbolicName() + ';' + bundle.getVersion();
- }
-
- private void createStateIndexes() {
- BundleDescription[] currentInstalledBundles = state.getBundles();
- for (int i = 0; i < currentInstalledBundles.length; i++) {
- URI location = FileUtils.getRealLocation(manipulator, currentInstalledBundles[i].getLocation());
- locationStateIndex.put(location, currentInstalledBundles[i]);
- nameVersionStateIndex.put(getKey(currentInstalledBundles[i]), currentInstalledBundles[i]);
- }
- }
-
- private void addBundleToState(BundleDescription bundleDescription) {
- state.addBundle(bundleDescription);
- URI location = FileUtils.getRealLocation(manipulator, bundleDescription.getLocation());
- locationStateIndex.put(location, bundleDescription);
- nameVersionStateIndex.put(getKey(bundleDescription), bundleDescription);
- }
-
- private void removeBundleFromState(BundleDescription bundleDescription) {
- URI location = FileUtils.getRealLocation(manipulator, bundleDescription.getLocation());
- locationStateIndex.remove(location);
- nameVersionStateIndex.remove(getKey(bundleDescription));
- state.removeBundle(bundleDescription);
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxConstants.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxConstants.java
deleted file mode 100644
index d9623ab..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxConstants.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.frameworkadmin.equinox;
-
-public class EquinoxConstants {
-
- /**
- * If BundleContext#getProperty(PROP_KEY_USE_REFERENCE) does not equal "false",
- * Manipulator#save() will add "reference:" to any bundle location specified osgi.bundles in order to avoid
- * caching its bundle jar. Otherwise, it will add nothing to any bundle location.
- */
- public static final String PROP_KEY_USE_REFERENCE = "org.eclipse.equinox.frameworkadmin.equinox.useReference"; //$NON-NLS-1$
-
- public static final String PLUGINS_DIR = "plugins"; //$NON-NLS-1$
- public final static String FW_SYMBOLIC_NAME = "org.eclipse.osgi"; //$NON-NLS-1$
- public static final String DEFAULT_CONFIGURATION = "configuration"; //$NON-NLS-1$
- public static final String CONFIG_INI = "config.ini"; //$NON-NLS-1$
-
- public final static String FW_VERSION = "3.3"; //$NON-NLS-1$
- public final static String FW_NAME = "Equinox"; //$NON-NLS-1$
- public final static String LAUNCHER_VERSION = "3.2"; //$NON-NLS-1$
- public final static String LAUNCHER_NAME = "Eclipse.exe"; //$NON-NLS-1$
-
- public static final String OPTION_CONFIGURATION = "-configuration"; //$NON-NLS-1$
- public static final String OPTION_FW = "-framework"; //$NON-NLS-1$
- public static final String OPTION_VM = "-vm"; //$NON-NLS-1$
- public static final String OPTION_VMARGS = "-vmargs"; //$NON-NLS-1$
- public static final String OPTION_CLEAN = "-clean"; //$NON-NLS-1$
- public static final String OPTION_STARTUP = "-startup"; //$NON-NLS-1$
- public static final String OPTION_INSTALL = "-install"; //$NON-NLS-1$
- public static final String OPTION_LAUNCHER_LIBRARY = "--launcher.library"; //$NON-NLS-1$
-
- // System properties
- public static final String PROP_BUNDLES = "osgi.bundles"; //$NON-NLS-1$
- public static final String PROP_BUNDLES_STARTLEVEL = "osgi.bundles.defaultStartLevel"; //$NON-NLS-1$ //The start level used to install the bundles
- public static final String PROP_INITIAL_STARTLEVEL = "osgi.startLevel"; //$NON-NLS-1$ //The start level when the fwl start
- public static final String PROP_INSTALL = "osgi.install"; //$NON-NLS-1$
- public static final String PROP_ECLIPSE_COMMANDS = "eclipse.commands"; //$NON-NLS-1$
- public static final String PROP_FW_EXTENSIONS = "osgi.framework.extensions"; //$NON-NLS-1$
- public static final String PROP_OSGI_FW = "osgi.framework"; //$NON-NLS-1$
- public static final String PROP_OSGI_SYSPATH = "osgi.syspath"; //$NON-NLS-1$
- public static final String PROP_LAUNCHER_PATH = "osgi.launcherPath"; //$NON-NLS-1$
- public static final String PROP_LAUNCHER_NAME = "osgi.launcherIni"; //$NON-NLS-1$
- public static final String PROP_SHARED_CONFIGURATION_AREA = "osgi.sharedConfiguration.area"; //$NON-NLS-1$
-
- public static final String INI_EXTENSION = ".ini"; //$NON-NLS-1$
- public static final String EXE_EXTENSION = ".exe"; //$NON-NLS-1$
-
- public static final String PROP_EQUINOX_DEPENDENT_PREFIX = "osgi."; //$NON-NLS-1$
- static final String REFERENCE = "reference:"; //$NON-NLS-1$
- public static final String PERSISTENT_DIR_NAME = "org.eclipse.osgi"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxFrameworkAdminFactoryImpl.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxFrameworkAdminFactoryImpl.java
deleted file mode 100644
index 7298905..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxFrameworkAdminFactoryImpl.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.equinox;
-
-import org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulatorFactory;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.FrameworkAdmin;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.FrameworkAdminFactory;
-
-public class EquinoxFrameworkAdminFactoryImpl extends FrameworkAdminFactory {
- public FrameworkAdmin createFrameworkAdmin() throws InstantiationException, IllegalAccessException, ClassNotFoundException {
- String className = System.getProperty(ConfiguratorManipulatorFactory.SYSTEM_PROPERTY_KEY);
- if (className == null)
- return new EquinoxFwAdminImpl();
- return new EquinoxFwAdminImpl(className);
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxFwAdminImpl.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxFwAdminImpl.java
deleted file mode 100644
index 39d2937..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxFwAdminImpl.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.frameworkadmin.equinox;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Dictionary;
-import org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulator;
-import org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulatorFactory;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.eclipse.osgi.service.resolver.PlatformAdmin;
-import org.osgi.framework.*;
-import org.osgi.service.startlevel.StartLevel;
-
-public class EquinoxFwAdminImpl implements FrameworkAdmin {
-
- boolean active = false;
-
- private ConfiguratorManipulator configuratorManipulator = null;
-
- BundleContext context = null;
-
- private boolean runningFw = false;
-
- private PlatformAdmin platformAdmin;
- private StartLevel startLevelService;
-
- public EquinoxFwAdminImpl() {
- this(null, false);
- }
-
- // private String configuratorManipulatorFactoryName = null;
-
- EquinoxFwAdminImpl(BundleContext context) {
- this(context, false);
- }
-
- EquinoxFwAdminImpl(BundleContext context, boolean runningFw) {
- this.context = context;
- this.active = true;
- this.runningFw = runningFw;
- }
-
- EquinoxFwAdminImpl(String configuratorManipulatorFactoryName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
- this.context = null;
- this.active = true;
- this.runningFw = false;
- // this.configuratorManipulatorFactoryName = configuratorManipulatorFactoryName;
- loadConfiguratorManipulator(configuratorManipulatorFactoryName);
- }
-
- /**
- * DS component activator
- * @param aContext The bundle context
- */
- public void activate(BundleContext aContext) {
- this.context = aContext;
- this.runningFw = isRunningFw();
- Log.init(aContext);
- }
-
- void deactivate() {
- active = false;
- Log.dispose();
- }
-
- public ConfiguratorManipulator getConfiguratorManipulator() {
- return configuratorManipulator;
- }
-
- public Manipulator getManipulator() {
- return new EquinoxManipulatorImpl(context, this, platformAdmin, startLevelService, false);
- }
-
- public Manipulator getRunningManipulator() {
- if (!this.runningFw)
- return null;
- return new EquinoxManipulatorImpl(context, this, platformAdmin, startLevelService, true);
- }
-
- public boolean isActive() {
- return active;
- }
-
- /**
- * If both the vendor and the Bundle-Version in the manifest match,
- * return true. Otherwise false.
- *
- * @return flag true if the ManipulatorAdmin object can handle currently running fw launch.
- */
- boolean isRunningFw() {
- //TODO implementation for Eclipse.exe and for Equinox
- String fwVendor = context.getProperty(Constants.FRAMEWORK_VENDOR);
- if (!"Eclipse".equals(fwVendor)) //$NON-NLS-1$
- return false;
- //TODO decide if this version can be supported by this bundle.
- Dictionary header = context.getBundle(0).getHeaders();
- String versionSt = (String) header.get(Constants.BUNDLE_VERSION);
- Version version = new Version(versionSt);
- int value = version.compareTo(new Version(EquinoxConstants.FW_VERSION));
- if (value > 0) {
- return true;
- }
- // TODO need to identify the version of eclipse.exe used for this launch, if used.
- return false;
- }
-
- public Process launch(Manipulator manipulator, File cwd) throws IllegalArgumentException, FrameworkAdminRuntimeException, IOException {
- //return new EclipseLauncherImpl(context, this).launch(manipulator, cwd);
- return new EclipseLauncherImpl(this).launch(manipulator, cwd);
- }
-
- private void loadConfiguratorManipulator(String configuratorManipulatorFactoryName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
- if (configuratorManipulatorFactoryName == null)
- this.configuratorManipulator = null;
- else
- this.configuratorManipulator = ConfiguratorManipulatorFactory.getInstance(configuratorManipulatorFactoryName);
- return;
- }
-
- public void setPlatformAdmin(PlatformAdmin admin) {
- this.platformAdmin = admin;
- }
-
- public void setStartLevel(StartLevel sl) {
- this.startLevelService = sl;
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxFwConfigFileParser.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxFwConfigFileParser.java
deleted file mode 100644
index aa14afe..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxFwConfigFileParser.java
+++ /dev/null
@@ -1,585 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.frameworkadmin.equinox;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.utils.FileUtils;
-import org.eclipse.equinox.internal.frameworkadmin.utils.Utils;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.service.log.LogService;
-
-public class EquinoxFwConfigFileParser {
- private static final Set KNOWN_PROPERTIES = new HashSet(Arrays.asList(new String[] {EquinoxConstants.PROP_BUNDLES, EquinoxConstants.PROP_FW_EXTENSIONS, EquinoxConstants.PROP_INITIAL_STARTLEVEL, EquinoxConstants.PROP_BUNDLES_STARTLEVEL}));
- private static final String CONFIG_DIR = "@config.dir/"; //$NON-NLS-1$
- private static final String KEY_ECLIPSE_PROV_DATA_AREA = "eclipse.p2.data.area"; //$NON-NLS-1$
- private static final String KEY_ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR_CONFIGURL = "org.eclipse.equinox.simpleconfigurator.configUrl"; //$NON-NLS-1$
- private static final String REFERENCE_SCHEME = "reference:"; //$NON-NLS-1$
- private static final String FILE_PROTOCOL = "file:"; //$NON-NLS-1$
- private static boolean DEBUG = false;
-
- public EquinoxFwConfigFileParser(BundleContext context) {
- //Empty
- }
-
- private static StringBuffer toOSGiBundleListForm(BundleInfo bundleInfo, URI location) {
- StringBuffer locationString = new StringBuffer(REFERENCE_SCHEME);
- if (URIUtil.isFileURI(location))
- locationString.append(URIUtil.toUnencodedString(location));
- else if (location.getScheme() == null)
- locationString.append(FILE_PROTOCOL).append(URIUtil.toUnencodedString(location));
- else
- locationString = new StringBuffer(URIUtil.toUnencodedString(location));
-
- int startLevel = bundleInfo.getStartLevel();
- boolean toBeStarted = bundleInfo.isMarkedAsStarted();
-
- StringBuffer sb = new StringBuffer();
- sb.append(locationString);
- if (startLevel == BundleInfo.NO_LEVEL && !toBeStarted)
- return sb;
- sb.append('@');
- if (startLevel != BundleInfo.NO_LEVEL)
- sb.append(startLevel);
- if (toBeStarted)
- sb.append(":start"); //$NON-NLS-1$
- return sb;
- }
-
- private static boolean getMarkedAsStartedFormat(String startInfo) {
- if (startInfo == null)
- return false;
- startInfo = startInfo.trim();
- int colon = startInfo.indexOf(':');
- if (colon > -1) {
- return startInfo.substring(colon + 1).equals("start"); //$NON-NLS-1$
- }
- return startInfo.equals("start"); //$NON-NLS-1$
- }
-
- private static int getStartLevel(String startInfo) {
- if (startInfo == null)
- return BundleInfo.NO_LEVEL;
- startInfo = startInfo.trim();
- int colon = startInfo.indexOf(":"); //$NON-NLS-1$
- if (colon > 0) {
- try {
- return Integer.parseInt(startInfo.substring(0, colon));
- } catch (NumberFormatException e) {
- return BundleInfo.NO_LEVEL;
- }
- }
- return BundleInfo.NO_LEVEL;
- }
-
- private void readBundlesList(Manipulator manipulator, URI osgiInstallArea, Properties props) throws NumberFormatException {
- ConfigData configData = manipulator.getConfigData();
-
- BundleInfo[] fwExtensions = parseBundleList(manipulator, props.getProperty(EquinoxConstants.PROP_FW_EXTENSIONS));
- if (fwExtensions != null) {
- for (int i = 0; i < fwExtensions.length; i++) {
- fwExtensions[i].setFragmentHost(Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
- configData.addBundle(fwExtensions[i]);
- }
- }
-
- BundleInfo[] bundles = parseBundleList(manipulator, props.getProperty(EquinoxConstants.PROP_BUNDLES));
- if (bundles != null) {
- for (int i = 0; i < bundles.length; i++) {
- configData.addBundle(bundles[i]);
- }
- }
- }
-
- private BundleInfo[] parseBundleList(Manipulator manipulator, String value) {
- if (value == null || value.length() == 0)
- return null;
-
- List bundles = new ArrayList();
- String[] bInfoStrings = Utils.getTokens(value, ","); //$NON-NLS-1$
- for (int i = 0; i < bInfoStrings.length; i++) {
- String entry = bInfoStrings[i].trim();
- entry = FileUtils.removeEquinoxSpecificProtocols(entry);
-
- int indexStartInfo = entry.indexOf('@');
- String location = (indexStartInfo == -1) ? entry : entry.substring(0, indexStartInfo);
- URI realLocation = null;
- if (manipulator.getLauncherData().getFwJar() != null) {
- File parentFile = manipulator.getLauncherData().getFwJar().getParentFile();
- try {
- realLocation = URIUtil.makeAbsolute(FileUtils.fromFileURL(location), parentFile.toURI());
- } catch (URISyntaxException e) {
- // try searching as a simple location
- realLocation = FileUtils.getEclipsePluginFullLocation(location, parentFile);
- }
- }
- String slAndFlag = (indexStartInfo > -1) ? entry.substring(indexStartInfo + 1) : null;
-
- boolean markedAsStarted = getMarkedAsStartedFormat(slAndFlag);
- int startLevel = getStartLevel(slAndFlag);
-
- if (realLocation != null) {
- bundles.add(new BundleInfo(realLocation, startLevel, markedAsStarted));
- continue;
- }
- if (location != null && location.startsWith(FILE_PROTOCOL))
- try {
- bundles.add(new BundleInfo(FileUtils.fromFileURL(location), startLevel, markedAsStarted));
- continue;
- } catch (URISyntaxException e) {
- //Ignore
- }
-
- //Fallback case, we use the location as a string
- bundles.add(new BundleInfo(location, null, null, startLevel, markedAsStarted));
- }
- return (BundleInfo[]) bundles.toArray(new BundleInfo[bundles.size()]);
- }
-
- private void writeBundlesList(File fwJar, Properties props, URI base, BundleInfo[] bundles) {
- StringBuffer osgiBundlesList = new StringBuffer();
- StringBuffer osgiFrameworkExtensionsList = new StringBuffer();
- for (int j = 0; j < bundles.length; j++) {
- BundleInfo bundle = bundles[j];
-
- //framework jar does not get stored on the bundle list, figure out who that is.
- if (fwJar != null) {
- if (URIUtil.sameURI(fwJar.toURI(), bundle.getLocation()))
- continue;
- } else if (EquinoxConstants.FW_SYMBOLIC_NAME.equals(bundle.getSymbolicName()))
- continue;
-
- URI location = fwJar != null ? URIUtil.makeRelative(bundle.getLocation(), fwJar.getParentFile().toURI()) : bundle.getLocation();
-
- String fragmentHost = bundle.getFragmentHost();
- boolean isFrameworkExtension = fragmentHost != null && (fragmentHost.startsWith(EquinoxConstants.FW_SYMBOLIC_NAME) || fragmentHost.startsWith(Constants.SYSTEM_BUNDLE_SYMBOLICNAME));
-
- if (isFrameworkExtension) {
- bundle.setStartLevel(BundleInfo.NO_LEVEL);
- bundle.setMarkedAsStarted(false);
- osgiFrameworkExtensionsList.append(toOSGiBundleListForm(bundle, location));
- osgiFrameworkExtensionsList.append(',');
- } else {
- osgiBundlesList.append(toOSGiBundleListForm(bundle, location));
- osgiBundlesList.append(',');
- }
- }
- if (osgiFrameworkExtensionsList.length() > 0)
- osgiFrameworkExtensionsList.deleteCharAt(osgiFrameworkExtensionsList.length() - 1);
- props.setProperty(EquinoxConstants.PROP_FW_EXTENSIONS, osgiFrameworkExtensionsList.toString());
-
- if (osgiBundlesList.length() > 0)
- osgiBundlesList.deleteCharAt(osgiBundlesList.length() - 1);
- props.setProperty(EquinoxConstants.PROP_BUNDLES, osgiBundlesList.toString());
- }
-
- /**
- * inputFile must be not a directory but a file.
- *
- * @param manipulator
- * @param inputFile
- * @throws IOException
- */
- public void readFwConfig(Manipulator manipulator, File inputFile) throws IOException, URISyntaxException {
- if (inputFile.isDirectory())
- throw new IllegalArgumentException(NLS.bind(Messages.exception_inputFileIsDirectory, inputFile));
-
- //Initialize data structures
- ConfigData configData = manipulator.getConfigData();
- LauncherData launcherData = manipulator.getLauncherData();
- configData.initialize();
- configData.setBundles(null);
-
- String launcherName = null;
- String launcherPath = null;
-
- // load configuration properties
- Properties props = loadProperties(inputFile);
-
- // load shared configuration properties
- Properties sharedConfigProperties = getSharedConfiguration(props.getProperty(EquinoxConstants.PROP_SHARED_CONFIGURATION_AREA), ParserUtils.getOSGiInstallArea(Arrays.asList(manipulator.getLauncherData().getProgramArgs()), props, manipulator.getLauncherData()));
- if (sharedConfigProperties != null) {
- sharedConfigProperties.putAll(props);
- props = sharedConfigProperties;
- }
-
- //Start figuring out stuffs
- URI rootURI = launcherData.getLauncher() != null ? launcherData.getLauncher().getParentFile().toURI() : null;
-
- readFwJarLocation(configData, launcherData, props);
- URI configArea = inputFile.getParentFile().toURI();
- readLauncherPath(props, rootURI);
- readp2DataArea(props, configArea);
- readSimpleConfiguratorURL(props, configArea);
- readBundlesList(manipulator, ParserUtils.getOSGiInstallArea(Arrays.asList(launcherData.getProgramArgs()), props, launcherData).toURI(), props);
- readInitialStartLeve(configData, props);
- readDefaultStartLevel(configData, props);
-
- for (Enumeration enumeration = props.keys(); enumeration.hasMoreElements();) {
- String key = (String) enumeration.nextElement();
- if (KNOWN_PROPERTIES.contains(key))
- continue;
- String value = props.getProperty(key);
- configData.setProperty(key, value);
- }
- if (launcherName != null && launcherPath != null) {
- launcherData.setLauncher(new File(launcherPath, launcherName + EquinoxConstants.EXE_EXTENSION));
- }
- Log.log(LogService.LOG_INFO, NLS.bind(Messages.log_configFile, inputFile.getAbsolutePath()));
- }
-
- private void readDefaultStartLevel(ConfigData configData, Properties props) {
- if (props.getProperty(EquinoxConstants.PROP_BUNDLES_STARTLEVEL) != null)
- configData.setInitialBundleStartLevel(Integer.parseInt(props.getProperty(EquinoxConstants.PROP_BUNDLES_STARTLEVEL)));
- }
-
- private void writeDefaultStartLevel(ConfigData configData, Properties props) {
- if (configData.getInitialBundleStartLevel() != BundleInfo.NO_LEVEL)
- props.setProperty(EquinoxConstants.PROP_BUNDLES_STARTLEVEL, Integer.toString(configData.getInitialBundleStartLevel()));
- }
-
- private void readInitialStartLeve(ConfigData configData, Properties props) {
- if (props.getProperty(EquinoxConstants.PROP_INITIAL_STARTLEVEL) != null)
- configData.setBeginningFwStartLevel(Integer.parseInt(props.getProperty(EquinoxConstants.PROP_INITIAL_STARTLEVEL)));
- }
-
- private void writeInitialStartLevel(ConfigData configData, Properties props) {
- if (configData.getBeginingFwStartLevel() != BundleInfo.NO_LEVEL)
- props.setProperty(EquinoxConstants.PROP_INITIAL_STARTLEVEL, Integer.toString(configData.getBeginingFwStartLevel()));
- }
-
- private File readFwJarLocation(ConfigData configData, LauncherData launcherData, Properties props) throws URISyntaxException {
- File fwJar = null;
- if (props.getProperty(EquinoxConstants.PROP_OSGI_FW) != null) {
- URI absoluteFwJar = null;
- absoluteFwJar = URIUtil.makeAbsolute(FileUtils.fromFileURL(props.getProperty(EquinoxConstants.PROP_OSGI_FW)), ParserUtils.getOSGiInstallArea(Arrays.asList(launcherData.getProgramArgs()), configData.getProperties(), launcherData).toURI());
-
- props.setProperty(EquinoxConstants.PROP_OSGI_FW, absoluteFwJar.toString());
- String fwJarString = props.getProperty(EquinoxConstants.PROP_OSGI_FW);
- if (fwJarString != null) {
- fwJar = URIUtil.toFile(absoluteFwJar);
- if (fwJar == null)
- throw new IllegalStateException(Messages.exception_noFrameworkLocation);
- //Here we overwrite the value read from eclipse.ini, because the value of osgi.framework always takes precedence.
- launcherData.setFwJar(fwJar);
- } else {
- throw new IllegalStateException(Messages.exception_noFrameworkLocation);
- }
- }
- if (launcherData.getFwJar() != null)
- configData.addBundle(new BundleInfo(launcherData.getFwJar().toURI()));
- return launcherData.getFwJar();
- }
-
- private void writeFwJarLocation(ConfigData configData, LauncherData launcherData, Properties props) {
- if (launcherData.getFwJar() == null)
- return;
- props.setProperty(EquinoxConstants.PROP_OSGI_FW, FileUtils.toFileURL(URIUtil.makeRelative(launcherData.getFwJar().toURI(), ParserUtils.getOSGiInstallArea(Arrays.asList(launcherData.getProgramArgs()), configData.getProperties(), launcherData).toURI())));
- }
-
- private static Properties loadProperties(File inputFile) throws FileNotFoundException, IOException {
- Properties props = new Properties();
- InputStream is = null;
- try {
- is = new FileInputStream(inputFile);
- props.load(is);
- } finally {
- try {
- is.close();
- } catch (IOException e) {
- Log.log(LogService.LOG_WARNING, NLS.bind(Messages.log_failed_reading_properties, inputFile));
- }
- is = null;
- }
- return props;
- }
-
- private File findSharedConfigIniFile(URL rootURL, String sharedConfigurationArea) {
- URL sharedConfigurationURL = null;
- try {
- sharedConfigurationURL = new URL(sharedConfigurationArea);
- } catch (MalformedURLException e) {
- // unexpected since this was written by the framework
- Log.log(LogService.LOG_WARNING, NLS.bind(Messages.log_shared_config_url, sharedConfigurationArea));
- return null;
- }
-
- // check for a relative URL
- if (!sharedConfigurationURL.getPath().startsWith("/")) { //$NON-NLS-1$
- if (!rootURL.getProtocol().equals(sharedConfigurationURL.getProtocol())) {
- Log.log(LogService.LOG_WARNING, NLS.bind(Messages.log_shared_config_relative_url, rootURL.toExternalForm(), sharedConfigurationArea));
- return null;
- }
- try {
- sharedConfigurationURL = new URL(rootURL, sharedConfigurationArea);
- } catch (MalformedURLException e) {
- // unexpected since this was written by the framework
- Log.log(LogService.LOG_WARNING, NLS.bind(Messages.log_shared_config_relative_url, rootURL.toExternalForm(), sharedConfigurationArea));
- return null;
- }
- }
- File sharedConfigurationFolder = new File(sharedConfigurationURL.getPath());
- if (!sharedConfigurationFolder.isDirectory()) {
- Log.log(LogService.LOG_WARNING, NLS.bind(Messages.log_shared_config_file_missing, sharedConfigurationFolder));
- return null;
- }
-
- File sharedConfigIni = new File(sharedConfigurationFolder, EquinoxConstants.CONFIG_INI);
- if (!sharedConfigIni.exists()) {
- Log.log(LogService.LOG_WARNING, NLS.bind(Messages.log_shared_config_file_missing, sharedConfigIni));
- return null;
- }
-
- return sharedConfigIni;
- }
-
- private void readp2DataArea(Properties props, URI configArea) throws URISyntaxException {
- if (props.getProperty(KEY_ECLIPSE_PROV_DATA_AREA) != null) {
- String url = props.getProperty(KEY_ECLIPSE_PROV_DATA_AREA);
- if (url != null) {
- if (url.startsWith(CONFIG_DIR))
- url = "file:" + url.substring(CONFIG_DIR.length()); //$NON-NLS-1$
- props.setProperty(KEY_ECLIPSE_PROV_DATA_AREA, URIUtil.makeAbsolute(FileUtils.fromFileURL(url), configArea).toString());
- }
- }
- }
-
- private void writep2DataArea(ConfigData configData, Properties props, URI configArea) throws URISyntaxException {
- String dataArea = getFwProperty(configData, KEY_ECLIPSE_PROV_DATA_AREA);
- if (dataArea != null) {
- if (dataArea.startsWith(CONFIG_DIR)) {
- props.setProperty(KEY_ECLIPSE_PROV_DATA_AREA, dataArea);
- return;
- }
- URI dataAreaURI = new URI(dataArea);
- URI relative = URIUtil.makeRelative(dataAreaURI, configArea);
- if (dataAreaURI.equals(relative)) {
- props.setProperty(KEY_ECLIPSE_PROV_DATA_AREA, FileUtils.toFileURL(dataAreaURI));
- return;
- }
- String result = URIUtil.toUnencodedString(relative);
- //We only relativize up to the level where the p2 and config folder are siblings (e.g. foo/p2 and foo/config)
- if (result.startsWith("../..")) //$NON-NLS-1$
- result = dataArea;
- else if (!result.equals(dataArea)) {
- props.setProperty(KEY_ECLIPSE_PROV_DATA_AREA, CONFIG_DIR + result);
- return;
- }
- props.setProperty(KEY_ECLIPSE_PROV_DATA_AREA, FileUtils.toFileURL(new URI(result)));
- }
- }
-
- private void readLauncherPath(Properties props, URI root) throws URISyntaxException {
- if (props.getProperty(EquinoxConstants.PROP_LAUNCHER_PATH) != null)
- props.setProperty(EquinoxConstants.PROP_LAUNCHER_PATH, URIUtil.makeAbsolute(URIUtil.fromString(props.getProperty(EquinoxConstants.PROP_LAUNCHER_PATH)), root).toString());
- }
-
- private void writeLauncherPath(ConfigData configData, Properties props, URI root) throws URISyntaxException {
- String value = getFwProperty(configData, EquinoxConstants.PROP_LAUNCHER_PATH);
- if (value != null) {
- URI launcherPathURI = FileUtils.fromPath(value);
- String launcherPath = URIUtil.toUnencodedString(URIUtil.makeRelative(launcherPathURI, root));
- if ("/".equals(launcherPath) || "".equals(launcherPath)) //$NON-NLS-1$ //$NON-NLS-2$
- launcherPath = "."; //$NON-NLS-1$
- props.setProperty(EquinoxConstants.PROP_LAUNCHER_PATH, launcherPath);
- }
- }
-
- private void readSimpleConfiguratorURL(Properties props, URI configArea) throws URISyntaxException {
- if (props.getProperty(KEY_ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR_CONFIGURL) != null)
- props.setProperty(KEY_ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR_CONFIGURL, URIUtil.makeAbsolute(FileUtils.fromFileURL(props.getProperty(KEY_ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR_CONFIGURL)), configArea).toString());
- }
-
- private void writeSimpleConfiguratorURL(ConfigData configData, Properties props, URI configArea) throws URISyntaxException {
- //FIXME How would someone set such a value.....
- String value = getFwProperty(configData, KEY_ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR_CONFIGURL);
- if (value != null)
- props.setProperty(KEY_ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR_CONFIGURL, FileUtils.toFileURL(URIUtil.makeRelative(URIUtil.fromString(value), configArea)));
- }
-
- private String getFwProperty(ConfigData data, String key) {
- return data.getProperty(key);
- }
-
- public void saveFwConfig(BundleInfo[] bInfos, Manipulator manipulator, boolean backup, boolean relative) throws IOException {//{
- ConfigData configData = manipulator.getConfigData();
- LauncherData launcherData = manipulator.getLauncherData();
- //Get the OSGi jar from the bundle.info
- File fwJar = EquinoxBundlesState.getSystemBundleFromBundleInfos(configData);
- launcherData.setFwJar(fwJar);
-
- File outputFile = launcherData.getFwConfigLocation();
- if (outputFile.exists()) {
- if (outputFile.isFile()) {
- if (!outputFile.getName().equals(EquinoxConstants.CONFIG_INI))
- throw new IllegalStateException(NLS.bind(Messages.exception_fwConfigLocationName, outputFile.getAbsolutePath(), EquinoxConstants.CONFIG_INI));
- } else { // Directory
- outputFile = new File(outputFile, EquinoxConstants.CONFIG_INI);
- }
- } else {
- if (!outputFile.getName().equals(EquinoxConstants.CONFIG_INI)) {
- if (!outputFile.mkdir())
- throw new IOException(NLS.bind(Messages.exception_failedToCreateDir, outputFile));
- outputFile = new File(outputFile, EquinoxConstants.CONFIG_INI);
- }
- }
- String header = "This configuration file was written by: " + this.getClass().getName(); //$NON-NLS-1$
-
- Properties configProps = new Properties();
- URI rootURI = launcherData.getLauncher() != null ? launcherData.getLauncher().getParentFile().toURI() : null;
-
- writeFwJarLocation(configData, launcherData, configProps);
- try {
- writeLauncherPath(configData, configProps, rootURI);
- URI configArea = manipulator.getLauncherData().getFwConfigLocation().toURI();
- writep2DataArea(configData, configProps, configArea);
- writeSimpleConfiguratorURL(configData, configProps, configArea);
- writeBundlesList(launcherData.getFwJar(), configProps, ParserUtils.getOSGiInstallArea(Arrays.asList(launcherData.getProgramArgs()), configProps, launcherData).toURI(), bInfos);
- writeInitialStartLevel(configData, configProps);
- writeDefaultStartLevel(configData, configProps);
- } catch (URISyntaxException e) {
- throw new FrameworkAdminRuntimeException(e, Messages.exception_errorSavingConfigIni);
- }
-
- Properties original = configData.getProperties();
- original.putAll(configProps);
- configProps = original;
-
- //Deal with the fw jar and ensure it is not set.
- //TODO This can't be done before because of the previous calls to appendProperties
-
- if (configProps == null || configProps.size() == 0) {
- Log.log(LogService.LOG_WARNING, this, "saveFwConfig() ", Messages.log_configProps); //$NON-NLS-1$
- return;
- }
- if (!Utils.createParentDir(outputFile)) {
- throw new IllegalStateException(Messages.exception_failedToCreateDir);
- }
-
- if (DEBUG)
- Utils.printoutProperties(System.out, "configProps", configProps); //$NON-NLS-1$
-
- if (backup)
- if (outputFile.exists()) {
- File dest = Utils.getSimpleDataFormattedFile(outputFile);
- if (!outputFile.renameTo(dest))
- throw new IOException(NLS.bind(Messages.exception_failedToRename, outputFile, dest));
- Log.log(LogService.LOG_INFO, this, "saveFwConfig()", NLS.bind(Messages.log_renameSuccessful, outputFile, dest)); //$NON-NLS-1$
- }
-
- FileOutputStream out = null;
- try {
- out = new FileOutputStream(outputFile);
- // configProps = makeRelative(configProps, launcherData.getLauncher().getParentFile().toURI(), fwJar, outputFile.getParentFile(), getOSGiInstallArea(manipulator.getLauncherData()));
- filterPropertiesFromSharedArea(configProps, manipulator);
- configProps.store(out, header);
- Log.log(LogService.LOG_INFO, NLS.bind(Messages.log_fwConfigSave, outputFile));
- } finally {
- try {
- out.flush();
- out.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- out = null;
- }
- }
-
- private void filterPropertiesFromSharedArea(Properties configProps, Manipulator manipulator) {
- LauncherData launcherData = manipulator.getLauncherData();
- //Remove from the config file that we are about to write the properties that are unchanged compared to what is in the base
- Properties sharedConfigProperties = getSharedConfiguration(configProps.getProperty(EquinoxConstants.PROP_SHARED_CONFIGURATION_AREA), ParserUtils.getOSGiInstallArea(Arrays.asList(launcherData.getProgramArgs()), configProps, launcherData));
- if (sharedConfigProperties == null)
- return;
- Enumeration keys = configProps.propertyNames();
- while (keys.hasMoreElements()) {
- String key = (String) keys.nextElement();
- String sharedValue = sharedConfigProperties.getProperty(key);
- if (sharedValue == null)
- continue;
- String value = configProps.getProperty(key);
- if (equalsIgnoringSeparators(sharedValue, value)) {
- configProps.remove(key);
- continue;
- }
-
- if (key.equals(EquinoxConstants.PROP_BUNDLES) && equalBundleLists(manipulator, value, sharedValue)) {
- configProps.remove(key);
- continue;
- }
-
- if (key.equals(EquinoxConstants.PROP_FW_EXTENSIONS) && equalBundleLists(manipulator, value, sharedValue)) {
- configProps.remove(key);
- continue;
- }
- }
- }
-
- private boolean equalBundleLists(Manipulator manipulator, String value, String sharedValue) {
- BundleInfo[] bundles = parseBundleList(manipulator, value);
- BundleInfo[] sharedBundles = parseBundleList(manipulator, sharedValue);
- if (bundles == null || sharedBundles == null || bundles.length != sharedBundles.length)
- return false;
-
- List compareList = new ArrayList(Arrays.asList(bundles));
- compareList.removeAll(Arrays.asList(sharedBundles));
- return compareList.isEmpty();
- }
-
- private boolean equalsIgnoringSeparators(String s1, String s2) {
- if (s1 == null && s2 == null)
- return true;
- if (s1 == null || s2 == null)
- return false;
- StringBuffer sb1 = new StringBuffer(s1);
- StringBuffer sb2 = new StringBuffer(s2);
- canonicalizePathsForComparison(sb1);
- canonicalizePathsForComparison(sb2);
- return sb1.toString().equals(sb2.toString());
- }
-
- private void canonicalizePathsForComparison(StringBuffer s) {
- final String[] tokens = new String[] {"\\\\", "\\", "//", "/"}; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
- for (int t = 0; t < tokens.length; t++) {
- int idx = s.length();
- for (int i = s.length(); i != 0 && idx != -1; i--) {
- idx = s.toString().lastIndexOf(tokens[t], idx);
- if (idx != -1)
- s.replace(idx, idx + tokens[t].length(), "^"); //$NON-NLS-1$
- }
- }
- }
-
- private Properties getSharedConfiguration(String sharedConfigurationArea, File baseFile) {
- if (sharedConfigurationArea == null)
- return null;
- File sharedConfigIni;
- try {
- sharedConfigIni = findSharedConfigIniFile(baseFile.toURL(), sharedConfigurationArea);
- } catch (MalformedURLException e) {
- return null;
- }
- if (sharedConfigIni != null && sharedConfigIni.exists())
- try {
- return loadProperties(sharedConfigIni);
- } catch (FileNotFoundException e) {
- return null;
- } catch (IOException e) {
- return null;
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxLauncherData.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxLauncherData.java
deleted file mode 100644
index 869115b..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxLauncherData.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.equinox;
-
-import java.io.File;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.LauncherData;
-
-public class EquinoxLauncherData extends LauncherData {
- File previousLauncher = null;
-
- public EquinoxLauncherData(String fwName, String fwVersion, String launcherName, String launcherVersion) {
- super(fwName, fwVersion, launcherName, launcherVersion);
- }
-
- public void setLauncher(File launcherFile) {
- if (previousLauncher == null && launcherFile != null && !launcherFile.equals(getLauncher()))
- previousLauncher = EquinoxManipulatorImpl.getLauncherConfigLocation(this);
- super.setLauncher(launcherFile);
- }
-
- File getPreviousLauncherIni() {
- return previousLauncher;
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java
deleted file mode 100644
index e82df42..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java
+++ /dev/null
@@ -1,662 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.frameworkadmin.equinox;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.*;
-import java.util.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.frameworkadmin.utils.SimpleBundlesState;
-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.osgi.service.datalocation.Location;
-import org.eclipse.osgi.service.resolver.PlatformAdmin;
-import org.osgi.framework.*;
-import org.osgi.service.log.LogService;
-import org.osgi.service.startlevel.StartLevel;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- *
- */
-public class EquinoxManipulatorImpl implements Manipulator {
- private static final long DEFAULT_LASTMODIFIED = 0L;
- private static final boolean LOG_ILLEGALSTATEEXCEPTION = false;
- private static final String COMMA = ","; //$NON-NLS-1$
- private static final String FILE_PROTOCOL = "file:"; //$NON-NLS-1$
- private static final String IGNORED = "ignored"; //$NON-NLS-1$
-
- /**
- * If the fwConfigLocation is a file and its name does not equal "config.ini",
- * throw an IllegaStateException.
- * If the fwConfigLocation is a file and its name equals "config.ini",
- * fwConfigLocation will be updated by its parent directory.
- *
- * Then, reset fwConfigLocation and fwPersistentDataLocation to be matched.
- *
- * @param launcherData
- */
- static void checkConsistencyOfFwConfigLocAndFwPersistentDataLoc(LauncherData launcherData) {
- File fwConfigLocation = launcherData.getFwConfigLocation();
- File fwPersistentDataLocation = launcherData.getFwPersistentDataLocation();
-
- if (fwConfigLocation != null) {
- if (fwConfigLocation.isFile()) {
- if (fwConfigLocation.getName().equals(EquinoxConstants.CONFIG_INI))
- fwConfigLocation = fwConfigLocation.getParentFile();
- else
- throw new IllegalStateException("fwConfigLocation is not a directory but its name does NOT equal \"" + EquinoxConstants.CONFIG_INI + "\"!\n" + "\tfwConfigLocation=" + fwConfigLocation.getAbsolutePath() + "\n\t,fwPersistentDataLocation=" + fwPersistentDataLocation.getAbsolutePath());
- launcherData.setFwConfigLocation(fwConfigLocation);
- }
- if (fwPersistentDataLocation != null) {
- // Log.log(LogService.LOG_DEBUG, "fwConfigLocation=" + fwConfigLocation.getAbsolutePath() + ",\n\tfwInstancePrivateArea=" + fwPersistentDataLocation.getAbsolutePath());
- //if (!fwConfigLocation.getParentFile().equals(fwPersistentDataLocation))
- //throw new IllegalStateException("!configFile.getParentFile().equals(fwInstancePrivateArea)\n" + "\tconfigFile=" + fwConfigLocation.getAbsolutePath() + "\n\t,fwInstancePrivateArea=" + fwPersistentDataLocation.getAbsolutePath());
- if (!fwConfigLocation.equals(fwPersistentDataLocation))
- throw new IllegalStateException("!fwConfigLocation.equals(fwPersistentDataLocation)\n" + "\t!fwConfigLocation=" + fwConfigLocation.getAbsolutePath() + "\n\t,fwPersistentDataLocation=" + fwPersistentDataLocation.getAbsolutePath());
- } else
- launcherData.setFwPersistentDataLocation(fwConfigLocation, launcherData.isClean());
- //launcherData.setFwPersistentDataLocation(fwConfigLocation.getParentFile(), launcherData.isClean());
- } else {
- if (fwPersistentDataLocation != null) {
- launcherData.setFwConfigLocation(fwPersistentDataLocation);
- //launcherData.setFwConfigLocation(new File(fwPersistentDataLocation, EquinoxConstants.CONFIG_INI));
- } else {
- File home = launcherData.getHome();
- if (home == null)
- throw new IllegalStateException("All of fwConfigLocation, fwPersistentDataLocation, and home are not set");
- fwConfigLocation = new File(home, "configuration");
- launcherData.setFwPersistentDataLocation(fwConfigLocation, launcherData.isClean());
- launcherData.setFwConfigLocation(fwConfigLocation);
- }
- }
- }
-
- //This returns the location of the <eclipse>.ini file
- static File getLauncherConfigLocation(LauncherData launcherData) {
- File launcherIni = launcherData.getLauncherConfigLocation();
- if (launcherIni != null)
- return launcherIni;
-
- File launcher = launcherData.getLauncher();
- if (launcher == null)
- return null;
- String launcherName = launcher.getName();
- int dotLocation = launcherName.lastIndexOf('.');
- if (dotLocation != -1)
- launcherName = launcherName.substring(0, dotLocation);
- File result = new File(launcher.getParentFile(), launcherName + EquinoxConstants.INI_EXTENSION);
- return result;
- }
-
- ConfigData configData = new ConfigData(EquinoxConstants.FW_NAME, EquinoxConstants.FW_VERSION, EquinoxConstants.LAUNCHER_NAME, EquinoxConstants.LAUNCHER_VERSION);
- EquinoxLauncherData launcherData = new EquinoxLauncherData(EquinoxConstants.FW_NAME, EquinoxConstants.FW_VERSION, EquinoxConstants.LAUNCHER_NAME, EquinoxConstants.LAUNCHER_VERSION);
- BundleContext context = null;
- private Properties platformProperties = new Properties();
-
- ServiceTracker cmTracker;
- int trackingCount = -1;
- private final PlatformAdmin platformAdmin;
- private final StartLevel startLevelService;
-
- // private final boolean runtime;
-
- ConfiguratorManipulator configuratorManipulator;
-
- EquinoxFwAdminImpl fwAdmin = null;
-
- EquinoxManipulatorImpl(BundleContext context, EquinoxFwAdminImpl fwAdmin, PlatformAdmin admin, StartLevel slService, boolean runtime) {
- this.context = context;
- this.fwAdmin = fwAdmin;
- this.platformAdmin = admin;
- this.startLevelService = slService;
- if (context != null) {
- cmTracker = new ServiceTracker(context, ConfiguratorManipulator.class.getName(), null);
- cmTracker.open();
- }
- // this.runtime = runtime;
- if (runtime)
- initializeRuntime();
- // XXX For Equinox, default value of Initial Bundle Start Level is 4.
- // Precisely speaking, it's not correct.
- // Equinox doesn't support setting initial bundle start level as an OSGi terminology.
- // Only bundles installed by config.ini and updateconfigurator will have that start level(4).
- // Others has a start level of 1.
- configData.setInitialBundleStartLevel(4);
- }
-
- public BundlesState getBundlesState() throws FrameworkAdminRuntimeException {
- if (context == null)
- return new SimpleBundlesState(fwAdmin, this, EquinoxConstants.FW_SYMBOLIC_NAME);
-
- if (!EquinoxBundlesState.checkFullySupported())
- return new SimpleBundlesState(fwAdmin, this, EquinoxConstants.FW_SYMBOLIC_NAME);
-
- EquinoxBundlesState state;
- if (platformProperties.isEmpty())
- return new EquinoxBundlesState(context, fwAdmin, this, platformAdmin, false);
- // XXX checking if fwDependent or fwIndependent platformProperties are updated after the platformProperties was created might be required for better implementation.
- return new EquinoxBundlesState(context, fwAdmin, this, platformAdmin, platformProperties);
- }
-
- public ConfigData getConfigData() throws FrameworkAdminRuntimeException {
- return configData;
- }
-
- public BundleInfo[] getExpectedState() throws IllegalArgumentException, FrameworkAdminRuntimeException {
- //Log.log(LogService.LOG_DEBUG, this, "getExpectedState()", "BEGIN");
- SimpleBundlesState.checkAvailability(fwAdmin);
-
- BundlesState bundleState = this.getBundlesState();
- if (bundleState instanceof SimpleBundlesState)
- return new BundleInfo[0];
- bundleState.resolve(true);
-
- return bundleState.getExpectedState();
- }
-
- public LauncherData getLauncherData() throws FrameworkAdminRuntimeException {
- return launcherData;
- }
-
- /**
- * Return the configuration location.
- *
- * @see Location
- */
- private File getRunningConfigurationLocation() {
- ServiceTracker tracker = null;
- Filter filter = null;
- try {
- filter = context.createFilter(Location.CONFIGURATION_FILTER);
- } catch (InvalidSyntaxException e) {
- // ignore this. It should never happen as we have tested the above format.
- }
- tracker = new ServiceTracker(context, filter, null);
- tracker.open();
- Location location = (Location) tracker.getService();
- URL url = location.getURL();
- if (!url.getProtocol().equals("file"))
- return null;
- return new File(url.getFile());
- }
-
- private File getRunningLauncherFile() {
- File launcherFile = null;
- String eclipseCommandsSt = context.getProperty(EquinoxConstants.PROP_ECLIPSE_COMMANDS);
- if (eclipseCommandsSt == null)
- return null;
-
- StringTokenizer tokenizer = new StringTokenizer(eclipseCommandsSt, "\n");
- boolean found = false;
- String launcherSt = null;
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken();
- if (found) {
- launcherSt = token;
- break;
- }
- if (token.equals("-launcher"))
- found = true;
- }
- if (launcherSt != null)
- launcherFile = new File(launcherSt);
- return launcherFile;
- }
-
- private Properties getRunningPlatformProperties() {
- Properties props = new Properties();
- for (int i = 0; i < EquinoxBundlesState.PROPS.length; i++) {
- String value = context.getProperty(EquinoxBundlesState.PROPS[i]);
- if (value != null)
- props.setProperty(EquinoxBundlesState.PROPS[i], value);
- }
- return props;
- }
-
- public long getTimeStamp() {
- long ret = this.getTimeStampWithoutFwPersistentData();
- if (this.launcherData.isClean())
- return ret;
- long lastModifiedFwPersistent = EquinoxBundlesState.getTimeStamp(launcherData.getFwPersistentDataLocation());
- return Math.max(ret, lastModifiedFwPersistent);
- }
-
- private long getTimeStampWithoutFwPersistentData() {
- SimpleBundlesState.checkAvailability(fwAdmin);
- File launcherConfigFile = getLauncherConfigLocation(launcherData);
- long lastModifiedLauncherConfigFile = DEFAULT_LASTMODIFIED;
- long lastModifiedFwConfigFile = DEFAULT_LASTMODIFIED;
- if (launcherConfigFile != null) {
- // use launcher. -- > load from LaucnherConfig file.
- lastModifiedLauncherConfigFile = launcherConfigFile.lastModified();
- }
- checkConsistencyOfFwConfigLocAndFwPersistentDataLoc(launcherData);
-
- if (launcherData.getFwConfigLocation() != null) {
- File fwConfigFile = new File(launcherData.getFwConfigLocation(), EquinoxConstants.CONFIG_INI);
- lastModifiedFwConfigFile = fwConfigFile.lastModified();
- }
- long ret = Math.max(lastModifiedLauncherConfigFile, lastModifiedFwConfigFile);
- return ret;
- }
-
- // //
- // public void load() throws IllegalStateException, IOException, FrameworkAdminRuntimeException {
- // this.load(true);
- // }
-
- public void initialize() {
- Log.log(LogService.LOG_DEBUG, this, "initialize()", "BEGIN");
- configData.initialize();
- launcherData.initialize();
- }
-
- private void initializeRuntime() {
- //TODO refine the implementation. using some MAGIC dependent on Eclipse.exe and Equinox implementation,
- // set parameters according to the current running fw.
-
- // 1. retrieve location data from Location services registered by equinox fw.
- String fwJarLocation = context.getProperty(EquinoxConstants.PROP_OSGI_FW);
- if (!fwJarLocation.startsWith("file:"))
- throw new IllegalStateException("Current implementation assume that property value keyed by " + EquinoxConstants.PROP_OSGI_FW + " must start with \"file:\". But it was not:" + fwJarLocation);
- File fwJar = new File(fwJarLocation.substring("file:".length()));
- //System.out.println("fwJar=" + fwJar);
- File fwConfigLocation = getRunningConfigurationLocation();
- File launcherFile = getRunningLauncherFile();
- launcherData.setFwJar(fwJar);
- launcherData.setFwPersistentDataLocation(fwConfigLocation, false);
- launcherData.setLauncher(launcherFile);
- launcherData.setOS(context.getProperty("osgi.os")); //$NON-NLS-1$
- try {
- this.loadWithoutFwPersistentData();
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- // 2. Create a Manipulator object fully initialized to the current running fw.
-
- ServiceReference reference = context.getServiceReference(StartLevel.class.getName());
- StartLevel startLevel = (StartLevel) context.getService(reference);
- Bundle[] bundles = context.getBundles();
- BundleInfo[] bInfos = new BundleInfo[bundles.length];
- for (int i = 0; i < bundles.length; i++) {
- // System.out.println("bundles[" + i + "]=" + bundles[i]);
- try {
- if (bundles[i].getBundleId() == 0) // SystemBundle
- bInfos[i] = new BundleInfo(bundles[i].getSymbolicName(), (String) bundles[i].getHeaders().get(Constants.BUNDLE_VERSION), FileLocator.getBundleFile(bundles[i]).getAbsoluteFile().toURI(), -1, true);
- else {
- bInfos[i] = new BundleInfo(bundles[i].getSymbolicName(), (String) bundles[i].getHeaders().get(Constants.BUNDLE_VERSION), FileLocator.getBundleFile(bundles[i]).getAbsoluteFile().toURI(), startLevel.getBundleStartLevel(bundles[i]), startLevel.isBundlePersistentlyStarted(bundles[i]));
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- configData.setBundles(bInfos);
- platformProperties = this.getRunningPlatformProperties();
-
- // copy system properties to ConfigData
- Properties props = System.getProperties();
- for (Enumeration enumeration = props.keys(); enumeration.hasMoreElements();) {
- String key = (String) enumeration.nextElement();
- String value = props.getProperty(key);
- if (toBeEliminated(key))
- continue;
- configData.setProperty(key, value);
- }
-
- // update initialBundleStartLevel
- int initialBSL = configData.getInitialBundleStartLevel();
- if (initialBSL != startLevelService.getInitialBundleStartLevel())
- configData.setInitialBundleStartLevel(startLevelService.getInitialBundleStartLevel());
-
- // for (int j = 0; j < bInfos.length; j++)
- // configData.addBundle(bInfos[j]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.equinox.internal.provisional.frameworkadmin.Manipulator#load()
- */
- public void load() throws IllegalStateException, IOException, FrameworkAdminRuntimeException {
- Log.log(LogService.LOG_DEBUG, this, "load()", "BEGIN");
- loadWithoutFwPersistentData();
-
- BundlesState bundlesState = null;
- if (EquinoxBundlesState.checkFullySupported()) {
- bundlesState = new EquinoxBundlesState(context, fwAdmin, this, platformAdmin, !launcherData.isClean());
- platformProperties = ((EquinoxBundlesState) bundlesState).getPlatformProperties();
- } else {
- bundlesState = new SimpleBundlesState(fwAdmin, this, EquinoxConstants.FW_SYMBOLIC_NAME);
- platformProperties.clear();
- }
- updateAccordingToExpectedState(bundlesState);
- // if (!useConfigurator)
- // return;
- setConfiguratorManipulator();
- if (this.configuratorManipulator == null)
- return;
- configuratorManipulator.updateBundles(this);
- return;
- }
-
- private void loadWithoutFwPersistentData() throws IOException {
- SimpleBundlesState.checkAvailability(fwAdmin);
- File launcherConfigFile = getLauncherConfigLocation(launcherData);
- if (launcherConfigFile != null && !launcherConfigFile.getName().endsWith(IGNORED)) {
- // use launcher. -- > load from LaucnherConfig file.
- // the parameters in memory will be updated.
- EclipseLauncherParser parser = new EclipseLauncherParser();
- parser.read(launcherConfigFile, launcherData);
- }
- checkConsistencyOfFwConfigLocAndFwPersistentDataLoc(launcherData);
-
- File fwConfigFile = new File(launcherData.getFwConfigLocation(), EquinoxConstants.CONFIG_INI);
- EquinoxFwConfigFileParser parser = new EquinoxFwConfigFileParser(context);
- if (fwConfigFile.exists())
- try {
- parser.readFwConfig(this, fwConfigFile);
- } catch (URISyntaxException e) {
- throw new FrameworkAdminRuntimeException(e, "loading");
- }
- }
-
- // Save all parameter in memory into proper config files.
- public void save(boolean backup) throws IOException, FrameworkAdminRuntimeException {
- Log.log(LogService.LOG_DEBUG, this, "save()", "BEGIN");
- SimpleBundlesState.checkAvailability(fwAdmin);
-
- try {
- updateAccordingToExpectedState(this.getBundlesState());
- } catch (IllegalStateException e) {
- // ignore.
- }
-
- boolean stateIsEmpty = configData.getBundles().length == 0;
-
- File launcherConfigFile = getLauncherConfigLocation(launcherData);
- if (launcherConfigFile != null) {
- if (!stateIsEmpty) {
- // Use launcher. -- > save LauncherConfig file.
- EclipseLauncherParser launcherParser = new EclipseLauncherParser();
- launcherParser.save(launcherData, backup);
- } else {
- // No bundles in configuration, so delete the launcher config file
- launcherConfigFile.delete();
- }
- }
-
- checkConsistencyOfFwConfigLocAndFwPersistentDataLoc(launcherData);
-
- ConfiguratorManipulator previousConfigurator = setConfiguratorManipulator();
- if (previousConfigurator != null)
- previousConfigurator.cleanup(this);
-
- BundleInfo[] newBInfos = null;
- if (configuratorManipulator != null) { // Optimize BundleInfo[]
- try {
- newBInfos = configuratorManipulator.save(this, backup);
- } catch (IllegalStateException e) {
- if (LOG_ILLEGALSTATEEXCEPTION)
- Log.log(LogService.LOG_WARNING, this, "save()", e); //$NON-NLS-1$
- newBInfos = configData.getBundles();
- }
- } else {
- newBInfos = configData.getBundles();
- }
-
- if (!stateIsEmpty) {
- // Save FwConfigFile
- EquinoxFwConfigFileParser parser = new EquinoxFwConfigFileParser(context);
- parser.saveFwConfig(newBInfos.length != 0 ? newBInfos : getConfigData().getBundles(), this, backup, false);
- } else {
- File configDir = launcherData.getFwConfigLocation();
- File outputFile = new File(configDir, EquinoxConstants.CONFIG_INI);
- if (outputFile != null && outputFile.exists()) {
- outputFile.delete();
- }
- if (configDir != null && configDir.exists()) {
- configDir.delete();
- }
- }
- }
-
- public void setConfigData(ConfigData configData) {
- this.configData.initialize();
- this.configData.setInitialBundleStartLevel(configData.getInitialBundleStartLevel());
- this.configData.setBeginningFwStartLevel(configData.getBeginingFwStartLevel());
- BundleInfo[] bInfos = configData.getBundles();
- for (int i = 0; i < bInfos.length; i++)
- this.configData.addBundle(bInfos[i]);
- this.configData.setProperties(configData.getProperties());
- if (this.configData.getFwName().equals(configData.getFwName()))
- if (this.configData.getFwVersion().equals(configData.getFwVersion())) {
- // TODO refine the algorithm to copying fw dependent props.
- // configData.getFwName()/getFwVersion()/
- // getLauncherName()/getLauncherVersion() might be taken into consideration.
- this.configData.setProperties(configData.getProperties());
- }
- }
-
- /**
- * 1. get all ServiceReferences of ConfiguratorManipulator.
- * 2. Check if there any ConfiguratorBundle in the Bundles list that can be manipulated by
- * the available ConfiguratorManipulators.
- * 3. Choose the one that will be firstly started among them.
- * 4. set the object that corresponds to the chosen ConfiguratorBundle.
- *
- */
- private ConfiguratorManipulator setConfiguratorManipulator() {
- if (context == null) {
- this.configuratorManipulator = this.fwAdmin.getConfiguratorManipulator();
- return null;
- }
- ServiceReference[] references = cmTracker.getServiceReferences();
- if (references == null)
- return null;
-
- // int count = cmTracker.getTrackingCount();
- // if (count == this.trackingCount)
- // return;
- // this.trackingCount = count;
-
- BundleInfo[] bInfos = configData.getBundles();
- int initialBSL = configData.getInitialBundleStartLevel();
- bInfos = Utils.sortBundleInfos(bInfos, initialBSL);
- //int index = -1;
- ConfiguratorManipulator previousConfiguratorManipulator = configuratorManipulator;
- configuratorManipulator = null;
- for (int i = 0; i < bInfos.length; i++) {
- URI location = bInfos[i].getLocation();
- if (!bInfos[i].isMarkedAsStarted())
- continue;
- for (int j = 0; j < references.length; j++)
- if (references[j].getProperty(ConfiguratorManipulator.SERVICE_PROP_KEY_CONFIGURATOR_BUNDLESYMBOLICNAME).equals(Utils.getPathFromClause(Utils.getManifestMainAttributes(location, Constants.BUNDLE_SYMBOLICNAME)))) {
- configuratorManipulator = (ConfiguratorManipulator) cmTracker.getService(references[j]);
- break;
- }
- if (configuratorManipulator != null)
- break;
- }
- if (configuratorManipulator != previousConfiguratorManipulator)
- return previousConfiguratorManipulator;
- return null;
- }
-
- public void setLauncherData(LauncherData value) {
- launcherData.initialize();
- launcherData.setFwConfigLocation(value.getFwConfigLocation());
- launcherData.setFwPersistentDataLocation(value.getFwPersistentDataLocation(), value.isClean());
- launcherData.setJvm(value.getJvm());
- launcherData.setJvmArgs(value.getJvmArgs());
- launcherData.setOS(value.getOS());
- if (launcherData.getFwName().equals(value.getFwName()))
- if (launcherData.getFwVersion().equals(value.getFwVersion())) {
- // TODO launcherData.getFwName()/getFwVersion()/
- // getLauncherName()/getLauncherVersion() might be taken into consideration
- // for copying .
- launcherData.setFwJar(value.getFwJar());
- launcherData.setHome(value.getHome());
- launcherData.setLauncher(value.getLauncher());
- launcherData.setLauncherConfigLocation(value.getLauncherConfigLocation());
- }
- }
-
- /**
- * Temporal implementation.
- *
- * If a property of the given key should be eliminated
- * from FwDependentProperties and FwIndependentProperties,
- * return true. Otherwise false.
- *
- * @param key
- * @return true if it should be elimineted from FwDependentProperties and FwIndependentProperties,
- */
- private boolean toBeEliminated(String key) {
- if (key.startsWith("java."))
- return true;
- return false;
- }
-
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("++++++++++++++++++++++++++++++++++++++++++\n" + "Class:" + this.getClass().getName() + "\n");
- sb.append("------------- LauncherData -----------\n");
- sb.append(launcherData.toString());
- sb.append("------------- ConfigData -----------\n");
- sb.append(configData.toString());
- sb.append("\n" + Utils.toStringProperties("platformProperties", this.platformProperties));
- sb.append("++++++++++++++++++++++++++++++++++++++++++\n");
- return sb.toString();
- }
-
- private void updateAccordingToExpectedState(BundlesState bundlesState) {
- // File newFwJar = EquinoxBundlesState.getFwJar(launcherData, configData);
- // if (bundlesState instanceof EquinoxBundlesState)
- // ((EquinoxBundlesState) bundlesState).setFwJar(newFwJar);
- //
- // if (launcherData.getFwJar() == null && newFwJar != null)
- // launcherData.setFwJar(newFwJar);
- BundleInfo[] newBundleInfos = bundlesState.getExpectedState();
- configData.setBundles(newBundleInfos);
- }
-
- public static String makeRelative(String original, String rootPath) {
- IPath path = new Path(original);
- // ensure we have an absolute path to start with
- if (!path.isAbsolute())
- return original;
-
- //Returns the original string if no relativization has been done
- IPath result = path.makeRelativeTo(new Path(rootPath));
- return path.equals(result) ? original : result.toString();
- }
-
- public static String makeRelative(String urlString, URL rootURL) {
- // we only traffic in file: URLs
- int index = urlString.indexOf(FILE_PROTOCOL);
- if (index == -1)
- return urlString;
- index = index + 5;
-
- // ensure we have an absolute path to start with
- boolean done = false;
- URL url = null;
- String file = urlString;
- while (!done) {
- try {
- url = new URL(file);
- file = url.getFile();
- } catch (java.net.MalformedURLException e) {
- done = true;
- }
- }
- if (url == null || !new File(url.getFile()).isAbsolute())
- return urlString;
-
- String rootString = rootURL.toExternalForm();
- IPath one = new Path(urlString.substring(index));
- IPath two = new Path(rootString.substring(rootString.indexOf(FILE_PROTOCOL) + 5));
- String deviceOne = one.getDevice();
- String deviceTwo = two.getDevice();
- // do checking here because we want to return the exact string we got initially if
- // we are unable to make it relative.
- if (deviceOne != deviceTwo && (deviceOne == null || !deviceOne.equalsIgnoreCase(two.getDevice())))
- return urlString;
-
- return urlString.substring(0, index) + one.makeRelativeTo(two);
- }
-
- public static String makeArrayRelative(String array, URL rootURL) {
- StringBuffer buffer = new StringBuffer();
- for (StringTokenizer tokenizer = new StringTokenizer(array, COMMA); tokenizer.hasMoreTokens();) {
- String token = tokenizer.nextToken();
- String absolute = makeRelative(token, rootURL);
- buffer.append(absolute);
- if (tokenizer.hasMoreTokens())
- buffer.append(',');
- }
- return buffer.toString();
- }
-
- public static String makeArrayAbsolute(String array, URL rootURL) {
- StringBuffer buffer = new StringBuffer();
- for (StringTokenizer tokenizer = new StringTokenizer(array, COMMA); tokenizer.hasMoreTokens();) {
- String token = tokenizer.nextToken();
- String absolute = makeAbsolute(token, rootURL);
- buffer.append(absolute);
- if (tokenizer.hasMoreTokens())
- buffer.append(',');
- }
- return buffer.toString();
- }
-
- /*
- * Make the given path absolute to the specified root, if applicable. If not, then
- * return the path as-is.
- *
- * TODO: can we use URIUtil in these #make* methods?
- */
- public static String makeAbsolute(String original, String rootPath) {
- IPath path = new Path(original);
- // ensure we have a relative path to start with
- if (path.isAbsolute())
- return original;
- IPath root = new Path(rootPath);
- return root.addTrailingSeparator().append(original.replace(':', '}')).toOSString().replace('}', ':');
- }
-
- public static String makeAbsolute(String urlString, URL rootURL) {
- // we only traffic in file: URLs
- int index = urlString.indexOf(FILE_PROTOCOL);
- if (index == -1)
- return urlString;
- index = index + 5;
-
- // ensure we have a relative path to start with
- boolean done = false;
- URL url = null;
- String file = urlString;
- while (!done) {
- try {
- url = new URL(file);
- file = url.getFile();
- } catch (java.net.MalformedURLException e) {
- done = true;
- }
- }
- if (url == null || new File(url.getFile()).isAbsolute())
- return urlString;
-
- return urlString.substring(0, index - 5) + makeAbsolute(urlString.substring(index), rootURL.toExternalForm());
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/Log.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/Log.java
deleted file mode 100644
index e83b920..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/Log.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.equinox;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.service.log.LogService;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * Utility class with static methods for logging to LogService, if available
- */
-public class Log {
- static private ServiceTracker logTracker;
- static private boolean useLog = false;
-
- public static void dispose() {
- if (logTracker != null) {
- logTracker.close();
- }
- logTracker = null;
- }
-
- public static void init(BundleContext bc) {
- logTracker = new ServiceTracker(bc, LogService.class.getName(), null);
- logTracker.open();
- }
-
- public static void log(int level, Object obj, String method, String message) {
- log(level, obj, method, message, null);
- }
-
- public static void log(int level, Object obj, String method, String message, Throwable e) {
- LogService logService = null;
- String msg = "";
- if (method == null) {
- if (obj != null)
- msg = "(" + obj.getClass().getName() + ")";
- } else if (obj == null)
- msg = "[" + method + "]" + message;
- else
- msg = "[" + method + "](" + obj.getClass().getName() + ")";
- msg += message;
- if (logTracker != null)
- logService = (LogService) logTracker.getService();
-
- if (logService != null) {
- logService.log(level, msg, e);
- } else {
- String levelSt = null;
- if (level == LogService.LOG_DEBUG)
- levelSt = "DEBUG";
- else if (level == LogService.LOG_INFO)
- levelSt = "INFO";
- else if (level == LogService.LOG_WARNING)
- levelSt = "WARNING";
- else if (level == LogService.LOG_ERROR) {
- levelSt = "ERROR";
- useLog = true;
- }
- if (useLog) {
- System.err.println("[" + levelSt + "]" + msg);
- if (e != null)
- e.printStackTrace();
- }
- }
- }
-
- public static void log(int level, Object obj, String method, Throwable e) {
- log(level, obj, method, null, e);
- }
-
- public static void log(int level, String message) {
- log(level, null, null, message, null);
- }
-
- public static void log(int level, String message, Throwable e) {
- log(level, null, null, message, e);
- }
-
- private Log() {
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/Messages.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/Messages.java
deleted file mode 100644
index de7c16b..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/Messages.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**********************************************************************
- * Copyright (c) 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 - Initial API and implementation
- **********************************************************************/
-package org.eclipse.equinox.internal.frameworkadmin.equinox;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.frameworkadmin.equinox.messages";//$NON-NLS-1$
-
- public static String exception_inputFileIsDirectory;
- public static String exception_fwConfigLocationName;
- public static String exception_failedToCreateDir;
- public static String exception_failedToRename;
- public static String exception_launcherLocationNotSet;
- public static String exception_noInstallArea;
- public static String exception_fileURLExpected;
- public static String exception_bundleManifest;
- public static String exception_createAbsoluteURI;
- public static String exception_nullConfigArea;
- public static String exception_noFrameworkLocation;
- public static String exception_errorSavingConfigIni;
-
- public static String log_configFile;
- public static String log_configProps;
- public static String log_renameSuccessful;
- public static String log_fwConfigSave;
- public static String log_launcherConfigSave;
- public static String log_shared_config_url;
- public static String log_shared_config_relative_url;
- public static String log_shared_config_file_missing;
- public static String log_failed_reading_properties;
- public static String log_failed_make_absolute;
- public static String log_failed_make_relative;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/ParserUtils.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/ParserUtils.java
deleted file mode 100644
index 973795a..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/ParserUtils.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.equinox;
-
-import java.io.File;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.List;
-import java.util.Properties;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.utils.FileUtils;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.LauncherData;
-import org.eclipse.osgi.service.environment.Constants;
-import org.eclipse.osgi.util.NLS;
-import org.osgi.service.log.LogService;
-
-public class ParserUtils {
- private static final String FILE_PROTOCOL = "file:"; //$NON-NLS-1$
-
- public static File getOSGiInstallArea(List programArgs, Properties properties, LauncherData launcherData) {
- if (launcherData == null)
- return null;
-
- //TODO This is not enough because if you only have -startup then osgi.install.area from the config.ini is used
- File result = getOSGiInstallArea(programArgs, properties, launcherData.getLauncher() == null ? null : launcherData.getLauncher().getParentFile().toURI());
- if (result != null)
- return result;
-
- if (launcherData.getFwJar() != null)
- return fromOSGiJarToOSGiInstallArea(launcherData.getFwJar().getAbsolutePath());
-
- File launcherFile = launcherData.getLauncher();
- if (launcherFile != null) {
- if (Constants.OS_MACOSX.equals(launcherData.getOS())) {
- //the equinox launcher will look 3 levels up on the mac when going from executable to launcher.jar
- //see org.eclipse.equinox.executable/library/eclipse.c : findStartupJar();
- IPath launcherPath = new Path(launcherFile.getAbsolutePath());
- if (launcherPath.segmentCount() > 4) {
- //removing "Eclipse.app/Contents/MacOS/eclipse"
- launcherPath = launcherPath.removeLastSegments(4);
- return launcherPath.toFile();
- }
- }
- return launcherFile.getParentFile();
- }
- return null;
- }
-
- public static URI getFrameworkJar(List lines, URI launcherFolder) {
- String fwk = ParserUtils.getValueForArgument(EquinoxConstants.OPTION_FW, lines);
- if (fwk == null) {
- //Search the file system using the default location
- URI location = FileUtils.getEclipsePluginFullLocation(EquinoxConstants.FW_SYMBOLIC_NAME, new File(URIUtil.toFile(launcherFolder), EquinoxConstants.PLUGINS_DIR));
- if (location != null)
- return location;
- return null;
- }
- try {
- return URIUtil.makeAbsolute(URIUtil.fromString(fwk), launcherFolder);
- } catch (URISyntaxException e) {
- Log.log(LogService.LOG_ERROR, NLS.bind(Messages.exception_createAbsoluteURI, fwk, launcherFolder));
- return null;
- }
- }
-
- //This method should only be used to determine the osgi install area when reading the eclipse.ini
- public static File getOSGiInstallArea(List args, Properties properties, URI base) {
- if (args == null)
- return null;
- String install = getValueForArgument(EquinoxConstants.OPTION_INSTALL, args);
- if (install == null && properties != null)
- install = properties.getProperty("osgi.install.area"); //$NON-NLS-1$
-
- if (install != null) {
- if (install.startsWith(FILE_PROTOCOL))
- install = install.substring(FILE_PROTOCOL.length() + 1);
- File installFile = new File(install);
- if (installFile.isAbsolute())
- return installFile;
- return URIUtil.toFile(URIUtil.makeAbsolute(installFile.toURI(), base));
- }
-
- String startup = getValueForArgument(EquinoxConstants.OPTION_STARTUP, args);
- if (startup != null && base != null) {
- if (startup.startsWith(FILE_PROTOCOL)) {
- try {
- URI startupURI = new URI(startup);
- startup = new File(startupURI).getAbsolutePath();
- } catch (URISyntaxException e) {
- startup = startup.substring(FILE_PROTOCOL.length() + 1);
- }
- }
-
- File osgiInstallArea = fromOSGiJarToOSGiInstallArea(startup);
- if (osgiInstallArea.isAbsolute())
- return osgiInstallArea;
-
- File baseFile = new File(base);
- return new File(baseFile, osgiInstallArea.getPath());
- }
- return null;
- }
-
- public static File fromOSGiJarToOSGiInstallArea(String path) {
- IPath parentFolder = new Path(path).removeLastSegments(1);
- if (parentFolder.lastSegment().equalsIgnoreCase("plugins")) //$NON-NLS-1$
- return parentFolder.removeLastSegments(1).toFile();
- return parentFolder.toFile();
- }
-
- public static boolean isArgumentSet(String arg, List args) {
- if (arg == null || args == null)
- return false;
- for (int i = 0; i < args.size(); i++) {
- if (args.get(i) == null)
- continue;
- if (((String) args.get(i)).equalsIgnoreCase(arg)) {
- return true;
- }
- }
- return false;
- }
-
- public static String getValueForArgument(String arg, List args) {
- if (arg == null || args == null)
- return null;
- for (int i = 0; i < args.size(); i++) {
- if (args.get(i) == null)
- continue;
- if (((String) args.get(i)).equalsIgnoreCase(arg)) {
- if (i + 1 < args.size() && args.get(i + 1) != null && ((String) args.get(i + 1)).charAt(0) != '-')
- return (String) args.get(i + 1);
- }
- }
- return null;
- }
-
- public static boolean setValueForArgument(String arg, String value, List args) {
- if (arg == null || args == null)
- return false;
-
- for (int i = 0; i < args.size(); i++) {
- if (args.get(i) == null)
- continue;
- String currentArg = ((String) args.get(i)).trim();
- if (currentArg.equalsIgnoreCase(arg)) {
- if (i + 1 < args.size()) {
- String nextArg = (String) args.get(i + 1);
- if (nextArg == null || nextArg.charAt(0) != '-') {
- args.set(i + 1, value);
- } else {
- args.add(i + 1, value);
- }
- return true;
- }
- // else just append the value on the end
- args.add(value);
- return true;
- }
- }
- args.add(arg);
- args.add(value);
- return true;
- }
-
- public static boolean removeArgument(String arg, List args) {
- if (arg == null || args == null)
- return false;
- for (int i = 0; i < args.size(); i++) {
- if (args.get(i) == null)
- continue;
- String currentArg = ((String) args.get(i)).trim();
- if (currentArg.equalsIgnoreCase(arg)) {
- args.set(i, null);
- while (i + 1 < args.size() && args.get(i + 1) != null && ((String) args.get(i + 1)).charAt(0) != '-') {
- args.set(i + 1, null);
- i++;
- }
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/messages.properties b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/messages.properties
deleted file mode 100644
index 6614607..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/messages.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-###############################################################################
-# Copyright (c) 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
-###############################################################################
-
-exception_inputFileIsDirectory= Illegal Argument: inputFile {0} must not be a directory.
-exception_fwConfigLocationName = Illegal State: Framework Configuration location "{0}" does not match {1}.
-exception_failedToCreateDir = Failed to create directory {0}.
-exception_failedToRename=Failed to rename {0} to {1}.
-exception_launcherLocationNotSet=The launcher location has not been set.
-exception_noInstallArea=Unable to determine osgi.install.area.
-exception_fileURLExpected= The property {0} = {1} is expected to be a \"file:\" URL.
-exception_bundleManifest= Unable to get bundle manifest for: {0}
-exception_createAbsoluteURI=Failed to create absolute URI from \"{0}\" and \"{1}\".
-exception_nullConfigArea=The configuration area is not set.
-exception_noFrameworkLocation = Unable to determinate the osgi.framework location.
-exception_errorSavingConfigIni = Error saving config.ini.
-
-log_configFile= Configuration file ({0}) has been read successfully.
-log_configProps= Configuration properties is empty.
-log_renameSuccessful= Successfully renamed {0} to {1}.
-log_fwConfigSave= Framework Configuration was saved successfully in {0}.
-log_launcherConfigSave= Launcher Configuration was saved successfully in {0}.
-log_shared_config_url=Failed creating shared configuration url for {0}.
-log_shared_config_relative_url=Failed creating shared configuration url for root: {0} and sharedConfiguration: {1}.
-log_shared_config_file_missing=Failed creating shared configuration. File missing: {0}.
-log_failed_reading_properties=Failed reading properties from file: {0}.
-log_failed_make_absolute=Failed to create absolute path for {0}.
-log_failed_make_relative=Failed to create relative path for {0}.
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/utils/FileUtils.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/utils/FileUtils.java
deleted file mode 100644
index e5a439f..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/utils/FileUtils.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.frameworkadmin.equinox.utils;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxConstants;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.ParserUtils;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.LauncherData;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.Manipulator;
-import org.eclipse.osgi.service.environment.Constants;
-import org.osgi.framework.Version;
-
-public class FileUtils {
- private static String FILE_SCHEME = "file"; //$NON-NLS-1$
- private static String FILE_PROTOCOL = "file:"; //$NON-NLS-1$
- private static String REFERENCE_PROTOCOL = "reference:"; //$NON-NLS-1$
- private static String INITIAL_PREFIX = "initial@"; //$NON-NLS-1$
-
- // based on org.eclipse.core.runtime.adaptor.EclipseStarter#searchForBundle
- public static URI getEclipseRealLocation(Manipulator manipulator, String location) {
- //if this is some form of URL just return it
- try {
- new URL(location);
- return URIUtil.makeAbsolute(new URI(location), ParserUtils.getOSGiInstallArea(Arrays.asList(manipulator.getLauncherData().getProgramArgs()), manipulator.getConfigData().getProperties(), manipulator.getLauncherData()).toURI());
- } catch (URISyntaxException e) {
- // expected
- } catch (MalformedURLException e) {
- // expected
- }
-
- File base = new File(location);
- if (!base.isAbsolute()) {
- String pluginsDir = getSysPath(manipulator);
- if (pluginsDir == null)
- return null;
- base = new File(pluginsDir, location);
- }
-
- return getEclipsePluginFullLocation(base.getName(), base.getParentFile());
- }
-
- //This mimics the logic of EclipseStarter#getSysPath();
- private static String getSysPath(final Manipulator manipulator) {
- Properties properties = manipulator.getConfigData().getProperties();
- String path = (String) properties.get(EquinoxConstants.PROP_OSGI_SYSPATH);
- if (path != null)
- return path;
- path = (String) properties.get(EquinoxConstants.PROP_OSGI_FW);
- if (path != null) {
- if (path.startsWith(FILE_PROTOCOL))
- path = path.substring(FILE_PROTOCOL.length());
- File file = new File(path);
- return file.getParentFile().getAbsolutePath();
- }
-
- LauncherData launcherData = manipulator.getLauncherData();
- File home = launcherData.getHome();
- File pluginsDir = null;
- if (home != null)
- pluginsDir = new File(home, EquinoxConstants.PLUGINS_DIR);
- else if (launcherData.getFwJar() != null)
- pluginsDir = launcherData.getFwJar().getParentFile();
- else if (launcherData.getLauncher() != null) {
- File launcherDir = null;
- if (Constants.OS_MACOSX.equals(launcherData.getOS())) {
- IPath launcherPath = new Path(launcherData.getLauncher().getAbsolutePath());
- if (launcherPath.segmentCount() > 4) {
- launcherPath = launcherPath.removeLastSegments(4);
- launcherDir = launcherPath.toFile();
- }
- } else
- launcherDir = launcherData.getLauncher().getParentFile();
- pluginsDir = new File(launcherDir, EquinoxConstants.PLUGINS_DIR);
- }
- if (pluginsDir != null)
- return pluginsDir.getAbsolutePath();
- return null;
- }
-
- public static String removeEquinoxSpecificProtocols(String location) {
- if (location == null)
- return null;
- String ret = location;
- if (location.startsWith(REFERENCE_PROTOCOL))
- ret = location.substring(REFERENCE_PROTOCOL.length());
- else if (location.startsWith(INITIAL_PREFIX))
- ret = location.substring(INITIAL_PREFIX.length());
- return ret;
- }
-
- public static URI getRealLocation(Manipulator manipulator, final String location) {
- return FileUtils.getEclipseRealLocation(manipulator, removeEquinoxSpecificProtocols(location));
- }
-
- /**
- * If a bundle of the specified location is in the Eclipse plugin format (either plugin-name_version.jar
- * or as a folder named plugin-name_version ), return version string.Otherwise, return null;
- *
- * @return version string. If invalid format, return null.
- */
- private static Version getVersion(String version) {
- if (version.length() == 0)
- return Version.emptyVersion;
-
- if (version.endsWith(".jar")) //$NON-NLS-1$
- version = version.substring(0, version.length() - 4);
-
- try {
- return new Version(version);
- } catch (IllegalArgumentException e) {
- // bad format
- return null;
- }
- }
-
- /**
- * Find the named plugin in the given bundlesDir
- * @param pluginName
- * @param bundlesDir
- * @return a URL string for the found plugin, or null
- */
- // Based on org.eclipse.core.runtime.adaptor.EclipseStarter#searchFor
- public static URI getEclipsePluginFullLocation(String pluginName, File bundlesDir) {
- if (bundlesDir == null)
- return null;
- File[] candidates = bundlesDir.listFiles();
- if (candidates == null)
- return null;
-
- File result = null;
- Version maxVersion = null;
-
- for (int i = 0; i < candidates.length; i++) {
- String candidateName = candidates[i].getName();
- if (!candidateName.startsWith(pluginName))
- continue;
-
- if (candidateName.length() > pluginName.length() && candidateName.charAt(pluginName.length()) != '_') {
- // allow jar file with no _version tacked on the end
- if (!candidates[i].isFile() || (candidateName.length() != 4 + pluginName.length()) || !candidateName.endsWith(".jar")) //$NON-NLS-1$
- continue;
- }
-
- String candidateVersion = ""; //$NON-NLS-1$
- if (candidateName.length() > pluginName.length() + 1 && candidateName.charAt(pluginName.length()) == '_')
- candidateVersion = candidateName.substring(pluginName.length() + 1);
-
- Version currentVersion = getVersion(candidateVersion);
- if (currentVersion == null)
- continue;
-
- if (maxVersion == null || maxVersion.compareTo(currentVersion) < 0) {
- maxVersion = currentVersion;
- result = candidates[i];
- }
- }
- return result != null ? result.getAbsoluteFile().toURI() : null;
- }
-
- public static URI fromPath(String path) throws URISyntaxException {
- if (path.startsWith(FILE_PROTOCOL)) {
- try {
- return new URI(path);
- } catch (URISyntaxException e) {
- path = path.substring(FILE_PROTOCOL.length() + 1);
- }
- }
-
- File f = new File(path);
- if (f.isAbsolute())
- return f.toURI();
- return URIUtil.fromString(FILE_PROTOCOL + path);
- }
-
- public static String toPath(URI uri) {
- if (!FILE_SCHEME.equalsIgnoreCase(uri.getScheme()))
- return new File(URIUtil.toUnencodedString(uri)).getPath();
- return URIUtil.toFile(uri).getAbsolutePath();
- }
-
- public static String toFileURL(URI uri) {
- if (uri.getScheme() != null)
- return URIUtil.toUnencodedString(uri);
- return FILE_PROTOCOL + URIUtil.toUnencodedString(uri);
- }
-
- public static URI fromFileURL(String url) throws URISyntaxException {
- if (url.startsWith(FILE_PROTOCOL)) {
- return URIUtil.fromString(new File(url.substring(FILE_PROTOCOL.length())).isAbsolute() ? url : url.substring(FILE_PROTOCOL.length()));
- }
- throw new URISyntaxException(url, "Not a file url");
- }
-
- /**
- * Loads an ini file, returning a list of all non-blank lines in the file.
- */
- public static List loadFile(File file) throws IOException {
- BufferedReader br = null;
- try {
- br = new BufferedReader(new FileReader(file));
-
- String line;
- List list = new ArrayList();
- while ((line = br.readLine()) != null) {
- //skip whitespace
- if (line.trim().length() > 0)
- list.add(line);
- }
- return list;
- } finally {
- if (br != null)
- try {
- br.close();
- } catch (IOException e) {
- //Ignore
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/.classpath b/bundles/org.eclipse.equinox.frameworkadmin.test/.classpath
deleted file mode 100644
index 6f3b481..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/.project b/bundles/org.eclipse.equinox.frameworkadmin.test/.project
deleted file mode 100644
index 3f88654..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.equinox.frameworkadmin.test</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ac0fd9e..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,9 +0,0 @@
-#Wed Oct 24 10:14:02 EDT 2007
-eclipse.preferences.version=1
-formatter_profile=_core
-formatter_settings_version=11
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=;
-org.eclipse.jdt.ui.ondemandthreshold=3
-org.eclipse.jdt.ui.staticondemandthreshold=3
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index c231f4e..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Wed Oct 24 10:11:19 EDT 2007
-eclipse.preferences.version=1
-pluginProject.extensions=false
-resolve.requirebundle=false
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/Framework Admin Test.launch b/bundles/org.eclipse.equinox.frameworkadmin.test/Framework Admin Test.launch
deleted file mode 100644
index c9e9787..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/Framework Admin Test.launch
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
-<booleanAttribute key="append.args" value="true"/>
-<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
-<booleanAttribute key="askclear" value="false"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="false"/>
-<stringAttribute key="deselected_workspace_plugins" value="org.eclipse.equinox.p2.ui.sdk,ie.wombat.jbdiff.test,org.eclipse.equinox.p2.tools,org.eclipse.equinox.p2.ui.admin,org.eclipse.equinox.p2.ui.admin.rcp,org.eclipse.equinox.p2.selfhosting"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AllTests.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/IBM-1.6.0-20090519-SR5"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.equinox.frameworkadmin.tests.AllTests"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.equinox.frameworkadmin.test"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.equinox.p2.director.app.product"/>
-<booleanAttribute key="run_in_ui_thread" value="true"/>
-<stringAttribute key="selected_target_plugins" value="org.eclipse.swt.win32.win32.x86@default:false,org.mortbay.jetty.util@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.jface.databinding@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.osgi.util@default:default,org.eclipse.equinox.http.registry@default:default,javax.servlet@default:default,org.eclipse.equinox.common@2:true,org.eclipse.ui.navigator@default:default,org.eclipse.text@default:default,org.eclipse.ui.ide@default:default,org.eclipse.equinox.security.win32.x86@default:false,org.apache.lucene.analysis@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.apache.ant@default:default,org.eclipse.core.filesystem.win32.x86@default:false,org.eclipse.swt@default:default,org.eclipse.core.resources.win32.x86@default:false,org.eclipse.osgi.services@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.core.commands@default:default,org.apache.commons.el@default:default,org.eclipse.team.core@default:default,org.eclipse.search@default:default,org.eclipse.ecf@default:default,org.eclipse.equinox.security@default:default,org.eclipse.jdt.core@default:default,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.app@default:default,com.ibm.icu@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.core.net.win32.x86@default:false,org.eclipse.compare@default:default,org.apache.commons.logging@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.jface.text@default:default,org.eclipse.update.core.win32@default:false,org.eclipse.osgi@-1:true,org.eclipse.core.net@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.equinox.security.ui@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.ecf.identity@default:default,org.junit@default:default,org.eclipse.core.variables@default:default,javax.servlet.jsp@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.update.core@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.ide.application@default:default,org.apache.lucene@default:default,org.eclipse.team.ui@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.help.ui@default:default,org.eclipse.ui.console@default:default,org.eclipse.core.runtime@default:true,org.eclipse.equinox.http.servlet@default:default,org.eclipse.core.databinding@default:default,org.eclipse.jface@default:default,org.eclipse.ui.editors@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.help.base@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.ant.core@default:default,org.eclipse.ui.win32@default:false,org.eclipse.debug.ui@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.jobs@default:default,org.eclipse.debug.core@default:default,org.eclipse.help@default:default,org.eclipse.ui@default:default,org.eclipse.core.expressions@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.equinox.preferences@default:default,org.eclipse.update.configurator@3:true,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.pde.junit.runtime@default:default,org.eclipse.compare.core@default:default,org.mortbay.jetty.server@default:default,org.apache.jasper@default:default,org.eclipse.update.ui@default:default,org.eclipse.ui.views@default:default,org.eclipse.core.resources@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.eclipse.equinox.p2.testserver@default:default,org.eclipse.equinox.p2.tests@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.core.tests.harness@default:default,org.eclipse.equinox.p2.exemplarysetup@default:default,org.eclipse.jdt.core@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.equinox.p2.tests.verifier@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.equinox.p2.tests.ui@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.http@default:default,org.eclipse.sdk@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.equinox.p2.director.app@default:default,aniefer.preferences.synchronizer@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.metadata.generator@default:default,org.eclipse.equinox.p2.ui.sdk.scheduler@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.platform.doc.isv@default:default,org.eclipse.equinox.frameworkadmin.test@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.installer@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.reconciler.dropins@default:default,ie.wombat.jbdiff@default:default,org.eclipse.equinox.p2.console@default:default,org.eclipse.equinox.p2.sar@default:default,org.eclipse.equinox.p2.directorywatcher@default:default,org.eclipse.pde.core@default:default,org.easymock@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.sat4j.core@default:default,org.eclipse.equinox.p2.artifact.optimizers@default:default,org.eclipse.equinox.p2.artifact.processors@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.ant.core@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.swt.tools@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.p2.tests.optimizers@default:default,org.eclipse.pde.build@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.pde.build.tests@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,rcp@default:default,org.eclipse.platform.doc.user@default:default,org.eclipse.pde.doc.user@default:default,org.sat4j.pb@default:default,org.eclipse.equinox.p2.updatechecker@default:default,org.eclipse.equinox.p2.extensionlocation@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.test.performance@default:default"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="useNamedJRE" value="true"/>
-<booleanAttribute key="useProduct" value="false"/>
-</launchConfiguration>
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.frameworkadmin.test/META-INF/MANIFEST.MF
deleted file mode 100644
index 3a0c6d8..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,16 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Test Plug-in for Framework Admin
-Bundle-SymbolicName: org.eclipse.equinox.frameworkadmin.test
-Bundle-Version: 1.1.0.qualifier
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.equinox.frameworkadmin,
- org.eclipse.equinox.frameworkadmin.equinox;bundle-version="1.0.100",
- org.junit;bundle-version="3.8.0"
-Bundle-Activator: org.eclipse.equinox.frameworkadmin.tests.Activator
-Import-Package: org.osgi.framework;version="1.4.0"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
-Export-Package: org.eclipse.equinox.frameworkadmin.tests
-Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/about.html b/bundles/org.eclipse.equinox.frameworkadmin.test/about.html
deleted file mode 100644
index 4602330..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/build.properties b/bundles/org.eclipse.equinox.frameworkadmin.test/build.properties
deleted file mode 100644
index 7023dcd..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 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
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- dataFile/,\
- about.html
-src.includes = about.html
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/bundle_1/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/bundle_1/META-INF/MANIFEST.MF
deleted file mode 100644
index 3a535b6..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/bundle_1/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,5 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Bundle 1
-Bundle-SymbolicName: bundle_1
-Bundle-Version: 1.0.0
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/bundle_2/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/bundle_2/META-INF/MANIFEST.MF
deleted file mode 100644
index f46d7f1..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/bundle_2/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,5 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Bundle 2
-Bundle-SymbolicName: bundle_2
-Bundle-Version: 1.0.0
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/dummy.frameworkextension_1.0.0.jar b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/dummy.frameworkextension_1.0.0.jar
deleted file mode 100644
index e693114..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/dummy.frameworkextension_1.0.0.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.equinox.launcher.jar b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.equinox.launcher.jar
deleted file mode 100644
index 5947c8d..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.equinox.launcher.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.equinox.simpleconfigurator.jar b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.equinox.simpleconfigurator.jar
deleted file mode 100644
index 8a631d8..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.equinox.simpleconfigurator.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.osgi.jar b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.osgi.jar
deleted file mode 100644
index 20ca269..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.osgi.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.osgi_3.4.0.jar b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.osgi_3.4.0.jar
deleted file mode 100644
index 793ad70..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/org.eclipse.osgi_3.4.0.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest1/conf/config.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest1/conf/config.ini
deleted file mode 100644
index c9f0304..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest1/conf/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-foo=bar
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest1/eclipse.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest1/eclipse.ini
deleted file mode 100644
index 4f54e62..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest1/eclipse.ini
+++ /dev/null
@@ -1,2 +0,0 @@
--configuration
-conf
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest3/configuration/config.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest3/configuration/config.ini
deleted file mode 100644
index c9f0304..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest3/configuration/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-foo=bar
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest3/eclipse.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest3/eclipse.ini
deleted file mode 100644
index fbcc881..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTest3/eclipse.ini
+++ /dev/null
@@ -1 +0,0 @@
--foobar
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug267850/conf/config.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug267850/conf/config.ini
deleted file mode 100644
index c9f0304..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug267850/conf/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-foo=bar
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug267850/eclipse.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug267850/eclipse.ini
deleted file mode 100644
index b31688c..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug267850/eclipse.ini
+++ /dev/null
@@ -1,11 +0,0 @@
--startup
-plugins\org.eclipse.equinox.launcher_1.0.200.v20090306-1900.jar
---launcher.library
-plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090306-1900
--showsplash
-org.eclipse.platform
---launcher.XXMaxPermSize
-256m
--vmargs
--Xms40m
--Xmx356m
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/conf/config.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/conf/config.ini
deleted file mode 100644
index c9f0304..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/conf/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-foo=bar
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/eclipse.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/eclipse.ini
deleted file mode 100644
index 06e5db0..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/eclipse.ini
+++ /dev/null
@@ -1,5 +0,0 @@
--startup
-
-plugins/org.eclipse.equinox.launcher_1.0.300.v20090720.jar
--configuration
-conf
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/sharedconfiguration/config.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/sharedconfiguration/config.ini
deleted file mode 100644
index 7a8f3fa..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/sharedconfiguration/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-config.shared=false
-from.parent=true
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/sharedconfiguration/user-config.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/sharedconfiguration/user-config.ini
deleted file mode 100644
index f46e725..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/sharedconfiguration/user-config.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-osgi.sharedConfiguration.area=file\:configuration/
-config.shared=true
-
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/sharedconfiguration/user-noshare-config.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/sharedconfiguration/user-noshare-config.ini
deleted file mode 100644
index dd1498b..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/sharedconfiguration/user-noshare-config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-config.shared=false
-
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AbstractFwkAdminTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AbstractFwkAdminTest.java
deleted file mode 100644
index f328d96..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AbstractFwkAdminTest.java
+++ /dev/null
@@ -1,432 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.frameworkadmin.tests;
-
-import java.io.*;
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-import java.util.Properties;
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.ParserUtils;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.utils.FileUtils;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.eclipse.osgi.service.datalocation.Location;
-import org.osgi.framework.*;
-import org.osgi.util.tracker.ServiceTracker;
-
-public abstract class AbstractFwkAdminTest extends TestCase {
- private ServiceTracker fwAdminTracker;
- private File testFolder;
-
- public AbstractFwkAdminTest(String name) {
- super(name);
- }
-
- /**
- * Copy an input stream to an output stream.
- * Optionally close the streams when done.
- * Return the number of bytes written.
- */
- public static int copyStream(InputStream in, boolean closeIn, OutputStream out, boolean closeOut) throws IOException {
- try {
- int written = 0;
- byte[] buffer = new byte[16 * 1024];
- int len;
- while ((len = in.read(buffer)) != -1) {
- out.write(buffer, 0, len);
- written += len;
- }
- return written;
- } finally {
- try {
- if (closeIn) {
- in.close();
- }
- } finally {
- if (closeOut) {
- out.close();
- }
- }
- }
- }
-
- public static boolean delete(File file) {
- if (!file.exists())
- return true;
- if (file.isDirectory()) {
- File[] children = file.listFiles();
- for (int i = 0; i < children.length; i++)
- delete(children[i]);
- }
- return file.delete();
- }
-
- public FrameworkAdmin getEquinoxFrameworkAdmin() throws BundleException {
- final String FILTER_OBJECTCLASS = "(" + Constants.OBJECTCLASS + "=" + FrameworkAdmin.class.getName() + ")";
- final String filterFwName = "(" + FrameworkAdmin.SERVICE_PROP_KEY_FW_NAME + "=Equinox)";
- final String filterLauncherName = "(" + FrameworkAdmin.SERVICE_PROP_KEY_LAUNCHER_NAME + "=Eclipse.exe)";
- final String filterFwAdmin = "(&" + FILTER_OBJECTCLASS + filterFwName + filterLauncherName + ")";
-
- String FWK_ADMIN_EQ = "org.eclipse.equinox.frameworkadmin.equinox";
- Bundle b = Platform.getBundle(FWK_ADMIN_EQ);
- if (b == null)
- throw new IllegalStateException("Bundle: " + FWK_ADMIN_EQ + " is required for this test");
- b.start();
-
- if (fwAdminTracker == null) {
- Filter filter;
- try {
- filter = Activator.getContext().createFilter(filterFwAdmin);
- fwAdminTracker = new ServiceTracker(Activator.getContext(), filter, null);
- fwAdminTracker.open();
- } catch (InvalidSyntaxException e) {
- // never happens
- e.printStackTrace();
- }
- }
- return (FrameworkAdmin) fwAdminTracker.getService();
- }
-
- protected File getTestFolder(String name) {
- Location instanceLocation = Platform.getInstanceLocation();
- URL url = instanceLocation != null ? instanceLocation.getURL() : null;
- if (instanceLocation == null || !instanceLocation.isSet() || url == null) {
- testFolder = Activator.getContext().getDataFile(name);
- } else {
- testFolder = new File(url.getFile(), name);
- }
-
- if (testFolder.exists())
- delete(testFolder);
- testFolder.mkdirs();
- return testFolder;
- }
-
- protected void runTest() throws Throwable {
- super.runTest();
-
- //clean up after success
- if (testFolder != null && testFolder.exists()) {
- delete(testFolder);
- testFolder = null;
- }
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- if (fwAdminTracker != null) {
- fwAdminTracker.close();
- }
- }
-
- public void assertIsFile(File file) {
- if (!file.exists())
- fail("File: " + file.toString() + " can't be found.");
- if (!file.isFile())
- fail("File: " + file.toString() + " is expected to be a file.");
- }
-
- public void assertIsDirectory(File file) {
- if (!file.exists())
- fail("Directory: " + file.toString() + " can't be found.");
- if (!file.isDirectory())
- fail("Directory: " + file.toString() + " is expected to be a directory.");
- }
-
- public void assertNothing(File file) {
- if (file.exists())
- fail("No file or directory should be there: " + file);
- }
-
- public void assertNotContent(File file, String search) {
- if (!file.exists())
- fail("File: " + file.toString() + " can't be found.");
- try {
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new FileReader(file));
- while (reader.ready()) {
- String line = reader.readLine();
- if (line.indexOf(search) >= 0)
- fail("The string: " + search + " was not expected in this file: " + file.getAbsolutePath());
- }
- } finally {
- if (reader != null)
- reader.close();
- }
- } catch (FileNotFoundException e) {
- //ignore, caught before
- } catch (IOException e) {
- fail("String: " + search + " not found in " + file.getAbsolutePath());
- }
- }
-
- public void assertIniFileNotContain(File file, String argument, String value) {
- List args = null;
- try {
- args = FileUtils.loadFile(file);
- } catch (IOException e) {
- fail("Can't read file " + file);
- }
- String tmp = ParserUtils.getValueForArgument(argument, args);
- if (tmp == null)
- return;
-
- assertTrue(tmp.indexOf(value) == -1);
- }
-
- private String getProperty(File file, String property) {
- Properties p = new Properties();
- FileInputStream fis = null;
- try {
- fis = new FileInputStream(file);
- p.load(fis);
- } catch (FileNotFoundException e) {
- fail("Can't find file " + file);
- } catch (IOException e) {
- fail("Error reading " + file);
- } finally {
- if (fis != null)
- try {
- fis.close();
- } catch (IOException e) {
- //ignore
- }
- }
- return p.getProperty(property);
- }
-
- public void assertPropertyContains(File file, String property, String text) {
- String value = getProperty(file, property);
- if (value == null)
- fail("property: " + property + " not found in: " +file);
-
- int index = value.indexOf(text);
- if (index == -1)
- fail(text + " not found in property:" + property + " for file: " +file);
- }
-
- public void assertNotPropertyContains(File file, String property, String text) {
- String value = getProperty(file, property);
- if (value == null)
- return;
-
- int index = value.indexOf(text);
- if (index != -1)
- fail(text + " found in property:" + property + " for file: " +file);
- }
-
- public void assertEquals(String[] array1, String[] array2) {
- if (array1 == null || array2 == null) {
- if (array1 == array2)
- return;
- fail(array1 + " not equal to " + array2);
- }
- assertEquals(array1.length, array2.length);
- for (int i = 0; i < array1.length; i++) {
- assertEquals(array1[i], array2[i]);
- }
- }
-
- public void assertContent(File file, String search) {
- assertContents(file, new String [] { search } );
- }
- public void assertContents(File file, String [] lines) {
- if (!file.exists())
- fail("File: " + file.toString() + " can't be found.");
- int idx = 0;
- try {
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new FileReader(file));
- while (reader.ready()) {
- String line = reader.readLine();
- if (line.indexOf(lines[idx]) >= 0) {
- if(++idx >= lines.length)
- return;
- }
- }
- } finally {
- if (reader != null)
- reader.close();
- }
- } catch (FileNotFoundException e) {
- //ignore, caught before
- } catch (IOException e) {
- fail("String: " + lines[idx] + " not found in " + file.getAbsolutePath());
- }
- fail("String:" + lines[idx] + " not found");
- }
-
- public void startSimpleConfiguratorManipulator() {
- final String SIMPLECONFIGURATOR_MANIPULATOR = "org.eclipse.equinox.simpleconfigurator.manipulator";
- Bundle manipulatorBundle = Platform.getBundle(SIMPLECONFIGURATOR_MANIPULATOR);
- if (manipulatorBundle == null)
- fail("Bundle: " + SIMPLECONFIGURATOR_MANIPULATOR + " is required for this test");
- try {
- manipulatorBundle.start();
- } catch (BundleException e) {
- fail("Exception while starting up " + SIMPLECONFIGURATOR_MANIPULATOR + ' ' + e.getMessage());
- }
- }
-
- public void stopSimpleConfiguratorManipulator() {
- final String SIMPLECONFIGURATOR_MANIPULATOR = "org.eclipse.equinox.simpleconfigurator.manipulator";
- Bundle manipulatorBundle = Platform.getBundle(SIMPLECONFIGURATOR_MANIPULATOR);
- if (manipulatorBundle == null)
- return;
- try {
- manipulatorBundle.stop();
- } catch (BundleException e) {
- fail("Exception while starting up " + SIMPLECONFIGURATOR_MANIPULATOR + ' ' + e.getMessage());
- }
- }
-
- /*
- * Copy
- * - if we have a file, then copy the file
- * - if we have a directory then merge
- */
- public static void copy(String message, File source, File target) {
- if (!source.exists())
- return;
- target.getParentFile().mkdirs();
- if (source.isDirectory()) {
- if (target.exists() && target.isFile())
- target.delete();
- if (!target.exists())
- target.mkdirs();
- File[] children = source.listFiles();
- for (int i = 0; i < children.length; i++)
- copy(message, children[i], new File(target, children[i].getName()));
- return;
- }
- InputStream input = null;
- OutputStream output = null;
- try {
- input = new BufferedInputStream(new FileInputStream(source));
- output = new BufferedOutputStream(new FileOutputStream(target));
-
- byte[] buffer = new byte[8192];
- int bytesRead = 0;
- while ((bytesRead = input.read(buffer)) != -1)
- output.write(buffer, 0, bytesRead);
- } catch (IOException e) {
- fail(message + ": " + e);
- } finally {
- if (input != null) {
- try {
- input.close();
- } catch (IOException e) {
- System.err.println("Exception while trying to close input stream on: " + source.getAbsolutePath());
- e.printStackTrace();
- }
- }
- if (output != null) {
- try {
- output.close();
- } catch (IOException e) {
- System.err.println("Exception while trying to close output stream on: " + target.getAbsolutePath());
- e.printStackTrace();
- }
- }
- }
- }
-
- /*
- * Look up and return a file handle to the given entry in the bundle.
- */
- protected File getTestData(String message, String entry) {
- if (entry == null)
- fail(message + " entry is null.");
- URL base = Activator.getContext().getBundle().getEntry(entry);
- if (base == null)
- fail(message + " entry not found in bundle: " + entry);
- try {
- String osPath = new Path(FileLocator.toFileURL(base).getPath()).toOSString();
- File result = new File(osPath);
- if (!result.getCanonicalPath().equals(result.getPath()))
- fail(message + " result path: " + result.getPath() + " does not match canonical path: " + result.getCanonicalFile().getPath());
- return result;
- } catch (IOException e) {
- fail(message + ": " + e);
- }
- // avoid compile error... should never reach this code
- return null;
- }
-
- protected Manipulator getFrameworkManipulator(File configuration, File launcher) throws BundleException {
- startSimpleConfiguratorManipulator();
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configuration);
- launcherData.setLauncher(launcher);
-
- return manipulator;
- }
-
- //This is a dumb helper writing out the values as they have been passed to it.
- protected void writeEclipseIni(File location, String[] lines) {
- location.getParentFile().mkdirs();
- BufferedWriter bw = null;
- try {
- bw = new BufferedWriter(new FileWriter(location));
- for (int j = 0; j < lines.length; j++) {
- bw.write(lines[j]);
- bw.newLine();
- }
- bw.flush();
-
- } catch (IOException e) {
- fail("Fail writing eclipse.ini file");
- } finally {
- if (bw != null)
- try {
- bw.close();
- } catch (IOException e) {
- fail("Fail writing eclipse.ini file in " + location);
- }
- }
- }
-
- //This is a dumb helper writing out the values as they have been passed to it
- protected void writeConfigIni(File location, Properties properties) {
- location.getParentFile().mkdirs();
- FileOutputStream out = null;
- try {
- out = new FileOutputStream(location);
- properties.store(out, "#header");
- } catch (IOException e) {
- fail("Faile writing config.ini in" + location);
- } finally {
- try {
- out.flush();
- out.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- out = null;
- }
- }
-
- public void assertContains(String message, BundleInfo[] bundles, URI location) {
- for (int i = 0; i < bundles.length; i++) {
- if (bundles[i].getLocation().equals(location))
- return;
- }
- fail(message + " Can't find the bundle info " + location);
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Activator.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Activator.java
deleted file mode 100644
index bed2838..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Activator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.tests;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
- private static BundleContext ctx;
-
- public void start(BundleContext context) throws Exception {
- ctx = context;
-
- }
-
- public void stop(BundleContext context) throws Exception {
- ctx = null;
- }
-
- public static BundleContext getContext() {
- return ctx;
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AllTests.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AllTests.java
deleted file mode 100644
index b6ab89d..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AllTests.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 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.frameworkadmin.tests;
-
-
-import junit.framework.*;
-
-/**
- * Performs all automated director tests.
- */
-public class AllTests extends TestCase {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(AllTests.class.getName());
- suite.addTestSuite(Bug196525.class);
- suite.addTestSuite(Bug258370.class);
- suite.addTestSuite(CleanupTest.class);
- suite.addTestSuite(FrameworkExtensionTest.class);
- suite.addTestSuite(LauncherConfigLocationTest.class);
- suite.addTestSuite(LauncherDataTest.class);
- suite.addTestSuite(ManipulatorTests.class);
- suite.addTestSuite(NoConfigurationValueInEclipseIni.class);
- suite.addTestSuite(NoRenamingLauncherIni.class);
- suite.addTestSuite(OSGiVersionChange.class);
- suite.addTestSuite(ReaderTest1.class);
- suite.addTestSuite(ReaderTest2.class);
- suite.addTestSuite(ReaderTest3.class);
- suite.addTestSuite(ReaderTest4.class);
- suite.addTestSuite(ReaderTest5.class);
- suite.addTestSuite(ReaderTestBug267850.class);
- suite.addTestSuite(ReaderTestBug285935.class);
- suite.addTestSuite(RelativePathTest.class);
- suite.addTestSuite(RemovingABundle.class);
- suite.addTestSuite(RemovingAllBundles.class);
- suite.addTestSuite(RenamingLauncherIni.class);
- suite.addTestSuite(SharedConfigurationTest.class);
- suite.addTestSuite(SimpleConfiguratorComingAndGoing.class);
- suite.addTestSuite(SimpleConfiguratorTest.class);
- suite.addTestSuite(TestEclipseDataArea.class);
- suite.addTestSuite(TestRunningInstance.class);
- suite.addTestSuite(TestVMArg.class);
- suite.addTestSuite(UtilsTest.class);
- return suite;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug196525.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug196525.java
deleted file mode 100644
index 88f3eb0..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug196525.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class Bug196525 extends AbstractFwkAdminTest {
- private File installFolder = null;
- private File configurationFolder = null;
- private String launcherName = "eclipse";
- private File bundleTXT;
- private File configINI;
-
- public Bug196525(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- startSimpleConfiguratorManipulator();
- //create a configuration with osgi and simpleconfigurator in it
-
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- installFolder = Activator.getContext().getDataFile(Bug196525.class.getName());
- configurationFolder = new File(installFolder, "configuration");
-
- bundleTXT = new File(configurationFolder, "org.eclipse.equinox.simpleconfigurator/bundles.info");
- configINI = new File(configurationFolder, "config.ini");
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- BundleInfo osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar"))), 0, true);
- BundleInfo configuratorBi = new BundleInfo("org.eclipse.equinox.simpleconfigurator", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar"))), 1, true);
-
- manipulator.getConfigData().addBundle(osgiBi);
- manipulator.getConfigData().addBundle(configuratorBi);
-
- manipulator.save(false);
- }
-
- public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- try {
- assertContains("1.0", manipulator.getConfigData().getBundles(), URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar"))));
- assertContains("2.0", manipulator.getConfigData().getBundles(), URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar"))));
- } catch (URISyntaxException e) {
- fail("Unexpected failure while creating URI");
- }
- BundleInfo bundle1Bi = new BundleInfo("bundle_1", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/bundle_1"))), 2, true);
-
- manipulator.getConfigData().addBundle(bundle1Bi);
-
- manipulator.save(false);
-
- assertContent(bundleTXT, "org.eclipse.osgi");
- assertContent(configINI, "org.eclipse.osgi");
- assertContent(bundleTXT, "org.eclipse.equinox.simpleconfigurator");
- assertContent(configINI, "org.eclipse.equinox.simpleconfigurator");
- assertContent(bundleTXT, "bundle_1");
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug258370.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug258370.java
deleted file mode 100644
index 8cc373a..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/Bug258370.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class Bug258370 extends FwkAdminAndSimpleConfiguratorTest {
- public Bug258370(String name) {
- super(name);
- // TODO Auto-generated constructor stub
- }
-
- public void testComma() {
- FrameworkAdmin fwkAdmin = null;
- try {
- fwkAdmin = getEquinoxFrameworkAdmin();
- } catch (BundleException e1) {
- fail("0.0");
- }
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File installFolder = Activator.getContext().getDataFile(SimpleConfiguratorTest.class.getName());
- File configurationFolder = new File(installFolder, "configuration");
- String launcherName = "eclipse";
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- try {
- manipulator.load();
- } catch (FrameworkAdminRuntimeException e) {
- fail("1.0");
- } catch (IOException e) {
- fail("2.0");
- }
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- BundleInfo osgiBi = null;
- BundleInfo bundle1Bi = null;
- BundleInfo bundle2Bi = null;
-
- try {
- osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar"))), 0, true);
- bundle1Bi = new BundleInfo("bundle_1", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/bundle_1"))), 2, true);
- bundle2Bi = new BundleInfo("bundle_2", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/bundle_2"))), 2, true);
- } catch (URISyntaxException e) {
- fail("3.0");
- } catch (IOException e) {
- fail("4.0");
- }
-
- manipulator.getConfigData().addBundle(osgiBi);
- manipulator.getConfigData().addBundle(bundle1Bi);
- manipulator.getConfigData().addBundle(bundle2Bi);
- try {
- manipulator.save(false);
- } catch (FrameworkAdminRuntimeException e) {
- fail("5.0");
- } catch (IOException e) {
- fail("6.0");
- }
-
- File configINI = new File(configurationFolder, "config.ini");
- assertContent(configINI, "org.eclipse.osgi");
- assertContent(configINI, "bundle_1");
- assertContent(configINI, "bundle_2");
- assertContent(configINI, "start,reference"); //This test for the presence of the comma.
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/CleanupTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/CleanupTest.java
deleted file mode 100644
index 4b6e483..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/CleanupTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.Manipulator;
-
-public class CleanupTest extends FwkAdminAndSimpleConfiguratorTest {
-
- public CleanupTest(String name) {
- super(name);
- }
-
- Manipulator m = null;
-
- protected void setUp() throws Exception {
- super.setUp();
- m = createMinimalConfiguration(CleanupTest.class.getName());
- }
-
- public void testSimpleConfiguratorRemoval() {
- BundleInfo[] bis = m.getConfigData().getBundles();
- for (int i = 0; i < bis.length; i++) {
- if (bis[i].getSymbolicName().equals("org.eclipse.equinox.simpleconfigurator"))
- m.getConfigData().removeBundle(bis[i]);
- }
- try {
- m.save(false);
- } catch (IOException e) {
- fail("Error while saving");
- }
- assertNothing(new File(getConfigurationFolder(), "org.eclipse.equinox.simpleconfigurator"));
- assertIsDirectory(getConfigurationFolder());
-
- //Now remove osgi
- bis = m.getConfigData().getBundles();
- for (int i = 0; i < bis.length; i++) {
- if (bis[i].getSymbolicName().equals("org.eclipse.osgi"))
- m.getConfigData().removeBundle(bis[i]);
- }
- try {
- m.save(false);
- } catch (IOException e) {
- fail("Error while saving");
- }
- assertNothing(getConfigurationFolder());
- assertNothing(new File(getInstallFolder(), getLauncherName() + ".ini"));
- }
-
- public void testOSGiRemoval() {
- BundleInfo[] bis = m.getConfigData().getBundles();
- for (int i = 0; i < bis.length; i++) {
- if (bis[i].getSymbolicName().equals("org.eclipse.osgi"))
- m.getConfigData().removeBundle(bis[i]);
- }
- try {
- m.save(false);
- } catch (IOException e) {
- fail("Error while saving");
- }
- assertIsDirectory(new File(getConfigurationFolder(), "org.eclipse.equinox.simpleconfigurator"));
- assertIsDirectory(getConfigurationFolder());
- assertNotContent(new File(getConfigurationFolder(), "org.eclipse.equinox.simpleconfigurator/bundles.info"), "org.eclipse.osgi");
-
- bis = m.getConfigData().getBundles();
- for (int i = 0; i < bis.length; i++) {
- if (bis[i].getSymbolicName().equals("org.eclipse.equinox.simpleconfigurator"))
- m.getConfigData().removeBundle(bis[i]);
- }
- try {
- m.save(false);
- } catch (IOException e) {
- fail("Error while saving");
- }
- assertNothing(getConfigurationFolder());
- assertNothing(new File(getInstallFolder(), getLauncherName() + ".ini"));
- }
-
- public void testWithMutipleBundles() throws IOException, URISyntaxException {
- BundleInfo bi = new BundleInfo(URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/bundle_1"))), 2);
- m.getConfigData().addBundle(bi);
- m.save(false);
-
- BundleInfo[] bis = m.getConfigData().getBundles();
- for (int i = 0; i < bis.length; i++) {
- if (bis[i].getSymbolicName().equals("org.eclipse.equinox.simpleconfigurator"))
- m.getConfigData().removeBundle(bis[i]);
- }
- m.save(false);
-
- assertNothing(getBundleTxt());
- assertContent(getConfigIni(), "bundle_1");
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/FrameworkExtensionTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/FrameworkExtensionTest.java
deleted file mode 100644
index 33f4a0d..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/FrameworkExtensionTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.frameworkadmin.tests;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.Manipulator;
-import org.osgi.framework.Constants;
-
-public class FrameworkExtensionTest extends FwkAdminAndSimpleConfiguratorTest {
-
- public FrameworkExtensionTest(String name) {
- super(name);
- }
-
- public void testAddRemoveFrameworkExtension() throws Exception {
- Manipulator manipulator = createMinimalConfiguration(FrameworkExtensionTest.class.getName());
- BundleInfo bundleInfo = new BundleInfo("dummy.frameworkextension", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/dummy.frameworkextension_1.0.0.jar"))), 4, false);
- bundleInfo.setFragmentHost(Constants.SYSTEM_BUNDLE_SYMBOLICNAME);
- manipulator.getConfigData().addBundle(bundleInfo);
- manipulator.save(false);
- assertContent(getBundleTxt(), "dummy.frameworkextension");
- assertPropertyContains(getConfigIni(),"osgi.framework.extensions", "dummy.frameworkextension");
- assertNotPropertyContains(getConfigIni(),"osgi.bundles", "dummy.frameworkextension");
-
- BundleInfo basicBundleInfo = new BundleInfo("dummy.frameworkextension", "1.0.0", null, -1, false);
- manipulator.getConfigData().removeBundle(basicBundleInfo);
- manipulator.save(false);
- assertNotContent(getBundleTxt(), "dummy.frameworkextension");
- assertNotPropertyContains(getConfigIni(),"osgi.framework.extensions", "dummy.frameworkextension");
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/FwkAdminAndSimpleConfiguratorTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/FwkAdminAndSimpleConfiguratorTest.java
deleted file mode 100644
index bf95063..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/FwkAdminAndSimpleConfiguratorTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public abstract class FwkAdminAndSimpleConfiguratorTest extends AbstractFwkAdminTest {
- private File installFolder;
- private File configurationFolder;
- private String launcherName;
-
- public FwkAdminAndSimpleConfiguratorTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- startSimpleConfiguratorManipulator();
- }
-
- protected Manipulator getNewManipulator(String workArea) throws FrameworkAdminRuntimeException, IOException, BundleException {
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- installFolder = Activator.getContext().getDataFile(workArea);
- configurationFolder = new File(installFolder, "configuration");
- launcherName = "eclipse";
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
- return manipulator;
- }
-
- protected Manipulator createMinimalConfiguration(String workArea) throws Exception {
- Manipulator manipulator = getNewManipulator(workArea);
-
- BundleInfo osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar"))), 0, true);
- BundleInfo configuratorBi = new BundleInfo("org.eclipse.equinox.simpleconfigurator", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar"))), 1, true);
-
- manipulator.getConfigData().addBundle(osgiBi);
- manipulator.getConfigData().addBundle(configuratorBi);
-
- try {
- manipulator.save(false);
- } catch (IOException e) {
- fail("Error while persisting");
- } catch (FrameworkAdminRuntimeException e) {
- fail("Error while persisting");
- }
- return manipulator;
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- if (installFolder != null)
- delete(installFolder);
- }
-
- public File getInstallFolder() {
- return installFolder;
- }
-
- public File getConfigurationFolder() {
- return configurationFolder;
- }
-
- public File getBundleTxt() {
- return new File(configurationFolder, "org.eclipse.equinox.simpleconfigurator/bundles.info");
- }
-
- public File getConfigIni() {
- return new File(configurationFolder, "config.ini");
- }
-
- public String getLauncherName() {
- return launcherName;
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/LauncherConfigLocationTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/LauncherConfigLocationTest.java
deleted file mode 100644
index 1e336a4..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/LauncherConfigLocationTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class LauncherConfigLocationTest extends AbstractFwkAdminTest {
-
- public LauncherConfigLocationTest(String name) {
- super(name);
- }
-
- public void testCustomLauncherConfig() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- startSimpleConfiguratorManipulator();
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File installFolder = Activator.getContext().getDataFile(LauncherConfigLocationTest.class.getName());
- if(installFolder.exists())
- delete(installFolder);
-
- File configurationFolder = new File(installFolder, "configuration");
- String launcherName = "foo";
-
- LauncherData launcherData = manipulator.getLauncherData();
- assertNotNull("Null launcher data" + launcherData, launcherData);
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
-
- File defaultlaunchConfig = new File(installFolder, launcherName + ".ini");
- assertEquals(defaultlaunchConfig.exists(), false);
- File launchConfig = new File(installFolder, "mylaunch.ini");
- assertEquals(launchConfig.exists(), false);
- launcherData.setLauncherConfigLocation(launchConfig);
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- BundleInfo osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar"))), 0, true);
- BundleInfo configuratorBi = new BundleInfo("org.eclipse.equinox.simpleconfigurator", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar"))), 1, true);
-
- manipulator.getConfigData().addBundle(osgiBi);
- manipulator.getConfigData().addBundle(configuratorBi);
-
- manipulator.save(false);
-
- assertEquals(launchConfig.exists(), true);
- assertEquals(defaultlaunchConfig.exists(), false);
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/LauncherDataTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/LauncherDataTest.java
deleted file mode 100644
index 021b5a8..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/LauncherDataTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 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.frameworkadmin.tests;
-
-import junit.framework.TestCase;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.LauncherData;
-
-/**
- * @since 1.0
- */
-public class LauncherDataTest extends TestCase {
-
- /*
- * Constructor for the class.
- */
- public LauncherDataTest(String name) {
- super(name);
- }
-
- public void testRemoveProgramArg() {
- LauncherData data = new LauncherData("equinox", "1.0", "eclipse", "1.0");
- data.setProgramArgs(new String[] {"-console", "-startup", "foo"});
- data.removeProgramArg("-startup");
- assertEquals("1.0", new String[] {"-console"}, data.getProgramArgs());
-
- data.setProgramArgs(null);
- data.setProgramArgs(new String[] {"-console", "-startup", "foo", "-bar"});
- data.removeProgramArg("-startup");
- assertEquals("2.0", new String[] {"-console", "-bar"}, data.getProgramArgs());
-
- data.setProgramArgs(null);
- data.setProgramArgs(new String[] {"-startup", "foo"});
- data.removeProgramArg("-startup");
- assertEquals("3.0", new String[0], data.getProgramArgs());
-
- data.setProgramArgs(null);
- data.setProgramArgs(new String[] {"-console", "-startup", "foo", "bar"});
- data.removeProgramArg("-startup");
- assertEquals("4.0", new String[] {"-console"}, data.getProgramArgs());
-
- data.setProgramArgs(null);
- data.setProgramArgs(new String[] {"-console", "-startup", "foo", "bar", "-xxx"});
- data.removeProgramArg("-startup");
- assertEquals("5.0", new String[] {"-console", "-xxx"}, data.getProgramArgs());
-
- // arg which doesn't start with a dash - dont' consume anything but that specific arg
- data.setProgramArgs(null);
- data.setProgramArgs(new String[] {"-console", "-startup", "foo", "bar", "-xxx"});
- data.removeProgramArg("foo");
- assertEquals("6.0", new String[] {"-console", "-startup", "foo", "bar", "-xxx"}, data.getProgramArgs());
-
- // non-matching arg
- data.setProgramArgs(null);
- data.setProgramArgs(new String[] {"-console", "-startup", "foo", "bar", "-xxx"});
- data.removeProgramArg("zzz");
- assertEquals("7.0", new String[] {"-console", "-startup", "foo", "bar", "-xxx"}, data.getProgramArgs());
-
- // empty string
- data.setProgramArgs(null);
- data.setProgramArgs(new String[] {"-console", "-startup", "foo", "bar", "-xxx"});
- data.removeProgramArg("foo");
- assertEquals("8.0", new String[] {"-console", "-startup", "foo", "bar", "-xxx"}, data.getProgramArgs());
-
- // just whitespace
- data.setProgramArgs(null);
- data.setProgramArgs(new String[] {"-console", "-startup", "foo", "bar", "-xxx"});
- data.removeProgramArg(" ");
- assertEquals("9.0", new String[] {"-console", "-startup", "foo", "bar", "-xxx"}, data.getProgramArgs());
-
- }
-
- /*
- * Compare the give 2 arrays and assert whether or not they should be considered equal.
- */
- public static void assertEquals(String message, String[] one, String[] two) {
- if (one == null)
- assertNull(message, two);
- if (two == null)
- fail(message);
- assertEquals(message, one.length, two.length);
- for (int i = 0; i < one.length; i++)
- assertEquals(message, one[i], two[i]);
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/MacOSLikeSetup.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/MacOSLikeSetup.java
deleted file mode 100644
index d805e5a..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/MacOSLikeSetup.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxConstants;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.eclipse.osgi.service.environment.Constants;
-import org.osgi.framework.BundleException;
-
-public class MacOSLikeSetup extends FwkAdminAndSimpleConfiguratorTest {
-
- public MacOSLikeSetup(String name) {
- super(name);
- }
-
- public void testMacOSSetup() throws FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File installFolder = new File(Activator.getContext().getDataFile(MacOSLikeSetup.class.getName()), "eclipse");
- File configurationFolder = new File(installFolder, "configuration");
- File launcherFolder = new File(installFolder, "Eclipse.app/Contents/MacOS/");
- File launcherName = new File(launcherFolder, "eclipse");
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(launcherName);
- launcherData.setLauncherConfigLocation(new File(launcherFolder, "eclipse.ini"));
- launcherData.setOS(Constants.OS_MACOSX);
-
- //Setup the plugins as they should
- File osgiJar = new File(installFolder, "plugins/org.eclipse.osgi.jar");
- File scJar = new File(installFolder, "plugins/org.eclipse.equinox.simpleconfigurator.jar");
- File launcherJar = new File(installFolder, "plugins/org.eclipse.equinox.launcher.jar");
- copy("OSGi", new File(FileLocator.toFileURL(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar")).getPath()), osgiJar);
- copy("SC", new File(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar")).getPath()), scJar);
- copy("Startup", new File(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.launcher.jar")).getPath()), launcherJar);
-
- manipulator.getConfigData().addBundle(new BundleInfo(osgiJar.toURI()));
- manipulator.getConfigData().addBundle(new BundleInfo(scJar.toURI(), 1, true));
- manipulator.getConfigData().addBundle(new BundleInfo(launcherJar.toURI()));
-
- manipulator.getLauncherData().addProgramArg(EquinoxConstants.OPTION_STARTUP);
- manipulator.getLauncherData().addProgramArg(launcherJar.toURI().toString());
-
- manipulator.getLauncherData().setFwJar(osgiJar);
-
- try {
- manipulator.save(false);
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
- File launcherIni = new File(launcherFolder, "eclipse.ini");
- assertNotContent(launcherIni, "-configuration");
- assertNotContent(launcherIni, "-install");
- assertContent(launcherIni, "-startup");
- assertContent(launcherIni, "../../../plugins/org.eclipse.equinox.launcher.jar");
- assertNotContent(launcherIni, MacOSLikeSetup.class.getName());
- assertNotContent(new File(configurationFolder, "config.ini"), MacOSLikeSetup.class.getName());
- assertTrue("bundles.info missing", new File(configurationFolder, "org.eclipse.equinox.simpleconfigurator/bundles.info").exists());
-
- }
-
- public void testMacWithoutStartupOrFw() throws Exception {
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File installFolder = new File(Activator.getContext().getDataFile(MacOSLikeSetup.class.getName()), "eclipse");
- File configurationFolder = new File(installFolder, "configuration");
- File launcherFolder = new File(installFolder, "Eclipse.app/Contents/MacOS/");
- File launcherName = new File(launcherFolder, "eclipse");
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(launcherName);
- launcherData.setOS(Constants.OS_MACOSX);
-
- File osgiJar = new File(installFolder, "plugins/org.eclipse.osgi.jar");
- File scJar = new File(installFolder, "plugins/org.eclipse.equinox.simpleconfigurator.jar");
- File bundle = new File(installFolder, "plugins/bundle_1");
- copy("OSGi", new File(FileLocator.toFileURL(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar")).getPath()), osgiJar);
- copy("SC", new File(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar")).getPath()), scJar);
- copy("bundle", new File(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/bundle_1")).getPath()), bundle);
-
- manipulator.getConfigData().addBundle(new BundleInfo(osgiJar.toURI()));
- manipulator.getConfigData().addBundle(new BundleInfo(scJar.toURI(), 1, true));
- manipulator.getConfigData().addBundle(new BundleInfo(bundle.toURI()));
- manipulator.save(false);
-
- File launcherIni = new File(launcherFolder, "eclipse.ini");
- File bundleInfo = new File(configurationFolder, "org.eclipse.equinox.simpleconfigurator/bundles.info");
- assertNotContent(launcherIni, "-configuration");
- assertNotContent(launcherIni, "../../../configuration");
- assertContent(bundleInfo, "file:plugins/bundle_1/");
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ManipulatorTests.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ManipulatorTests.java
deleted file mode 100644
index e8897ef..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ManipulatorTests.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.tests;
-
-import java.io.*;
-import java.util.*;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.ParserUtils;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-
-public class ManipulatorTests extends AbstractFwkAdminTest {
-
- public ManipulatorTests(String name) {
- super(name);
- }
-
- public void testBug212361_osgiInBundlesList() throws Exception {
- File installFolder = Activator.getContext().getDataFile("212361");
- File configurationFolder = new File(installFolder, "configuration");
- Manipulator manipulator = getFrameworkManipulator(configurationFolder, new File(installFolder, "foo"));
-
- BundleInfo osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar"))), 0, true);
- BundleInfo configuratorBi = new BundleInfo("org.eclipse.equinox.simpleconfigurator", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar"))), 1, true);
-
- manipulator.getConfigData().addBundle(osgiBi);
- manipulator.getConfigData().addBundle(configuratorBi);
-
- manipulator.save(false);
-
- Properties configIni = new Properties();
- InputStream in = new BufferedInputStream(new FileInputStream(new File(configurationFolder, "config.ini")));
- configIni.load(in);
- in.close();
-
- String bundles = (String) configIni.get("osgi.bundles");
- assertTrue(bundles.indexOf("org.eclipse.osgi") == -1);
- }
-
- public void testBug277553_installAreaFromFwJar() throws Exception {
- File folder = getTestFolder("installAreaFromFwJar");
- File fwJar = new File(folder, "plugins/org.eclipse.osgi.jar");
- fwJar.getParentFile().mkdirs();
-
- copyStream(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar").openStream(), true, new FileOutputStream(fwJar), true);
- BundleInfo osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", fwJar.toURI(), 0, true);
-
- File ini = new File(folder, "eclipse.ini");
- writeEclipseIni(ini, new String[] {"-foo", "bar", "-vmargs", "-Xmx256m"});
-
- startSimpleConfiguratorManipulator();
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
-
- Manipulator manipulator = fwkAdmin.getManipulator();
- manipulator.getConfigData().addBundle(osgiBi);
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwJar(fwJar);
- launcherData.setLauncher(new File(folder, "eclipse"));
-
- manipulator.load();
-
- assertEquals(manipulator.getLauncherData().getFwPersistentDataLocation(), new File(folder, "configuration"));
- }
-
- public void testBug258126_ProgramArgs_VMArgs() throws Exception {
- File installFolder = getTestFolder("258126");
- File ini = new File(installFolder, "eclipse.ini");
- writeEclipseIni(ini, new String[] {"-foo", "bar", "-vmargs", "-Xmx256m"});
-
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setLauncher(new File(installFolder, "eclipse"));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- assertEquals(launcherData.getJvmArgs(), new String[] {"-Xmx256m"});
- assertEquals(launcherData.getProgramArgs(), new String[] {"-foo", "bar"});
-
- launcherData.addJvmArg("-Xms64m");
- launcherData.addProgramArg("-console");
-
- //eclipse.ini won't save unless we actually have something in the configuration
- BundleInfo osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar"))), 0, true);
- manipulator.getConfigData().addBundle(osgiBi);
- manipulator.save(false);
-
- assertContents(ini, new String[] {"-foo", "bar", "-console", "-vmargs", "-Xmx256m", "-Xms64m"});
- }
-
- public void testParserUtils_removeArgument() throws Exception {
- String [] args = new String [] { "-bar", "-foo", "-other"};
- ParserUtils.removeArgument("-foo", Arrays.asList(args));
- assertEquals(args, new String [] {"-bar", null, "-other"});
-
- args = new String [] { "-bar", "-foo", "other"};
- ParserUtils.removeArgument("-foo", Arrays.asList(args));
- assertEquals(args, new String [] {"-bar", null, null});
-
- args = new String [] { "-bar", "-foo", "s-pecial"};
- ParserUtils.removeArgument("-foo", Arrays.asList(args));
- assertEquals(args, new String [] {"-bar", null, null});
- }
-
- public void testParserUtils_setValueForArgument() throws Exception {
- List args = new ArrayList();
- ParserUtils.setValueForArgument("-foo", "bar", args);
- assertTrue(args.size() == 2);
- assertEquals(args.get(0), "-foo");
- assertEquals(args.get(1), "bar");
-
- args.add("-other");
- args.set(1, "s-pecial");
- ParserUtils.setValueForArgument("-foo", "bas", args);
- assertTrue(args.size() == 3);
- assertEquals(args.get(0), "-foo");
- assertEquals(args.get(1), "bas");
- assertEquals(args.get(2), "-other");
-
- args.remove(1);
- ParserUtils.setValueForArgument("-foo", "bas", args);
- assertTrue(args.size() == 3);
- assertEquals(args.get(0), "-foo");
- assertEquals(args.get(1), "bas");
- assertEquals(args.get(2), "-other");
- }
-
- public void testParserUtils_getValueForArgument() throws Exception {
- List args = new ArrayList();
- args.add("-foo");
- args.add("bar");
- assertEquals( "bar", ParserUtils.getValueForArgument("-foo", args));
-
- args.set(1, "-bar");
- assertEquals(null, ParserUtils.getValueForArgument("-foo", args));
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/NoConfigurationValueInEclipseIni.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/NoConfigurationValueInEclipseIni.java
deleted file mode 100644
index 453038a..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/NoConfigurationValueInEclipseIni.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class NoConfigurationValueInEclipseIni extends FwkAdminAndSimpleConfiguratorTest {
-
- public NoConfigurationValueInEclipseIni(String name) {
- super(name);
- }
-
- public void testAbsenceOfConfigurationInEclipseINI() throws Exception {
- createMinimalConfiguration(NoConfigurationValueInEclipseIni.class.getName());
- File launcherIni = new File(getInstallFolder(), getLauncherName() + ".ini");
- assertNotContent(launcherIni, "-configuration");
- }
-
- public void testPresenceOfConfigurationInEclipseINI() throws FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File installFolder = Activator.getContext().getDataFile("bis" + NoConfigurationValueInEclipseIni.class.getName());
- File configurationFolder = new File(installFolder, "config2");
- String launcherName = "eclipse";
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
-
- BundleInfo osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar"))), 0, true);
- BundleInfo configuratorBi = new BundleInfo("org.eclipse.equinox.simpleconfigurator", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar"))), 1, true);
-
- manipulator.getConfigData().addBundle(osgiBi);
- manipulator.getConfigData().addBundle(configuratorBi);
-
- try {
- manipulator.save(false);
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
- File launcherIni = new File(installFolder, launcherName + ".ini");
- assertContent(launcherIni, "-configuration");
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/NoRenamingLauncherIni.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/NoRenamingLauncherIni.java
deleted file mode 100644
index a8c5038..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/NoRenamingLauncherIni.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class NoRenamingLauncherIni extends AbstractFwkAdminTest {
-
- public NoRenamingLauncherIni(String name) {
- super(name);
- }
-
- public void testConfigFiles() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- startSimpleConfiguratorManipulator();
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File installFolder = Activator.getContext().getDataFile(NoRenamingLauncherIni.class.getName());
- File configurationFolder = new File(installFolder, "configuration");
- String launcherName = "foo";
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- BundleInfo osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar"))), 0, true);
- BundleInfo configuratorBi = new BundleInfo("org.eclipse.equinox.simpleconfigurator", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar"))), 1, true);
-
- manipulator.getConfigData().addBundle(osgiBi);
- manipulator.getConfigData().addBundle(configuratorBi);
-
- manipulator.save(false);
-
- File fooINI = new File(installFolder, "foo.ini");
- assertEquals(fooINI.exists(), true);
-
- Manipulator m2 = fwkAdmin.getManipulator();
-
- LauncherData launcherData2 = m2.getLauncherData();
- launcherData2.setFwConfigLocation(configurationFolder);
- launcherData2.setLauncher(new File(installFolder, launcherName));
-
- try {
- m2.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
- launcherData2.setLauncher(new File(installFolder, "bar"));
- m2.save(false);
-
- assertEquals(fooINI.exists(), false);
- assertEquals(new File(installFolder, "bar.ini").exists(), true);
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/OSGiVersionChange.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/OSGiVersionChange.java
deleted file mode 100644
index 293a680..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/OSGiVersionChange.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.frameworkadmin.tests;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class OSGiVersionChange extends FwkAdminAndSimpleConfiguratorTest {
- private Manipulator defaultManipulator = null;
- private String workArea = OSGiVersionChange.class.getName();
-
- public OSGiVersionChange(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- defaultManipulator = createMinimalConfiguration(workArea);
- }
-
- public void testRemovalUsingSameManipulator() throws IllegalStateException, FrameworkAdminRuntimeException, IOException {
- BundleInfo[] infos = defaultManipulator.getConfigData().getBundles();
- BundleInfo osgi = null;
- for (int i = 0; i < infos.length; i++) {
- if ("org.eclipse.osgi".equals(infos[i].getSymbolicName())) {
- osgi = infos[i];
- break;
- }
- }
- assertEquals(true, defaultManipulator.getConfigData().removeBundle(osgi));
- defaultManipulator.save(false);
- assertNotContent(getBundleTxt(), "org.eclipse.osgi");
- assertNotPropertyContains(getConfigIni(),"osgi.bundles", "org.eclipse.osgi");
- }
-
- public void testRemovalUsingOtherManipulator() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException {
- Manipulator newManipulator = getNewManipulator(workArea);
- BundleInfo[] infos = newManipulator.getConfigData().getBundles();
- BundleInfo osgi = null;
- for (int i = 0; i < infos.length; i++) {
- if ("org.eclipse.osgi".equals(infos[i].getSymbolicName())) {
- osgi = infos[i];
- break;
- }
- }
- newManipulator.getConfigData().removeBundle(osgi);
- newManipulator.save(false);
- assertNotContent(getBundleTxt(), "org.eclipse.osgi");
- assertNotPropertyContains(getConfigIni(),"osgi.bundles", "org.eclipse.osgi");
- }
-
- public void testAdditionUsingOtherManipulator() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException {
- BundleInfo[] infos = defaultManipulator.getConfigData().getBundles();
- BundleInfo osgi = null;
- for (int i = 0; i < infos.length; i++) {
- if ("org.eclipse.osgi".equals(infos[i].getSymbolicName())) {
- osgi = infos[i];
- break;
- }
- }
- assertEquals(true, defaultManipulator.getConfigData().removeBundle(osgi));
- defaultManipulator.save(false);
-
- Manipulator newManipulator = getNewManipulator(workArea);
-
- newManipulator.getConfigData().addBundle(osgi);
- newManipulator.save(false);
- assertContent(getBundleTxt(), "org.eclipse.osgi");
- assertNotPropertyContains(getConfigIni(),"osgi.bundles", "org.eclipse.osgi");
- }
-
- public void testChangeVersion() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, URISyntaxException {
- BundleInfo[] infos = defaultManipulator.getConfigData().getBundles();
- BundleInfo osgi = null;
- for (int i = 0; i < infos.length; i++) {
- if ("org.eclipse.osgi".equals(infos[i].getSymbolicName())) {
- osgi = infos[i];
- break;
- }
- }
- defaultManipulator.getConfigData().removeBundle(osgi);
- defaultManipulator.save(false);
-
- //These two constants describe the data file used in the test
- final String FILENAME = "org.eclipse.osgi_3.4.0.jar";
- final String VERSION = "3.4.0.v20071105";
- BundleInfo newOSGi = new BundleInfo("org.eclipse.osgi", "3.4.0.v20071105", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/" + FILENAME))), 0, true);
- defaultManipulator.getConfigData().addBundle(newOSGi);
- defaultManipulator.save(false);
- assertContent(getBundleTxt(), VERSION);
- assertContent(getConfigIni(), FILENAME);
- }
-
- public void testReadConfigWithoutOSGi() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException {
- //First Create a configuration that does not contain OSGi
- BundleInfo[] infos = defaultManipulator.getConfigData().getBundles();
- BundleInfo osgi = null;
- for (int i = 0; i < infos.length; i++) {
- if ("org.eclipse.osgi".equals(infos[i].getSymbolicName())) {
- osgi = infos[i];
- break;
- }
- }
- defaultManipulator.getConfigData().removeBundle(osgi);
- defaultManipulator.save(false);
- assertNotContent(getBundleTxt(), "org.eclipse.osgi");
- assertNotPropertyContains(getConfigIni(),"osgi.bundles", "org.eclipse.osgi");
-
- Manipulator newManipulator = getNewManipulator(workArea);
- assertEquals(1, newManipulator.getConfigData().getBundles().length);
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest1.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest1.java
deleted file mode 100644
index d0fb715..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest1.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class ReaderTest1 extends AbstractFwkAdminTest {
- private File installFolder = null;
- private String launcherName = "eclipse";
-
- public ReaderTest1(String name) {
- super(name);
- }
-
-
- public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- startSimpleConfiguratorManipulator();
-
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- installFolder = getTestData(ReaderTest1.class.getName(),"dataFile/readerTest1");
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
- assertEquals(new File(installFolder, "conf"), manipulator.getLauncherData().getFwConfigLocation());
- assertEquals("bar", manipulator.getConfigData().getProperty("foo"));
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest2.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest2.java
deleted file mode 100644
index fac583e..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest2.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.util.Properties;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class ReaderTest2 extends AbstractFwkAdminTest {
- private File installFolder = null;
- private File configurationFolder = null;
- private String launcherName = "eclipse";
-
- public ReaderTest2(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- startSimpleConfiguratorManipulator();
-
- installFolder = Activator.getContext().getDataFile(ReaderTest2.class.getName());
- configurationFolder = new File(installFolder, "conf");
- writeEclipseIni(new File(installFolder, "eclipse.ini"), new String[] { "-configuration", configurationFolder.getAbsolutePath() });
- Properties properties = new Properties();
- properties.setProperty("foo", "bar");
- writeConfigIni(new File(configurationFolder, "config.ini"), properties);
- }
-
- public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- assertEquals(new File(installFolder, "conf"), manipulator.getLauncherData().getFwConfigLocation());
- assertEquals("bar", manipulator.getConfigData().getProperty("foo"));
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest3.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest3.java
deleted file mode 100644
index 4def4fd..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest3.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class ReaderTest3 extends AbstractFwkAdminTest {
- private File installFolder = null;
- private String launcherName = "eclipse";
-
- public ReaderTest3(String name) {
- super(name);
- }
-
-
- public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- startSimpleConfiguratorManipulator();
-
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- installFolder = getTestData(ReaderTest3.class.getName(),"dataFile/readerTest3");
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
- assertEquals(new File(installFolder, "configuration"), manipulator.getLauncherData().getFwConfigLocation());
- assertEquals("bar", manipulator.getConfigData().getProperty("foo"));
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest4.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest4.java
deleted file mode 100644
index dd08dcc..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest4.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.util.Properties;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class ReaderTest4 extends AbstractFwkAdminTest {
- private File installFolder = null;
- private File configurationFolder = null;
- private String launcherName = "eclipse";
-
- public ReaderTest4(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- startSimpleConfiguratorManipulator();
-
- installFolder = Activator.getContext().getDataFile(ReaderTest4.class.getName());
- configurationFolder = new File(installFolder, "conf");
- writeEclipseIni(new File(installFolder, "eclipse.ini"), new String[] { "-install", installFolder.getAbsolutePath(), "-configuration", URIUtil.toUnencodedString(URIUtil.makeRelative(configurationFolder.toURI(), installFolder.toURI())) });
- Properties properties = new Properties();
- properties.setProperty("foo", "bar");
- writeConfigIni(new File(configurationFolder, "config.ini"), properties);
- }
-
- public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- assertEquals(new File(installFolder, "conf"), manipulator.getLauncherData().getFwConfigLocation());
- assertEquals("bar", manipulator.getConfigData().getProperty("foo"));
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest5.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest5.java
deleted file mode 100644
index 8363f41..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTest5.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.util.Properties;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class ReaderTest5 extends AbstractFwkAdminTest {
- private File installFolder = null;
- private File configurationFolder = null;
- private String launcherName = "eclipse";
-
- public ReaderTest5(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- startSimpleConfiguratorManipulator();
-
- installFolder = Activator.getContext().getDataFile(ReaderTest5.class.getName());
- configurationFolder = new File(installFolder, "configuration");
- writeEclipseIni(new File(installFolder, "eclipse.ini"), new String[] { "-install", installFolder.getAbsolutePath()});
- Properties properties = new Properties();
- properties.setProperty("foo", "bar");
- writeConfigIni(new File(configurationFolder, "config.ini"), properties);
- }
-
- public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- assertEquals(configurationFolder, manipulator.getLauncherData().getFwConfigLocation());
- assertEquals("bar", manipulator.getConfigData(). getProperty("foo"));
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug267850.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug267850.java
deleted file mode 100644
index f41cc5d..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug267850.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class ReaderTestBug267850 extends AbstractFwkAdminTest {
- private File installFolder = null;
- private String launcherName = "eclipse";
-
- public ReaderTestBug267850(String name) {
- super(name);
- }
-
-
- public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- startSimpleConfiguratorManipulator();
-
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- installFolder = getTestData(ReaderTestBug267850.class.getName(),"dataFile/readerTestBug267850");
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
- LauncherData data = manipulator.getLauncherData();
- String[] args = data.getProgramArgs();
- assertEquals("-startup", args[0]);
-// assertEquals("file:/C:/1target/provmiddle/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug267850/plugins/org.eclipse.equinox.launcher_1.0.200.v20090306-1900.jar", args[1]);
- assertEquals("--launcher.library", args[2]);
-// assertEquals("file:/C:/1target/provmiddle/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug267850/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090306-1900", args[3]);
- assertEquals("-showsplash", args[4]);
- assertEquals("org.eclipse.platform", args[5]);
- assertEquals("--launcher.XXMaxPermSize", args[6]);
- assertEquals("256m", args[7]);
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug285935.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug285935.java
deleted file mode 100644
index 2c1f0dd..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug285935.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class ReaderTestBug285935 extends AbstractFwkAdminTest {
- private File installFolder = null;
- private String launcherName = "eclipse";
-
- public ReaderTestBug285935(String name) {
- super(name);
- }
-
-
- public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- startSimpleConfiguratorManipulator();
-
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- installFolder = getTestData(ReaderTestBug285935.class.getName(),"dataFile/readerTestBug285935");
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
- assertEquals(new File(installFolder, "conf"), manipulator.getLauncherData().getFwConfigLocation());
- assertEquals("bar", manipulator.getConfigData().getProperty("foo"));
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RelativePathTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RelativePathTest.java
deleted file mode 100644
index 481dfe7..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RelativePathTest.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.frameworkadmin.tests;
-
-import java.io.*;
-import java.net.MalformedURLException;
-import java.net.URL;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxManipulatorImpl;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-
-public class RelativePathTest extends FwkAdminAndSimpleConfiguratorTest {
- /** Constant value indicating if the current platform is Windows */
- private static final boolean WINDOWS = java.io.File.separatorChar == '\\';
-
- public RelativePathTest(String name) throws Exception {
- super(name);
- }
-
- public void testRelativePaths() throws Exception {
- File installFolder = Activator.getContext().getDataFile(RelativePathTest.class.getName());
-
- //First we copy some jars into a well
- File osgiJar = new File(installFolder, "plugins/org.eclipse.osgi.jar");
- osgiJar.getParentFile().mkdirs();
- File scJar = new File(installFolder, "plugins/org.eclipse.equinox.simpleconfigurator.jar");
-
- copyStream(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar").openStream(), true, new FileOutputStream(osgiJar), true);
- copyStream(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar").openStream(), true, new FileOutputStream(scJar), true);
-
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File configurationFolder = new File(installFolder, "configuration");
- String launcherName = "eclipse";
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- BundleInfo osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", osgiJar.toURI(), 0, true);
- BundleInfo configuratorBi = new BundleInfo("org.eclipse.equinox.simpleconfigurator", "1.0.0", scJar.toURI(), 1, true);
- manipulator.getConfigData().addBundle(osgiBi);
- manipulator.getConfigData().addBundle(configuratorBi);
- try {
- manipulator.save(false);
- } catch (IOException e) {
- fail("Error while persisting");
- } catch (FrameworkAdminRuntimeException e) {
- fail("Error while persisting");
- }
-
- //":path.jar" is a poor man approach to test relative paths
- assertNotContent(new File(configurationFolder, "config.ini"), installFolder.getAbsolutePath());
- assertNotContent(new File(configurationFolder, "org.eclipse.equinox.simpleconfigurator/bundles.info"), installFolder.getAbsolutePath());
- assertContent(new File(configurationFolder, "config.ini"), ":org.eclipse.equinox.simpleconfigurator.jar");
- //Note: This is testing for old style bundle locations
- assertContent(new File(configurationFolder, "org.eclipse.equinox.simpleconfigurator/bundles.info"), "file:plugins/org.eclipse.equinox.simpleconfigurator.jar");
- assertContent(new File(configurationFolder, "org.eclipse.equinox.simpleconfigurator/bundles.info"), "file:plugins/org.eclipse.osgi.jar");
-
- BundleInfo bi = new BundleInfo(URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/bundle_1"))), 2);
- manipulator.getConfigData().addBundle(bi);
- manipulator.save(false);
- // assertContent(new File(configurationFolder, "org.eclipse.equinox.simpleconfigurator/bundles.info"), FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/bundle_1")).toExternalForm());
-
- Manipulator newManipulator = fwkAdmin.getManipulator();
- LauncherData newLauncherData = newManipulator.getLauncherData();
- newLauncherData.setFwConfigLocation(configurationFolder);
- newLauncherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- }
-
- public void testMakeRelative_NonWindows() {
- if (WINDOWS)
- return;
- URL base = null;
- try {
- base = new URL("file:/eclipse/");
- } catch (MalformedURLException e) {
- e.printStackTrace();
- fail("0.98");
- }
- // data - [0] is the test data and [1] is the expected result
- String[][] data = new String[][] { //
- new String[] {"file:/home/eclipse/foo.jar", "file:../home/eclipse/foo.jar"}, //
- new String[] {"file:///home/eclipse/foo.jar", "file:../home/eclipse/foo.jar"}, //
- };
- for (int i = 0; i < data.length; i++)
- assertEquals("1." + i, data[i][1], EquinoxManipulatorImpl.makeRelative(data[i][0], base));
- }
-
- public void testMakeRelative_Windows() {
- if (!WINDOWS)
- return;
- URL base = null;
- // platform specific data
- try {
- base = new URL("file:/c:/a/eclipse/");
- } catch (MalformedURLException e) {
- e.printStackTrace();
- fail("0.99");
- }
- // data - [0] is the test data and [1] is the expected result
- String[][] data = new String[][] {new String[] {"file:c:/b/shared/plugins/bar.jar", "file:../../b/shared/plugins/bar.jar"}, //
- new String[] {"file:d:/b/shared/plugins/bar.jar", "file:d:/b/shared/plugins/bar.jar"}, //
- new String[] {"file:/c:/a/eclipse/plugins/bar.jar", "file:plugins/bar.jar"}, //
- new String[] {"file:c:/a/eclipse/plugins/bar.jar", "file:plugins/bar.jar"}, //
- new String[] {"file:/c:/a/shared/plugins/bar.jar", "file:../shared/plugins/bar.jar"}, //
- new String[] {"file:/d:/a/eclipse/plugins/bar.jar", "file:/d:/a/eclipse/plugins/bar.jar"}, //
- new String[] {"file:/c:/x/eclipse/plugins/bar.jar", "file:../../x/eclipse/plugins/bar.jar"}, //
- };
- for (int i = 0; i < data.length; i++)
- assertEquals("2." + i, data[i][1], EquinoxManipulatorImpl.makeRelative(data[i][0], base));
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingABundle.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingABundle.java
deleted file mode 100644
index c60f934..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingABundle.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class RemovingABundle extends FwkAdminAndSimpleConfiguratorTest {
-
- public RemovingABundle(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- Manipulator manipulator = createMinimalConfiguration(RemovingABundle.class.getName());
- manipulator.getConfigData().addBundle(new BundleInfo("bundle_1", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/bundle_1"))), 4, false));
- manipulator.save(false);
-
- File fooINI = new File(getInstallFolder(), getLauncherName() +".ini");
- assertEquals(fooINI.exists(), true);
- assertContent(getBundleTxt(), "bundle_1");
- }
-
- public void testRemoveBundleWithoutURL() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException {
- Manipulator m2 = getEquinoxFrameworkAdmin().getManipulator();
-
- LauncherData launcherData2 = m2.getLauncherData();
- launcherData2.setFwConfigLocation(getConfigurationFolder());
- launcherData2.setLauncher(new File(getInstallFolder(), "eclipse"));
-
- try {
- m2.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
- BundleInfo info = new BundleInfo("bundle_1", "1.0.0", null, 0, false);
- m2.getConfigData().removeBundle(info);
- m2.save(false);
-
- assertNotContent(getBundleTxt(), "bundle_1");
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingAllBundles.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingAllBundles.java
deleted file mode 100644
index c91be84..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RemovingAllBundles.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class RemovingAllBundles extends AbstractFwkAdminTest {
-
- public RemovingAllBundles(String name) {
- super(name);
- }
-
- public void testConfigFiles() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- startSimpleConfiguratorManipulator();
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File installFolder = Activator.getContext().getDataFile(RemovingAllBundles.class.getName());
- File configurationFolder = new File(installFolder, "configuration");
- String launcherName = "foo";
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- BundleInfo osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar"))), 0, true);
- BundleInfo configuratorBi = new BundleInfo("org.eclipse.equinox.simpleconfigurator", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar"))), 1, true);
-
- manipulator.getConfigData().addBundle(osgiBi);
- manipulator.getConfigData().addBundle(configuratorBi);
-
- manipulator.save(false);
-
- File fooINI = new File(installFolder, "foo.ini");
- assertEquals(fooINI.exists(), true);
-
- Manipulator m2 = fwkAdmin.getManipulator();
-
- LauncherData launcherData2 = m2.getLauncherData();
- launcherData2.setFwConfigLocation(configurationFolder);
- launcherData2.setLauncher(new File(installFolder, launcherName));
-
- try {
- m2.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- BundleInfo[] infos = m2.getConfigData().getBundles();
- for (int i = 0; i < infos.length; i++) {
- m2.getConfigData().removeBundle(infos[i]);
- }
- m2.save(false);
-
- assertEquals(new File(configurationFolder + "/org.eclipse.equinox.simpleconfigurator", "bundles.info").exists(), false);
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RenamingLauncherIni.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RenamingLauncherIni.java
deleted file mode 100644
index 2ce33f9..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/RenamingLauncherIni.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class RenamingLauncherIni extends AbstractFwkAdminTest {
-
- public RenamingLauncherIni(String name) {
- super(name);
- }
-
- public void testConfigFiles() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- startSimpleConfiguratorManipulator();
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File installFolder = Activator.getContext().getDataFile(RenamingLauncherIni.class.getName());
- File configurationFolder = new File(installFolder, "configuration");
- String launcherName = "foo";
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- BundleInfo osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar"))), 0, true);
- BundleInfo configuratorBi = new BundleInfo("org.eclipse.equinox.simpleconfigurator", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar"))), 1, true);
-
- manipulator.getConfigData().addBundle(osgiBi);
- manipulator.getConfigData().addBundle(configuratorBi);
-
- manipulator.save(false);
-
- File fooINI = new File(installFolder, "foo.ini");
- assertEquals(fooINI.exists(), true);
-
- Manipulator m2 = fwkAdmin.getManipulator();
-
- LauncherData launcherData2 = m2.getLauncherData();
- launcherData2.setFwConfigLocation(configurationFolder);
- launcherData2.setLauncher(new File(installFolder, launcherName));
-
- try {
- m2.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
- launcherData2.setLauncher(new File(installFolder, "foo"));
- m2.save(false);
-
- assertEquals(new File(installFolder, "foo.ini").exists(), true);
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SharedConfigurationTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SharedConfigurationTest.java
deleted file mode 100644
index 0bbf5e7..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SharedConfigurationTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class SharedConfigurationTest extends AbstractFwkAdminTest {
-
- public SharedConfigurationTest(String name) {
- super(name);
- }
-
- public void testDefaultConfiguration() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException {
- startSimpleConfiguratorManipulator();
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File installFolder = Activator.getContext().getDataFile(SharedConfigurationTest.class.getName());
- File defaultConfigurationFolder = new File(installFolder, "configuration");
- defaultConfigurationFolder.mkdirs();
- copy("creating shared config.ini", getTestData("", "dataFile/sharedconfiguration/config.ini"), new File(defaultConfigurationFolder, "config.ini"));
-
- String launcherName = "foo";
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(defaultConfigurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
-
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- assertEquals("false", manipulator.getConfigData().getProperty("config.shared"));
- assertEquals("true", manipulator.getConfigData().getProperty("from.parent"));
- }
-
- public void testSharedConfiguration() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException {
- startSimpleConfiguratorManipulator();
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File installFolder = Activator.getContext().getDataFile(SharedConfigurationTest.class.getName());
- File defaultConfigurationFolder = new File(installFolder, "configuration");
- defaultConfigurationFolder.mkdirs();
- copy("creating shared config.ini", getTestData("", "dataFile/sharedconfiguration/config.ini"), new File(defaultConfigurationFolder, "config.ini"));
- File userConfigurationFolder = new File(installFolder, "user/configuration");
- userConfigurationFolder.mkdirs();
- copy("creating shared config.ini", getTestData("", "dataFile/sharedconfiguration/user-config.ini"), new File(userConfigurationFolder, "config.ini"));
-
- String launcherName = "foo";
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(userConfigurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
-
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- assertEquals("true", manipulator.getConfigData().getProperty("config.shared"));
- assertEquals("true", manipulator.getConfigData().getProperty("from.parent"));
- }
-
- public void testNotSharedConfiguration() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException {
- startSimpleConfiguratorManipulator();
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File installFolder = Activator.getContext().getDataFile(SharedConfigurationTest.class.getName());
- File defaultConfigurationFolder = new File(installFolder, "configuration");
- defaultConfigurationFolder.mkdirs();
- copy("creating shared config.ini", getTestData("", "dataFile/sharedconfiguration/config.ini"), new File(defaultConfigurationFolder, "config.ini"));
- File userConfigurationFolder = new File(installFolder, "user/configuration");
- userConfigurationFolder.mkdirs();
- copy("creating shared config.ini", getTestData("", "dataFile/sharedconfiguration/user-noshare-config.ini"), new File(userConfigurationFolder, "config.ini"));
-
- String launcherName = "foo";
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(userConfigurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
-
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- assertEquals("false", manipulator.getConfigData().getProperty("config.shared"));
- assertEquals(null, manipulator.getConfigData().getProperty("from.parent"));
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorComingAndGoing.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorComingAndGoing.java
deleted file mode 100644
index 736a32b..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorComingAndGoing.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class SimpleConfiguratorComingAndGoing extends FwkAdminAndSimpleConfiguratorTest {
- Manipulator m = null;
-
- public SimpleConfiguratorComingAndGoing(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- m = createMinimalConfiguration(SimpleConfiguratorComingAndGoing.class.getName());
- }
-
- public void testWithMutipleBundles() throws IOException, BundleException, URISyntaxException {
- BundleInfo bi = new BundleInfo(URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/bundle_1"))), 2);
- m.getConfigData().addBundle(bi);
- m.save(false);
-
- BundleInfo[] bis = m.getConfigData().getBundles();
- for (int i = 0; i < bis.length; i++) {
- if (bis[i].getSymbolicName().equals("org.eclipse.equinox.simpleconfigurator"))
- m.getConfigData().removeBundle(bis[i]);
- }
- m.save(false);
-
- assertNothing(getBundleTxt());
- assertContent(getConfigIni(), "bundle_1");
- assertContent(getConfigIni(), "org.eclipse.osgi");
-
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator newManipulator = fwkAdmin.getManipulator();
-
- LauncherData launcherData = newManipulator.getLauncherData();
- launcherData.setFwConfigLocation(getConfigurationFolder());
- launcherData.setLauncher(new File(getInstallFolder(), getLauncherName()));
- try {
- newManipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- newManipulator.getConfigData().addBundle(new BundleInfo(URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar"))), 1, true));
- newManipulator.save(false);
-
- assertContent(getBundleTxt(), "org.eclipse.osgi");
- assertContent(getBundleTxt(), "bundle_1");
- assertContent(getBundleTxt(), "org.eclipse.equinox.simpleconfigurator");
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorTest.java
deleted file mode 100644
index 10af760..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/SimpleConfiguratorTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.BundleException;
-
-public class SimpleConfiguratorTest extends AbstractFwkAdminTest {
-
- public SimpleConfiguratorTest(String name) {
- super(name);
- }
-
- public void testConfigFiles() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException {
- startSimpleConfiguratorManipulator();
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator manipulator = fwkAdmin.getManipulator();
-
- File installFolder = Activator.getContext().getDataFile(SimpleConfiguratorTest.class.getName());
- File configurationFolder = new File(installFolder, "configuration");
- String launcherName = "eclipse";
-
- LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder);
- launcherData.setLauncher(new File(installFolder, launcherName));
- try {
- manipulator.load();
- } catch (IllegalStateException e) {
- //TODO We ignore the framework JAR location not set exception
- }
-
- BundleInfo osgiBi = new BundleInfo("org.eclipse.osgi", "3.3.1", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.osgi.jar"))), 0, true);
- BundleInfo configuratorBi = new BundleInfo("org.eclipse.equinox.simpleconfigurator", "1.0.0", URIUtil.toURI(FileLocator.resolve(Activator.getContext().getBundle().getEntry("dataFile/org.eclipse.equinox.simpleconfigurator.jar"))), 1, true);
-
- manipulator.getConfigData().addBundle(osgiBi);
- manipulator.getConfigData().addBundle(configuratorBi);
-
- manipulator.save(false);
-
- File bundleTXT = new File(configurationFolder, "org.eclipse.equinox.simpleconfigurator/bundles.info");
- File configINI = new File(configurationFolder, "config.ini");
- assertContent(bundleTXT, "org.eclipse.osgi");
- assertContent(configINI, "org.eclipse.osgi");
- assertContent(bundleTXT, "org.eclipse.equinox.simpleconfigurator");
- assertContent(configINI, "org.eclipse.equinox.simpleconfigurator");
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestEclipseDataArea.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestEclipseDataArea.java
deleted file mode 100644
index 9a0babf..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestEclipseDataArea.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.Manipulator;
-
-public class TestEclipseDataArea extends FwkAdminAndSimpleConfiguratorTest {
- Manipulator m = null;
-
- public TestEclipseDataArea(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- m = createMinimalConfiguration(TestEclipseDataArea.class.getName());
- }
-
- public void testp2DataArea() throws IOException {
- m.getConfigData().setProperty("eclipse.p2.data.area", "@config.dir/../p2");
- m.save(false);
- assertContent(getConfigIni(), "@config.dir/../p2");
- m.load();
- m.save(false);
- assertContent(getConfigIni(), "@config.dir/../p2");
-
- m.getConfigData().setProperty("eclipse.p2.data.area", new File(getConfigurationFolder(), "p2").getAbsoluteFile().toURI().toString());
- m.save(false);
- assertContent(getConfigIni(), "@config.dir/p2");
- m.load();
- m.save(false);
- assertContent(getConfigIni(), "@config.dir/p2");
-
- m.getConfigData().setProperty("eclipse.p2.data.area", new File(getConfigurationFolder(), "../p2").getAbsoluteFile().toURI().toString());
- m.save(false);
- assertContent(getConfigIni(), "@config.dir/../p2");
- m.load();
- m.save(false);
- assertContent(getConfigIni(), "@config.dir/../p2");
-
- m.getConfigData().setProperty("eclipse.p2.data.area", "file:/d:/tmp/fo%20o/bar/p2");
- m.save(false);
- assertContent(getConfigIni(), "/tmp/fo o/bar/p2");
- assertNotContent(getConfigIni(), "@config.dir");
- m.load();
- m.save(false);
- assertContent(getConfigIni(), "/tmp/fo o/bar/p2");
- assertNotContent(getConfigIni(), "@config.dir");
-
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestRunningInstance.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestRunningInstance.java
deleted file mode 100644
index d723d04..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestRunningInstance.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.tests;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.*;
-
-public class TestRunningInstance extends AbstractFwkAdminTest {
-
- public TestRunningInstance(String name) {
- super(name);
- }
-
- public void testRunningInstance() throws BundleException {
- //TODO Commented out due to NPE failure on Windows on test machines only
- if (Platform.OS_WIN32.equals(Platform.getOS()))
- return;
- FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin();
- Manipulator m = fwkAdmin.getRunningManipulator();
- BundleInfo[] infos = m.getConfigData().getBundles();
-
- Bundle[] bundles = Activator.getContext().getBundles();
-
- assertEquals(bundles.length, infos.length);
- for (int i = 0; i < bundles.length; i++) {
- boolean found = false;
- for (int j = 0; j < infos.length && found == false; j++) {
- found = same(infos[j], bundles[i]);
- }
- if (found == false) {
- fail("Can't find: " + bundles[i]);
- }
- }
- }
-
- private boolean same(BundleInfo info, Bundle bundle) {
- if (info.getSymbolicName().equals(bundle.getSymbolicName())) {
- if (new Version((String) bundle.getHeaders().get(Constants.BUNDLE_VERSION)).equals(new Version(info.getVersion())))
- return true;
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestVMArg.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestVMArg.java
deleted file mode 100644
index c0c6228..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestVMArg.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 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.frameworkadmin.tests;
-
-import java.io.File;
-import java.io.IOException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.FrameworkAdminRuntimeException;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.Manipulator;
-
-public class TestVMArg extends FwkAdminAndSimpleConfiguratorTest {
- private Manipulator m;
-
- public TestVMArg(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- m = createMinimalConfiguration(TestEclipseDataArea.class.getName());
- }
-
- public void testVMInsideInstall() throws FrameworkAdminRuntimeException, IOException {
- //Test VM path in the install folder
- File jreLocation = new File(m.getLauncherData().getLauncher().getParentFile(), "jre");
- m.getLauncherData().setJvm(jreLocation);
- m.save(false);
- assertNotContent(new File(getInstallFolder(), "eclipse.ini"), jreLocation.getAbsolutePath());
- assertContent(new File(getInstallFolder(), "eclipse.ini"), "jre");
- assertContent(m.getLauncherData().getLauncherConfigLocation(), "-vm");
- assertContent(m.getLauncherData().getLauncherConfigLocation(), "jre");
- assertNotContent(m.getLauncherData().getLauncherConfigLocation(), "file:");
- m.load();
- assertEquals(jreLocation, m.getLauncherData().getJvm());
-
- m.getLauncherData().setJvm(null);
- m.save(false);
- assertNotContent(m.getLauncherData().getLauncherConfigLocation(), "-vm");
- assertNotContent(m.getLauncherData().getLauncherConfigLocation(), "jre");
- }
-
- public void testVMOutsideInstall() throws FrameworkAdminRuntimeException, IOException {
- //Test VM path in the install folder
- File jreLocation = new File(m.getLauncherData().getLauncher().getParentFile(), "../../jre").getCanonicalFile();
- m.getLauncherData().setJvm(jreLocation);
- m.save(false);
- assertContent(new File(getInstallFolder(), "eclipse.ini"), jreLocation.getAbsolutePath().replace('\\','/'));
- assertContent(m.getLauncherData().getLauncherConfigLocation(), "-vm");
- assertContent(m.getLauncherData().getLauncherConfigLocation(), "jre");
- assertNotContent(m.getLauncherData().getLauncherConfigLocation(), "file:");
- m.load();
- assertEquals(jreLocation, m.getLauncherData().getJvm());
- }
-
- public void test269502() throws FrameworkAdminRuntimeException, IOException {
- //Test VM path in the install folder
- String winPath = "c:/ibm5sr3/bin";
- String linuxPath = "/Users/Pascal/ibm5sr3/bin";
- String chosenPath = Platform.getOS().equals("win32") ? winPath : linuxPath;
- File jreLocation = new File(chosenPath);
- m.getLauncherData().setJvm(jreLocation);
- m.save(false);
- assertContent(new File(getInstallFolder(), "eclipse.ini"), chosenPath);
- assertContent(m.getLauncherData().getLauncherConfigLocation(), "-vm");
- assertContent(m.getLauncherData().getLauncherConfigLocation(), chosenPath);
- assertNotContent(m.getLauncherData().getLauncherConfigLocation(), "file:");
- m.load();
- assertEquals(jreLocation, m.getLauncherData().getJvm());
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/UtilsTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/UtilsTest.java
deleted file mode 100644
index 0841eb4..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/UtilsTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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.frameworkadmin.tests;
-
-import java.io.File;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.utils.FileUtils;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.Manipulator;
-import org.eclipse.osgi.service.environment.Constants;
-
-public class UtilsTest extends AbstractFwkAdminTest {
-
- /**
- * @param name
- */
- public UtilsTest(String name) {
- super(name);
- }
-
- public void test_getEclipseRealLocation() throws Exception {
- File installFolder = Activator.getContext().getDataFile("212361");
-
- File plugins = new File(installFolder, "plugins");
- File foo1 = new File(plugins, "org.foo_1.2.3.abc");
- File foo2 = new File(plugins, "org.foo_1.2.4.xyz");
- File foo_64 = new File(plugins, "org.foo.x86_64_1.2.3");
- File fooWithSpaces = new File(plugins, "alotof/s p a c e s/org.foo_1.2.3.abc");
- foo1.mkdirs();
- foo2.mkdirs();
- foo_64.mkdirs();
- fooWithSpaces.mkdirs();
-
- Manipulator manipulator = getFrameworkManipulator(new File(installFolder, "configuration"), new File(installFolder, "eclipse"));
-
-
- assertEquals(FileUtils.getEclipseRealLocation(manipulator, "org.foo"), foo2.toURI());
- assertEquals(FileUtils.getEclipseRealLocation(manipulator, "org.foo_1.2.3.abc"), foo1.toURI());
- assertEquals(FileUtils.getEclipseRealLocation(manipulator, "org.foo.x86_64"), foo_64.toURI());
-
- assertEquals(FileUtils.getEclipseRealLocation(manipulator, plugins.toURI().toString() + "alotof/s%20p%20a%20c%20e%20s/org.foo_1.2.3.abc/"), fooWithSpaces.toURI());
-
- File other = new File(installFolder, "other/org.foo_1.2.4");
- other.mkdirs();
- manipulator.getConfigData().setProperty("osgi.syspath", other.getParentFile().getAbsolutePath());
- assertEquals(FileUtils.getEclipseRealLocation(manipulator, "org.foo"), other.toURI());
- }
-
- public void testMacRealLocation() throws Exception {
- File installFolder = Activator.getContext().getDataFile("280007");
-
- File plugins = new File(installFolder, "plugins");
- File foo = new File(plugins, "org.foo_1.2.3.abc");
- foo.mkdirs();
-
- Manipulator manipulator = getFrameworkManipulator(new File(installFolder, "configuration"), new File(installFolder, "Eclipse.app/Contents/MacOS/eclipse"));
- manipulator.getLauncherData().setOS(Constants.OS_MACOSX);
- assertEquals(FileUtils.getEclipseRealLocation(manipulator, "org.foo"), foo.toURI());
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/.classpath b/bundles/org.eclipse.equinox.frameworkadmin/.classpath
deleted file mode 100644
index 6f3b481..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.frameworkadmin/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index fd68207..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,265 +0,0 @@
-#Mon Aug 24 11:50:51 EDT 2009
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.comment.format_block_comments=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.lineSplit=800
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.comment.format_line_comments=false
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.frameworkadmin/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 283b95a..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,57 +0,0 @@
-#Sun Sep 23 11:57:26 EDT 2007
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_core
-formatter_settings_version=11
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=;
-org.eclipse.jdt.ui.ondemandthreshold=3
-org.eclipse.jdt.ui.staticondemandthreshold=3
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=true
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.format_source_code=true
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_variable_declarations_final=true
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=false
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=false
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=true
-sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=false
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.frameworkadmin/META-INF/MANIFEST.MF
deleted file mode 100644
index d898c01..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,29 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.equinox.frameworkadmin;singleton:=true
-Bundle-Version: 1.0.200.qualifier
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Import-Package: org.eclipse.osgi.service.pluginconversion;version="1.0.0",
- org.eclipse.osgi.util;version="1.1.0",
- org.osgi.framework;version="1.3.0"
-Export-Package: org.eclipse.equinox.internal.frameworkadmin.utils;
- x-friends:="org.eclipse.equinox.frameworkadmin.equinox,
- org.eclipse.equinox.p2.metadata.generator,
- org.eclipse.equinox.p2.publisher,
- org.eclipse.equinox.simpleconfigurator.manipulator",
- org.eclipse.equinox.internal.provisional.configuratormanipulator;x-friends:="org.eclipse.equinox.frameworkadmin.equinox,org.eclipse.equinox.simpleconfigurator.manipulator",
- org.eclipse.equinox.internal.provisional.frameworkadmin;
- x-friends:="org.eclipse.equinox.frameworkadmin.equinox,
- org.eclipse.equinox.p2.metadata.generator,
- org.eclipse.equinox.p2.publisher,
- org.eclipse.equinox.p2.touchpoint.eclipse,
- org.eclipse.equinox.simpleconfigurator.manipulator,
- org.eclipse.pde.core,
- org.eclipse.pde.ui"
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
-Require-Bundle: org.eclipse.equinox.common;bundle-version="3.4.0"
-Bundle-ActivationPolicy: lazy
-Bundle-Activator: org.eclipse.equinox.internal.frameworkadmin.utils.Activator
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/build.properties b/bundles/org.eclipse.equinox.frameworkadmin/build.properties
deleted file mode 100644
index b0b12db..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 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
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html,\
- plugin.properties
-src.includes = about.html
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/plugin.properties b/bundles/org.eclipse.equinox.frameworkadmin/plugin.properties
deleted file mode 100644
index 5ceaadc..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2009 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
-###############################################################################
-pluginName = Equinox Framework Admin
-providerName = Eclipse.org - Equinox
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Activator.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Activator.java
deleted file mode 100644
index 733bdcb..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Activator.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.frameworkadmin.utils;
-
-import org.eclipse.osgi.service.pluginconversion.PluginConverter;
-import org.osgi.framework.*;
-
-/**
- * @since 1.0
- */
-public class Activator implements BundleActivator {
-
- private static BundleContext bundleContext;
-
- /* (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- bundleContext = context;
- }
-
- /* (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- bundleContext = null;
- }
-
- /*
- * Acquire the plug-in conversion service or return <code>null</code> if it is not available.
- */
- public static PluginConverter acquirePluginConverter() {
- if (bundleContext == null)
- return null;
- ServiceReference reference = bundleContext.getServiceReference(PluginConverter.class.getName());
- if (reference == null)
- return null;
- PluginConverter result = (PluginConverter) bundleContext.getService(reference);
- bundleContext.ungetService(reference);
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/SimpleBundlesState.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/SimpleBundlesState.java
deleted file mode 100644
index 9a479d6..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/SimpleBundlesState.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.utils;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.util.*;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.osgi.framework.Constants;
-
-/**
- * This implementation of BundlesState doesn't support any of
- * - resolving bundles,
- * - retrieving fw persistent data.
- *
- * This implementation can be used for those cases.
- *
- */
-
-public class SimpleBundlesState implements BundlesState {
- public static final BundleInfo[] NULL_BUNDLEINFOS = new BundleInfo[0];
-
- /**
- * Check if the specified FrameworkAdmin is available.
- *
- * @param fwAdmin
- * @throws FrameworkAdminRuntimeException
- */
- public static void checkAvailability(FrameworkAdmin fwAdmin) throws FrameworkAdminRuntimeException {
- if (!fwAdmin.isActive())
- throw new FrameworkAdminRuntimeException("FrameworkAdmin creates this object is no more available.", FrameworkAdminRuntimeException.FRAMEWORKADMIN_UNAVAILABLE);
- }
-
- /**
- *
- * @param launcherData
- * @return File of fwJar to be used.
- * @throws IOException
- */
- static File getFwJar(LauncherData launcherData) {
- if (launcherData.getFwJar() != null)
- return launcherData.getFwJar();
- return null;
- }
-
- private final String systemBundleSymbolicName;
-
- private final String systemBundleName;
-
- private final String systemBundleVendor;
- List bundleInfosList = new LinkedList();
-
- FrameworkAdmin fwAdmin = null;
-
- Manipulator manipulator = null;
-
- /**
- * If the manifest of the target fw implementation has Constants.BUNDLE_SYMBOLICNAME header,
- * this constructor should be used.
- *
- * @param ManipulatorAdmin
- * @param Manipulator
- * @param systemBundleSymbolicName
- */
- public SimpleBundlesState(FrameworkAdmin ManipulatorAdmin, Manipulator Manipulator, String systemBundleSymbolicName) {
- super();
- this.fwAdmin = ManipulatorAdmin;
- // copy Manipulator object for avoiding modifying the parameters of the Manipulator.
- this.manipulator = ManipulatorAdmin.getManipulator();
- this.manipulator.setConfigData(Manipulator.getConfigData());
- this.manipulator.setLauncherData(Manipulator.getLauncherData());
- this.systemBundleSymbolicName = systemBundleSymbolicName;
- this.systemBundleName = null;
- this.systemBundleVendor = null;
- initialize();
- }
-
- /**
- * If the manifest of the target fw implementation has not Constants.BUNDLE_SYMBOLICNAME header
- * but , Constants.BUNDLE_NAME and BUNDLE_VERSION,
- * this constructor should be used.
- *
- * @param ManipulatorAdmin
- * @param Manipulator
- * @param systemBundleName
- * @param systemBundleVender
- */
- public SimpleBundlesState(FrameworkAdmin ManipulatorAdmin, Manipulator Manipulator, String systemBundleName, String systemBundleVender) {
- super();
- this.fwAdmin = ManipulatorAdmin;
- // copy Manipulator object for avoiding modifying the parameters of the Manipulator.
- this.manipulator = ManipulatorAdmin.getManipulator();
- this.manipulator.setConfigData(Manipulator.getConfigData());
- this.manipulator.setLauncherData(Manipulator.getLauncherData());
- this.systemBundleSymbolicName = null;
- this.systemBundleName = systemBundleName;
- this.systemBundleVendor = systemBundleVender;
- initialize();
- }
-
- public BundleInfo[] getExpectedState() throws FrameworkAdminRuntimeException {
- if (!fwAdmin.isActive())
- throw new FrameworkAdminRuntimeException("FrameworkAdmin creates this object is no more available.", FrameworkAdminRuntimeException.FRAMEWORKADMIN_UNAVAILABLE);
- return Utils.getBundleInfosFromList(this.bundleInfosList);
- }
-
- /*
- * Just return required bundles.
- *
- * @see org.eclipse.equinox.internal.provisional.frameworkadmin.BundlesState#getPrerequisteBundles(org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo)
- */
- public BundleInfo[] getPrerequisteBundles(BundleInfo bInfo) {
- URI location = bInfo.getLocation();
- final String requiredBundles = Utils.getManifestMainAttributes(location, Constants.REQUIRE_BUNDLE);
- if (requiredBundles == null)
- return new BundleInfo[] {this.getSystemBundle()};
-
- String[] clauses = Utils.getClauses(requiredBundles);
- List list = new LinkedList();
- for (int i = 0; i < clauses.length; i++)
- list.add(Utils.getPathFromClause(clauses[i]));
-
- List ret = new LinkedList();
- ret.add(this.getSystemBundle());
- for (Iterator ite = this.bundleInfosList.iterator(); ite.hasNext();) {
- BundleInfo currentBInfo = (BundleInfo) ite.next();
- URI currentLocation = currentBInfo.getLocation();
- String currentSymbolicName = Utils.getManifestMainAttributes(currentLocation, Constants.BUNDLE_SYMBOLICNAME);
- if (currentSymbolicName == null)
- continue;
- currentSymbolicName = Utils.getPathFromClause(currentSymbolicName);
- for (Iterator ite2 = list.iterator(); ite2.hasNext();) {
- String symbolicName = (String) ite2.next();
- if (symbolicName.equals(currentSymbolicName)) {
- ret.add(currentBInfo);
- break;
- }
- }
- }
- return Utils.getBundleInfosFromList(ret);
- }
-
- public BundleInfo getSystemBundle() {
- if (this.systemBundleSymbolicName == null) {
- for (Iterator ite = this.bundleInfosList.iterator(); ite.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite.next();
- // if (bInfo.getStartLevel() != 1)
- // return null;;
- URI location = bInfo.getLocation();
- String bundleName = Utils.getManifestMainAttributes(location, Constants.BUNDLE_NAME);
- if (systemBundleName.equals(bundleName)) {
- String bundleVendor = Utils.getManifestMainAttributes(location, Constants.BUNDLE_VENDOR);
- if (systemBundleVendor.equals(bundleVendor))
- return bInfo;
- }
- }
- return null;
- }
- for (Iterator ite = this.bundleInfosList.iterator(); ite.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite.next();
- URI location = bInfo.getLocation();
- String symbolicName = Utils.getManifestMainAttributes(location, Constants.BUNDLE_SYMBOLICNAME);
- symbolicName = Utils.getPathFromClause(symbolicName);
- if (this.systemBundleSymbolicName.equals(symbolicName))
- return bInfo;
- }
- return null;
- }
-
- public BundleInfo[] getSystemFragmentedBundles() {
- BundleInfo systemBInfo = this.getSystemBundle();
- if (systemBInfo == null)
- return NULL_BUNDLEINFOS;
-
- List list = new LinkedList();
- for (Iterator ite = this.bundleInfosList.iterator(); ite.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite.next();
- URI location = bInfo.getLocation();
- String manifestVersion = Utils.getManifestMainAttributes(location, Constants.BUNDLE_MANIFESTVERSION);
- if (manifestVersion == null)
- continue;
- if (manifestVersion.equals("1") || manifestVersion.equals("1.0"))
- continue;
-
- String fragmentHost = Utils.getManifestMainAttributes(location, Constants.FRAGMENT_HOST);
- if (fragmentHost == null)
- continue;
- int index = fragmentHost.indexOf(";");
- if (index == -1)
- continue;
- String symbolicName = fragmentHost.substring(0, index).trim();
- String parameter = fragmentHost.substring(index + 1).trim();
- // TODO What to do ,in case of alias name of system bundle is not used ?
- if (symbolicName.equals(Constants.SYSTEM_BUNDLE_SYMBOLICNAME))
- if (parameter.equals(Constants.EXTENSION_DIRECTIVE + ":=" + Constants.EXTENSION_FRAMEWORK)) {
- list.add(location);
- break;
- }
- }
- return Utils.getBundleInfosFromList(list);
- }
-
- public String[] getUnsatisfiedConstraints(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
- throw new FrameworkAdminRuntimeException("getUnsatisfiedConstraints(BundleInfo bInfo) is not supported in this implementation", FrameworkAdminRuntimeException.UNSUPPORTED_OPERATION);
- }
-
- private void initialize() {
- this.bundleInfosList.clear();
- LauncherData launcherData = manipulator.getLauncherData();
- ConfigData configData = manipulator.getConfigData();
- File fwJar = getFwJar(launcherData);;
-
- if (fwJar == null)
- throw new IllegalStateException("launcherData.getLauncherConfigFile() == null && fwJar is not set.");
- // No fw persistent data location is taken into consideration.
-
- BundleInfo[] bInfos = configData.getBundles();
- for (int j = 0; j < bInfos.length; j++)
- this.installBundle(bInfos[j]);
-
- if (getSystemBundle() == null) {
- BundleInfo sysBInfo = new BundleInfo(launcherData.getFwJar().toURI(), 0, true, 0);
- this.installBundle(sysBInfo);
- }
- }
-
- public void installBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
-
- URI newLocation = bInfo.getLocation();
- Dictionary newManifest = Utils.getOSGiManifest(newLocation);
- if (newManifest == null) {
- // TODO log something here
- return;
- }
- String newSymbolicName = (String) newManifest.get(Constants.BUNDLE_SYMBOLICNAME);
- String newVersion = (String) newManifest.get(Constants.BUNDLE_VERSION);
- //System.out.println("> currentInstalledBundles.length=" + currentInstalledBundles.length);
- boolean found = false;
- for (Iterator ite = this.bundleInfosList.iterator(); ite.hasNext();) {
- BundleInfo currentBInfo = (BundleInfo) ite.next();
- URI location = currentBInfo.getLocation();
- if (newLocation.equals(location)) {
- found = true;
- break;
- }
- Dictionary manifest = Utils.getOSGiManifest(location);
- String symbolicName = (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME);
- String version = (String) manifest.get(Constants.BUNDLE_VERSION);
- if (newSymbolicName != null && newVersion != null)
- if (newSymbolicName.equals(symbolicName) && newVersion.equals(version)) {
- found = true;
- break;
- }
- }
- if (!found) {
- this.bundleInfosList.add(bInfo);
- }
- }
-
- // public String toString() {
- // if (state == null)
- // return null;
- // StringBuffer sb = new StringBuffer();
- // BundleDescription[] bundleDescriptions = state.getBundles();
- // for (int i = 0; i < bundleDescriptions.length; i++) {
- // sb.append(bundleDescriptions[i].getBundleId() + ":");
- // sb.append(bundleDescriptions[i].toString() + "(");
- // sb.append(bundleDescriptions[i].isResolved() + ")");
- // String[] ees = bundleDescriptions[i].getExecutionEnvironments();
- // for (int j = 0; j < ees.length; j++)
- // sb.append(ees[j] + " ");
- // sb.append("\n");
- // }
- // sb.append("PlatformProperties:\n");
- // Dictionary[] dics = state.getPlatformProperties();
- // for (int i = 0; i < dics.length; i++) {
- // for (Enumeration enum = dics[i].keys(); enum.hasMoreElements();) {
- // String key = (String) enum.nextElement();
- // String value = (String) dics[i].get(key);
- // sb.append(" (" + key + "," + value + ")\n");
- // }
- // }
- // sb.append("\n");
- // return sb.toString();
- // }
-
- public boolean isFullySupported() {
- return false;
- }
-
- public boolean isResolved() throws FrameworkAdminRuntimeException {
- throw new FrameworkAdminRuntimeException("isResolved() is not supported in this implementation", FrameworkAdminRuntimeException.UNSUPPORTED_OPERATION);
- }
-
- public boolean isResolved(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
- throw new FrameworkAdminRuntimeException("isResolved(BundleInfo bInfo) is not supported in this implementation", FrameworkAdminRuntimeException.UNSUPPORTED_OPERATION);
- }
-
- public void resolve(boolean increment) throws FrameworkAdminRuntimeException {
- throw new FrameworkAdminRuntimeException("resolve(boolean increment) is not supported in this implementation", FrameworkAdminRuntimeException.UNSUPPORTED_OPERATION);
- }
-
- public void uninstallBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
- URI targetLocation = bInfo.getLocation();
- int index = -1;
- for (Iterator ite = this.bundleInfosList.iterator(); ite.hasNext();) {
- index++;
- BundleInfo currentBInfo = (BundleInfo) ite.next();
- URI location = currentBInfo.getLocation();
- if (targetLocation.equals(location)) {
- break;
- }
- }
- if (index != -1)
- this.bundleInfosList.remove(index);
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Utils.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Utils.java
deleted file mode 100644
index a6d3ef7..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Utils.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*******************************************************************************
- * 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.frameworkadmin.utils;
-
-import java.io.*;
-import java.net.*;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.jar.JarFile;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo;
-import org.eclipse.osgi.service.pluginconversion.PluginConversionException;
-import org.eclipse.osgi.service.pluginconversion.PluginConverter;
-import org.eclipse.osgi.util.ManifestElement;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-
-public class Utils {
- private static final String FEATURE_MANIFEST = "feature.xml"; //$NON-NLS-1$
- private static final String FILE_SCHEME = "file"; //$NON-NLS-1$
- private static final String FRAGMENT_MANIFEST = "fragment.xml"; //$NON-NLS-1$
- private static final String PATH_SEP = "/"; //$NON-NLS-1$
- private static final String PLUGIN_MANIFEST = "plugin.xml"; //$NON-NLS-1$
-
- /**
- * Overwrite all properties of from to the properties of to. Return the result of to.
- *
- * @param to Properties whose keys and values of other Properties will be appended to.
- * @param from Properties whose keys and values will be set to the other properties.
- * @return Properties as a result of this method.
- */
- public static Properties appendProperties(Properties to, Properties from) {
- if (from != null) {
- if (to == null)
- to = new Properties();
- // printoutProperties(System.out, "to", to);
- // printoutProperties(System.out, "from", from);
-
- for (Enumeration enumeration = from.keys(); enumeration.hasMoreElements();) {
- String key = (String) enumeration.nextElement();
- to.setProperty(key, from.getProperty(key));
- }
- }
- // printoutProperties(System.out, "to", to);
- return to;
- }
-
- //Return a dictionary representing a manifest. The data may result from plugin.xml conversion
- private static Dictionary basicLoadManifest(File bundleLocation) {
- InputStream manifestStream = null;
- ZipFile jarFile = null;
- try {
- try {
- String fileExtention = bundleLocation.getName();
- fileExtention = fileExtention.substring(fileExtention.lastIndexOf('.') + 1);
- // Handle a JAR'd bundle
- if ("jar".equalsIgnoreCase(fileExtention) && bundleLocation.isFile()) { //$NON-NLS-1$
- jarFile = new ZipFile(bundleLocation, ZipFile.OPEN_READ);
- ZipEntry manifestEntry = jarFile.getEntry(JarFile.MANIFEST_NAME);
- if (manifestEntry != null) {
- manifestStream = jarFile.getInputStream(manifestEntry);
- }
- } else {
- // we have a directory-based bundle
- File bundleManifestFile = new File(bundleLocation, JarFile.MANIFEST_NAME);
- if (bundleManifestFile.exists())
- manifestStream = new BufferedInputStream(new FileInputStream(new File(bundleLocation, JarFile.MANIFEST_NAME)));
- }
- } catch (IOException e) {
- //ignore
- }
- // we were unable to get an OSGi manifest file so try and convert an old-style manifest
- if (manifestStream == null)
- return convertPluginManifest(bundleLocation, true);
-
- try {
- Map manifest = ManifestElement.parseBundleManifest(manifestStream, null);
- // add this check to handle the case were we read a non-OSGi manifest
- if (manifest.get(Constants.BUNDLE_SYMBOLICNAME) == null)
- return convertPluginManifest(bundleLocation, true);
- return manifestToProperties(manifest);
- } catch (IOException ioe) {
- return null;
- } catch (BundleException e) {
- return null;
- }
- } finally {
- try {
- if (manifestStream != null)
- manifestStream.close();
- } catch (IOException e1) {
- //Ignore
- }
- try {
- if (jarFile != null)
- jarFile.close();
- } catch (IOException e2) {
- //Ignore
- }
- }
- }
-
- public static void checkAbsoluteDir(File file, String dirName) throws IllegalArgumentException {
- if (file == null)
- throw new IllegalArgumentException(dirName + " is null");
- if (!file.isAbsolute())
- throw new IllegalArgumentException(dirName + " is not absolute path. file=" + file.getAbsolutePath());
- if (!file.isDirectory())
- throw new IllegalArgumentException(dirName + " is not directory. file=" + file.getAbsolutePath());
- }
-
- public static void checkAbsoluteFile(File file, String dirName) {//throws ManipulatorException {
- if (file == null)
- throw new IllegalArgumentException(dirName + " is null");
- if (!file.isAbsolute())
- throw new IllegalArgumentException(dirName + " is not absolute path. file=" + file.getAbsolutePath());
- if (file.isDirectory())
- throw new IllegalArgumentException(dirName + " is not file but directory");
- }
-
- public static URL checkFullUrl(URL url, String urlName) throws IllegalArgumentException {//throws ManipulatorException {
- if (url == null)
- throw new IllegalArgumentException(urlName + " is null");
- if (!url.getProtocol().endsWith("file"))
- return url;
- File file = new File(url.getFile());
- if (!file.isAbsolute())
- throw new IllegalArgumentException(urlName + "(" + url + ") does not have absolute path");
- if (file.getAbsolutePath().startsWith(PATH_SEP))
- return url;
- try {
- return getUrl("file", null, PATH_SEP + file.getAbsolutePath());
- } catch (MalformedURLException e) {
- throw new IllegalArgumentException(urlName + "(" + "file:" + PATH_SEP + file.getAbsolutePath() + ") is not fully quallified");
- }
- }
-
- /*
- * Copied from BundleDescriptionFactory in the metadata generator.
- */
- private static Dictionary convertPluginManifest(File bundleLocation, boolean logConversionException) {
- PluginConverter converter;
- try {
- converter = org.eclipse.equinox.internal.frameworkadmin.utils.Activator.acquirePluginConverter();
- if (converter == null) {
- new RuntimeException("Unable to aquire PluginConverter service during generation for: " + bundleLocation).printStackTrace(); //$NON-NLS-1$
- return null;
- }
- return converter.convertManifest(bundleLocation, false, null, true, null);
- } catch (PluginConversionException convertException) {
- // only log the exception if we had a plugin.xml or fragment.xml and we failed conversion
- if (bundleLocation.getName().equals(FEATURE_MANIFEST))
- return null;
- if (!new File(bundleLocation, PLUGIN_MANIFEST).exists() && !new File(bundleLocation, FRAGMENT_MANIFEST).exists())
- return null;
- if (logConversionException) {
- IStatus status = new Status(IStatus.WARNING, "org.eclipse.equinox.frameworkadmin", 0, "Error converting bundle manifest.", convertException);
- System.out.println(status);
- //TODO Need to find a way to get a logging service to log
- }
- return null;
- }
- }
-
- public static boolean createParentDir(File file) {
- File parent = file.getParentFile();
- if (parent == null)
- return false;
- if (parent.exists())
- return true;
- return parent.mkdirs();
- }
-
- public static BundleInfo[] getBundleInfosFromList(List list) {
- if (list == null)
- return new BundleInfo[0];
- BundleInfo[] ret = new BundleInfo[list.size()];
- list.toArray(ret);
- return ret;
- }
-
- public static String[] getClauses(String header) {
- StringTokenizer token = new StringTokenizer(header, ",");
- List list = new LinkedList();
- while (token.hasMoreTokens()) {
- list.add(token.nextToken());
- }
- String[] ret = new String[list.size()];
- list.toArray(ret);
- return ret;
- }
-
- public static String[] getClausesManifestMainAttributes(URI location, String name) {
- return getClauses(getManifestMainAttributes(location, name));
- }
-
- public static String getManifestMainAttributes(URI location, String name) {
- Dictionary manifest = Utils.getOSGiManifest(location);
- if (manifest == null)
- throw new RuntimeException("Unable to locate bundle manifest: " + location);
- return (String) manifest.get(name);
- }
-
- public static Dictionary getOSGiManifest(URI location) {
- if (location == null)
- return null;
- // if we have a file-based URL that doesn't end in ".jar" then...
- if (FILE_SCHEME.equals(location.getScheme()))
- return basicLoadManifest(URIUtil.toFile(location));
-
- try {
- URL url = new URL("jar:" + location.toString() + "!/");
- JarURLConnection jarConnection = (JarURLConnection) url.openConnection();
- ZipFile jar = jarConnection.getJarFile();
-
- try {
- ZipEntry entry = jar.getEntry(JarFile.MANIFEST_NAME);
- if (entry == null)
- return null;
-
- Map manifest = ManifestElement.parseBundleManifest(jar.getInputStream(entry), null);
- // if we have a JAR'd bundle that has a non-OSGi manifest file (like
- // the ones produced by Ant, then try and convert the plugin.xml
- if (manifest.get(Constants.BUNDLE_SYMBOLICNAME) == null) {
- String jarName = jar.getName();
- File file = jarName != null ? new File(jarName) : null;
- if (file != null && file.exists()) {
- return convertPluginManifest(file, true);
- }
- return null;
- }
- return manifestToProperties(manifest);
- } catch (BundleException e) {
- return null;
- } finally {
- jar.close();
- }
- } catch (IOException e) {
- if (System.getProperty("osgi.debug") != null) {
- System.err.println("location=" + location);
- e.printStackTrace();
- }
- }
- return null;
- }
-
- public static String getPathFromClause(String clause) {
- if (clause == null)
- return null;
- if (clause.indexOf(";") != -1)
- clause = clause.substring(0, clause.indexOf(";"));
- return clause.trim();
- }
-
- public static String getRelativePath(File target, File from) {
-
- String targetPath = Utils.replaceAll(target.getAbsolutePath(), File.separator, PATH_SEP);
- String fromPath = Utils.replaceAll(from.getAbsolutePath(), File.separator, PATH_SEP);
-
- String[] targetTokens = Utils.getTokens(targetPath, PATH_SEP);
- String[] fromTokens = Utils.getTokens(fromPath, PATH_SEP);
- int index = -1;
- for (int i = 0; i < fromTokens.length; i++)
- if (fromTokens[i].equals(targetTokens[i]))
- index = i;
- else
- break;
-
- StringBuffer sb = new StringBuffer();
- for (int i = index + 1; i < fromTokens.length; i++)
- sb.append(".." + PATH_SEP);
-
- for (int i = index + 1; i < targetTokens.length; i++)
- if (i != targetTokens.length - 1)
- sb.append(targetTokens[i] + PATH_SEP);
- else
- sb.append(targetTokens[i]);
- return sb.toString();
- }
-
- /**
- * This method will be called for create a backup file.
- *
- * @param file target file
- * @return File backup file whose filename consists of "hogehoge.yyyyMMddHHmmss.ext" or
- * "hogehoge.yyyyMMddHHmmss".
- */
- public static File getSimpleDataFormattedFile(File file) {
- SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
- String date = df.format(new Date());
- String filename = file.getName();
- int index = filename.lastIndexOf(".");
- if (index != -1)
- filename = filename.substring(0, index) + "." + date + "." + filename.substring(index + 1);
- else
- filename = filename + "." + date;
- File dest = new File(file.getParentFile(), filename);
- return dest;
- }
-
- public static String[] getTokens(String msg, String delim) {
- return getTokens(msg, delim, false);
- }
-
- public static String[] getTokens(String msg, String delim, boolean returnDelims) {
- StringTokenizer targetST = new StringTokenizer(msg, delim, returnDelims);
- String[] tokens = new String[targetST.countTokens()];
- ArrayList list = new ArrayList(targetST.countTokens());
- while (targetST.hasMoreTokens()) {
- list.add(targetST.nextToken());
- }
- list.toArray(tokens);
- return tokens;
- }
-
- public static URL getUrl(String protocol, String host, String file) throws MalformedURLException {// throws ManipulatorException {
- file = Utils.replaceAll(file, File.separator, "/");
- return new URL(protocol, host, file);
- }
-
- public static URL getUrlInFull(String path, URL from) throws MalformedURLException {//throws ManipulatorException {
- Utils.checkFullUrl(from, "from");
- path = Utils.replaceAll(path, File.separator, "/");
- //System.out.println("from.toExternalForm()=" + from.toExternalForm());
- String fromSt = Utils.removeLastCh(from.toExternalForm(), '/');
- //System.out.println("fromSt=" + fromSt);
- if (path.startsWith("/")) {
- String fileSt = from.getFile();
- return new URL(fromSt.substring(0, fromSt.lastIndexOf(fileSt) - 1) + path);
- }
- return new URL(fromSt + "/" + path);
- }
-
- private static Properties manifestToProperties(Map d) {
- Iterator iter = d.keySet().iterator();
- Properties result = new Properties();
- while (iter.hasNext()) {
- String key = (String) iter.next();
- result.put(key, d.get(key));
- }
- return result;
- }
-
- /**
- * Just used for debug.
- *
- * @param ps printstream
- * @param name name of properties
- * @param props properties whose keys and values will be printed out.
- */
- public static void printoutProperties(PrintStream ps, String name, Properties props) {
- if (props == null || props.size() == 0) {
- ps.println("Props(" + name + ") is empty");
- return;
- }
- ps.println("Props(" + name + ")=");
- for (Enumeration enumeration = props.keys(); enumeration.hasMoreElements();) {
- String key = (String) enumeration.nextElement();
- ps.print("\tkey=" + key);
- ps.println("\tvalue=" + props.getProperty(key));
- }
- }
-
- public static String removeLastCh(String target, char ch) {
- while (target.charAt(target.length() - 1) == ch) {
- target = target.substring(0, target.length() - 1);
- }
- return target;
- }
-
- public static String replaceAll(String st, String oldSt, String newSt) {
- if (oldSt.equals(newSt))
- return st;
- int index = -1;
- while ((index = st.indexOf(oldSt)) != -1) {
- st = st.substring(0, index) + newSt + st.substring(index + oldSt.length());
- }
- return st;
- }
-
- /**
- * Sort by increasing order of startlevels.
- *
- * @param bInfos array of BundleInfos to be sorted.
- * @param initialBSL initial bundle start level to be used.
- * @return sorted array of BundleInfos
- */
- public static BundleInfo[] sortBundleInfos(BundleInfo[] bInfos, int initialBSL) {
- SortedMap bslToList = new TreeMap();
- for (int i = 0; i < bInfos.length; i++) {
- Integer sL = new Integer(bInfos[i].getStartLevel());
- if (sL.intValue() == BundleInfo.NO_LEVEL)
- sL = new Integer(initialBSL);
- List list = (List) bslToList.get(sL);
- if (list == null) {
- list = new LinkedList();
- bslToList.put(sL, list);
- }
- list.add(bInfos[i]);
- }
-
- // bslToList is sorted by the key (StartLevel).
- List bundleInfoList = new LinkedList();
- for (Iterator ite = bslToList.keySet().iterator(); ite.hasNext();) {
- Integer sL = (Integer) ite.next();
- List list = (List) bslToList.get(sL);
- for (Iterator ite2 = list.iterator(); ite2.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite2.next();
- bundleInfoList.add(bInfo);
- }
- }
- return getBundleInfosFromList(bundleInfoList);
- }
-
- /**
- * get String representing the given properties.
- *
- * @param name name of properties
- * @param props properties whose keys and values will be printed out.
- */
- public static String toStringProperties(String name, Properties props) {
- if (props == null || props.size() == 0) {
- return "Props(" + name + ") is empty\n";
- }
- StringBuffer sb = new StringBuffer();
- sb.append("Props(" + name + ") is \n");
- for (Enumeration enumeration = props.keys(); enumeration.hasMoreElements();) {
- String key = (String) enumeration.nextElement();
- sb.append("\tkey=" + key + "\tvalue=" + props.getProperty(key) + "\n");
- }
- return sb.toString();
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/configuratormanipulator/ConfiguratorManipulator.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/configuratormanipulator/ConfiguratorManipulator.java
deleted file mode 100644
index f400e35..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/configuratormanipulator/ConfiguratorManipulator.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * 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.provisional.configuratormanipulator;
-
-import java.io.File;
-import java.io.IOException;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-
-/**
- *
- * This interface provides methods that enable client bundles to
- * manipulate the corresponding ConfiguratorBundle.
- *
- * @see Configurator
- */
-
-public interface ConfiguratorManipulator {
- String SERVICE_PROP_KEY_CONFIGURATOR_BUNDLESYMBOLICNAME = "org.eclipse.equinox.configurator.BundleSymbolicName";
-
- /**
- * Save configuration for the corresponding Configurator Bundle so that
- * Bundles kept by the specified {@link Manipulator} would be installed after completion of a launch.
- * The location of a configuration file is determined by the parameters set to the Manipulator object
- * and it depends on the corresponding ConfiguratorBundle implementation.
- *
- * While some parameters of the {@link Manipulator} object will be modified (for setting info about the
- * location the ConfiguratorBundle would be able to refer in a future launch),
- * the Bundles kept by the {@link Manipulator} object should not be modified.
- *
- * Instead, it will return BundleInfo[] to be managed not by the ConfiguratorBundle.
- * These values are supposed to be saved into fw config files.
- *
- * If backup flag is true, a file have existed already under the same name
- * will be renamed into another name as a backup.
- *
- * We assume that the implementation of {@link Manipulator#save(boolean)} will call this method.
- *
- * @return array of BundleInfo to be saved as installing bundles in fw config files.
- * @param manipulator {@link Manipulator} object which contains the bundles to be installed finally.
- * @param backup if files exists at the location to save, it will be copied as a backup.
- * @throws IOException - If fail to save configuration for the corresponding Configurator Bundle.
- */
- BundleInfo[] save(Manipulator manipulator, boolean backup) throws IOException;
-
- /**
- * Update bundles kept by the specified {@link Manipulator} object into installed bundles
- * if {@link FrameworkAdmin#launch(Manipulator, File)} with the specified
- * {@link Manipulator} is called taking the corresponding ConfiguratorBundle behaivior into account.
- *
- * If there is no corresponding ConfiguratorBundle in Manipulator.getConfigData().getBundles(),
- * just return.
- *
- * The BundleInfo[] of the specified Manipulator object will be modified.
- *
- * This method is assumed to be called from {@link Manipulator#load()}.
- *
- * @param manipulator {@link Manipulator} object to be used and updated.
- * @throws IOException - If fail to read configuration for the corresponding Configurator Bundle.
- */
- void updateBundles(Manipulator manipulator) throws IOException;
-
- void cleanup(Manipulator manipulator);
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/configuratormanipulator/ConfiguratorManipulatorFactory.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/configuratormanipulator/ConfiguratorManipulatorFactory.java
deleted file mode 100644
index 1112455..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/configuratormanipulator/ConfiguratorManipulatorFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * 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.provisional.configuratormanipulator;
-
-import org.eclipse.equinox.internal.provisional.frameworkadmin.FrameworkAdmin;
-
-/**
- * Factory class for creating ConfiguratorManipulator object from Java programs.
- *
- * @see FrameworkAdmin
- */
-public abstract class ConfiguratorManipulatorFactory {
- public final static String SYSTEM_PROPERTY_KEY = "org.eclipse.equinox.configuratorManipulatorFactory";
-
- abstract protected ConfiguratorManipulator createConfiguratorManipulator();
-
- public static ConfiguratorManipulator getInstance(String className) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
- ConfiguratorManipulatorFactory factory = (ConfiguratorManipulatorFactory) Class.forName(className).newInstance();
- return factory.createConfiguratorManipulator();
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/BundleInfo.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/BundleInfo.java
deleted file mode 100644
index 48e8903..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/BundleInfo.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.provisional.frameworkadmin;
-
-import java.net.URI;
-import org.eclipse.core.runtime.URIUtil;
-
-/**
- * This object represents information of a bundle. This class is a copy of the BundleInfo
- * class in org.eclipse.equinox.simpleconfigurator
- *
- */
-public class BundleInfo {
- public static final int NO_LEVEL = -1;
- public static final int NO_BUNDLEID = -1;
-
- private String symbolicName = null;
- private String version = null;
- private URI baseLocation;
- private URI location;
- private long bundleId = NO_BUNDLEID;
-
- private boolean markedAsStarted = false;
- private int startLevel = NO_LEVEL;
- private boolean resolved = false;
-
- private String manifest;
- private String fragmentHost;
-
- public BundleInfo() {
- }
-
- public BundleInfo(URI location) {
- this.location = location;
- }
-
- public BundleInfo(URI location, boolean started) {
- this.location = location;
- this.markedAsStarted = started;
- }
-
- public BundleInfo(URI location, int startLevel) {
- this.location = location;
- this.startLevel = startLevel;
- }
-
- public BundleInfo(URI location, int startLevel, boolean started) {
- this.location = location;
- this.startLevel = startLevel;
- this.markedAsStarted = started;
- }
-
- public BundleInfo(URI location, int startLevel, boolean started, long bundleId) {
- this.location = location;
- this.startLevel = startLevel;
- this.markedAsStarted = started;
- this.bundleId = bundleId;
- }
-
- public BundleInfo(String symbolic, String version, URI location, int startLevel, boolean started) {
- this.symbolicName = symbolic;
- this.version = version;
- this.location = location;
- this.markedAsStarted = started;
- this.startLevel = startLevel;
- }
-
- public long getBundleId() {
- return bundleId;
- }
-
- public URI getBaseLocation() {
- return baseLocation;
- }
-
- public URI getLocation() {
- return location;
- }
-
- public String getManifest() {
- return manifest;
- }
-
- public int getStartLevel() {
- return startLevel;
- }
-
- public String getSymbolicName() {
- return symbolicName;
- }
-
- public String getVersion() {
- return version;
- }
-
- public String getFragmentHost() {
- return fragmentHost;
- }
-
- public boolean isMarkedAsStarted() {
- return markedAsStarted;
- }
-
- public boolean isResolved() {
- return resolved;
- }
-
- public void setBundleId(long bundleId) {
- this.bundleId = bundleId;
- }
-
- public void setBaseLocation(URI baseLocation) {
- this.baseLocation = baseLocation;
- }
-
- public void setLocation(URI location) {
- this.location = location;
- }
-
- public void setManifest(String manifest) {
- this.manifest = manifest;
- }
-
- public void setMarkedAsStarted(boolean markedAsStarted) {
- this.markedAsStarted = markedAsStarted;
- }
-
- public void setResolved(boolean resolved) {
- this.resolved = resolved;
- }
-
- public void setStartLevel(int level) {
- this.startLevel = level;
- }
-
- public void setSymbolicName(String symbolicName) {
- this.symbolicName = symbolicName;
- }
-
- public void setVersion(String value) {
- this.version = value;
- }
-
- public void setFragmentHost(String fragmentHost) {
- this.fragmentHost = fragmentHost;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("BundleInfo("); //$NON-NLS-1$
- if (symbolicName != null)
- buffer.append(symbolicName);
- buffer.append(", "); //$NON-NLS-1$
- if (version != null)
- buffer.append(version);
-
- if (fragmentHost != null) {
- buffer.append(", fragmentHost="); //$NON-NLA-1$
- buffer.append(fragmentHost);
- }
-
- if (baseLocation != null) {
- buffer.append(", baseLocation="); //$NON-NLS-1$
- buffer.append(baseLocation);
- }
- buffer.append(", location="); //$NON-NLS-1$
- buffer.append(location);
- buffer.append(", startLevel="); //$NON-NLS-1$
- buffer.append(startLevel);
- buffer.append(", toBeStarted="); //$NON-NLS-1$
- buffer.append(markedAsStarted);
- buffer.append(", resolved="); //$NON-NLS-1$
- buffer.append(resolved);
- buffer.append(", id="); //$NON-NLS-1$
- buffer.append(this.bundleId);// buffer.append(',').append(manifest == null ? "no manifest" : "manifest available");
- buffer.append(',').append(manifest == null ? "no manifest" : "manifest available"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append(')');
- return buffer.toString();
- }
-
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((symbolicName == null) ? 0 : symbolicName.hashCode());
- result = prime * result + ((version == null) ? 0 : version.hashCode());
- return result;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
-
- if (obj == null)
- return false;
-
- if (getClass() != obj.getClass())
- return false;
-
- BundleInfo other = (BundleInfo) obj;
- if (symbolicName == null) {
- if (other.symbolicName != null)
- return false;
- } else if (!symbolicName.equals(other.symbolicName))
- return false;
-
- if (version == null) {
- if (other.version != null)
- return false;
- } else if (!version.equals(other.version))
- return false;
-
- if (location == null || other.location == null)
- return true;
-
- //compare absolute location URIs
- URI absoluteLocation = baseLocation == null ? location : URIUtil.append(baseLocation, location.toString());
- URI otherAbsoluteLocation = other.baseLocation == null ? other.location : URIUtil.append(other.baseLocation, other.location.toString());
- return URIUtil.sameURI(absoluteLocation, otherAbsoluteLocation);
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/BundlesState.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/BundlesState.java
deleted file mode 100644
index 971373b..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/BundlesState.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * 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.provisional.frameworkadmin;
-
-/**
- * This API is used for expecting bundles state virtually.
- *
- * This object is instantiated by {@link Manipulator#getBundlesState()}.
- * At its instantiation, state of the bundles will be created in this object
- * according to the parameters which the calling {@link Manipulator} object has.
- * For its creation, information in the fw persistent data will be taken into account.
- *
- * Modification of this object after its instantiation never affects the parameters
- * in the calling {@link Manipulator} object.
- *
- * XXX Implementation of Simple ConfiguratorManipulator needs the functions.
- *
- * @see Manipulator
- */
-public interface BundlesState {
-
- /** Return expected bundles state currently kept in this object.
- *
- * The implementation of this method will try to resolve the state
- * if resolving a state is supported.
- *
- * @return bundle array of BundleInfo currently composed in this object.
- * @throws FrameworkAdminRuntimeException - If the {@link FrameworkAdmin} service created the parent {@link Manipulator} is unregistered.
- */
- BundleInfo[] getExpectedState() throws FrameworkAdminRuntimeException;
-
- /**
- * Return required bundles to be resolve the specified bInfo
- * under the state currently composed.
- *
- * The implementation of this method will try to resolve the state
- * if resolving a state is supported.
- *
- * @param bInfo bundleinfo whose prerequisite bundles will be searched.
- * @return bundle array of BundleInfos required for the specified bInfo to be resolved.
- */
- BundleInfo[] getPrerequisteBundles(BundleInfo bInfo);
-
- /**
- * Return a bundle to be used as a framework under the state currently composed.
- * @return a bundle to be used as a framework under the state currently composed.
- */
- public BundleInfo getSystemBundle();
-
- /**
- * Return bundles which are fragment bundles of the framework under the state currently composed.
- * @return array of BundleInfos which are fragment bundles of the framework.
- */
- public BundleInfo[] getSystemFragmentedBundles();
-
- /**
- * Return array of Strings which tells the unsatisfied constaints
- * to resolve the specified bInfo under the state currently composed.
- *
- * If this implementation doesn't support resolving state,
- * FrameworkAdminRuntimeException with a cause of {@value FrameworkAdminRuntimeException#UNSUPPORTED_OPERATION}
- * will be thrown.
- *
- * XXX this method is prepared mainly for debugging.
- *
- * @param bInfo
- * @return array of Strings which tells the unsatisfied constaints.
- * @throws FrameworkAdminRuntimeException if this implementation doesn't support resolving state, FrameworkAdminRuntimeException with a cause of {@value FrameworkAdminRuntimeException#UNSUPPORTED_OPERATION} will be thrown.
- */
- public String[] getUnsatisfiedConstraints(BundleInfo bInfo) throws FrameworkAdminRuntimeException;
-
- /**
- * Install the specified bInfo as a installed bundle to the current state virtually.
- * Note that resolve this bundle is not done in this implementation.
- *
- * @param bInfo BundleInfo to be installed
- * @throws FrameworkAdminRuntimeException - If the {@link FrameworkAdmin} service created the parent {@link Manipulator} is unregistered.
- */
- void installBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException;
-
- /**
- * Return true if this implementation supports full functions,
- * such as resolving bundles and .
- * Otherwise false will be returend.
- * @return true if this implementation supports resolving state. Otherwise false.
- */
- boolean isFullySupported();
-
- /**
- * Return true if the state currently composed is resolved after the last change of the state.
- * Otherwise false.
- *
- * If this implementation doesn't support resolving state,
- * FrameworkAdminRuntimeException with a cause of {@value FrameworkAdminRuntimeException#UNSUPPORTED_OPERATION}
- * will be thrown.
- *
- * @return true if the state currently composed is resolved after the last change of the state. Otherwise false.
- * @throws FrameworkAdminRuntimeException if this implementation doesn't support resolving state, FrameworkAdminRuntimeException with a cause of {@value FrameworkAdminRuntimeException#UNSUPPORTED_OPERATION} will be thrown.
- */
- public boolean isResolved() throws FrameworkAdminRuntimeException;
-
- /**
- * Return true if the specified bundle is resolved.
- * Otherwise false.
- *
- * If this implementation doesn't support resolving state,
- * FwLauncherException with a cause of {@value FwLauncherException#UNSUPPORTED_OPERATION}
- * will be thrown.
- *
- * @return true if the specified bundle is resolved. Otherwise false.
- * @throws FrameworkAdminRuntimeException if this implementation doesn't support resolving state, FrameworkAdminRuntimeException with a cause of {@value FrameworkAdminRuntimeException#UNSUPPORTED_OPERATION} will be thrown.
- */
- public boolean isResolved(BundleInfo bInfo) throws FrameworkAdminRuntimeException;
-
- /**
- * Resolves the constraints contained in this state.
- *
- * If this implementation doesn't support resolving state,
- * FrameworkAdminRuntimeException with a cause of {@value FrameworkAdminRuntimeException#UNSUPPORTED_OPERATION}
- * will be thrown.
- *
- * @param incremental a flag controlling whether resolution should be incremental
- * @throws FrameworkAdminRuntimeException
- */
- void resolve(boolean increment) throws FrameworkAdminRuntimeException;
-
- /**
- * Uninstall the specified bInfo from the current state virtually.
- *
- * @param bInfo BundleInfo to be uninstalled
- * @throws FrameworkAdminRuntimeException - If the {@link FrameworkAdmin} service created the parent {@link Manipulator} is unregistered.
- */
- void uninstallBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException;;
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/ConfigData.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/ConfigData.java
deleted file mode 100644
index 7f888f7..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/ConfigData.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.provisional.frameworkadmin;
-
-import java.util.*;
-
-/**
- * This object is instantiated by {@link Manipulator#getConfigData()};
- * The class that keeps some parameters of the {@link Manipulator}
- * created this object. The manipulating of the parameters will affect
- * the {@link Manipulator}.
- *
- * @see Manipulator
- */
-public class ConfigData {
- final private String fwName;
- final private String fwVersion;
- final private String launcherName;
- final private String launcherVersion;
- private int beginningFwStartLevel = BundleInfo.NO_LEVEL;
- private int initialBundleStartLevel = BundleInfo.NO_LEVEL;
- // List of BundleInfo
- private LinkedHashSet bundlesList = new LinkedHashSet();
-
- private Properties properties = new Properties();
-
- public ConfigData(String fwName, String fwVersion, String launcherName, String launcherVersion) {
- this.fwName = fwName;
- this.fwVersion = fwVersion;
- this.launcherName = launcherName;
- this.launcherVersion = launcherVersion;
- this.initialize();
- }
-
- public void addBundle(BundleInfo bundleInfo) {
- bundlesList.add(bundleInfo);
- }
-
- public int getBeginingFwStartLevel() {
- return beginningFwStartLevel;
- }
-
- public BundleInfo[] getBundles() {
- if (bundlesList.size() == 0)
- return new BundleInfo[0];
- BundleInfo[] ret = new BundleInfo[bundlesList.size()];
- bundlesList.toArray(ret);
- return ret;
- }
-
- public String getProperty(String key) {
- return properties.getProperty(key);
- }
-
- public Properties getProperties() {
- Properties ret = new Properties();
- ret.putAll(properties);
- return ret;
- }
-
- public String getFwName() {
- return fwName;
- }
-
- public String getFwVersion() {
- return fwVersion;
- }
-
- public int getInitialBundleStartLevel() {
- return initialBundleStartLevel;
- }
-
- public String getLauncherName() {
- return launcherName;
- }
-
- public String getLauncherVersion() {
- return launcherVersion;
- }
-
- public void initialize() {
- beginningFwStartLevel = BundleInfo.NO_LEVEL;
- initialBundleStartLevel = BundleInfo.NO_LEVEL;
- bundlesList.clear();
- properties.clear();
- properties.clear();
- }
-
- public boolean removeBundle(BundleInfo bundleInfo) {
- if (bundleInfo == null)
- throw new IllegalArgumentException("Bundle info can't be null:" + bundleInfo); //$NON-NLS-1$
- return bundlesList.remove(bundleInfo);
- }
-
- public void setBeginningFwStartLevel(int startLevel) {
- beginningFwStartLevel = startLevel;
- }
-
- public void setBundles(BundleInfo[] bundleInfos) {
- bundlesList.clear();
- if (bundleInfos != null)
- for (int i = 0; i < bundleInfos.length; i++)
- bundlesList.add(bundleInfos[i]);
- }
-
- public void setProperty(String key, String value) {
- if (value == null)
- properties.remove(key);
- else
- properties.setProperty(key, value);
- }
-
- public void appendProperties(Properties props) {
- properties.putAll(props);
- }
-
- public void setProperties(Properties props) {
- properties.clear();
- properties.putAll(props);
- }
-
- public void setInitialBundleStartLevel(int startLevel) {
- initialBundleStartLevel = startLevel;
- }
-
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("Class:" + getClass().getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("============Independent===============\n"); //$NON-NLS-1$
- sb.append("fwName=" + fwName + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("fwVersion=" + fwVersion + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("launcherName=" + launcherName + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("launcherVersion=" + launcherVersion + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("beginningFwStartLevel=" + beginningFwStartLevel + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("initialBundleStartLevel=" + initialBundleStartLevel + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- if (this.bundlesList.size() == 0)
- sb.append("bundlesList=null\n"); //$NON-NLS-1$
- else {
- sb.append("bundlesList=\n"); //$NON-NLS-1$
- int i = 0;
- for (Iterator iter = bundlesList.iterator(); iter.hasNext();) {
- sb.append("\tbundlesList[" + i + "]=" + iter.next().toString() + "\n"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
- i++;
- }
- }
-
- sb.append("============ Properties ===============\n"); //$NON-NLS-1$
- sb.append("fwIndependentProps="); //$NON-NLS-1$
- setPropsStrings(sb, properties);
- return sb.toString();
- }
-
- private static void setPropsStrings(StringBuffer sb, Properties props) {
- if (props.size() > 0) {
- sb.append("\n");
- for (Enumeration enumeration = props.keys(); enumeration.hasMoreElements();) {
- String key = (String) enumeration.nextElement();
- String value = props.getProperty(key);
- if (value == null || value.equals(""))
- continue;
- sb.append("\t{" + key + " ,\t" + value + "}\n");
- }
- } else
- sb.append("empty\n");
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdmin.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdmin.java
deleted file mode 100644
index a145750..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdmin.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * 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.provisional.frameworkadmin;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * The implementation of this API will be registered to the service
- * registry as an OSGi service.
- *
- * *****************************************************************
- * 1. For developers who implement bundles that register this service.
- *
- * Upon registration, the following service properties must be set to allow clients to
- * search the FrameworkAdmin object, which will create BundlesState / ConfigData / LauncherData objects.
- *
- * {@link FrameworkAdmin#SERVICE_PROP_KEY_FW_NAME}: String; name of the framework
- * {@link FrameworkAdmin#SERVICE_PROP_KEY_FW_VERSION}: String; version of the framework
- * {@link FrameworkAdmin#SERVICE_PROP_KEY_LAUNCHER_NAME}: String; name of the launcher
- * {@link FrameworkAdmin#SERVICE_PROP_KEY_LAUNCHER_VERSION}: String; version of the launcher
- *
- * Bundles that register this service will check if the currently running system can be manipulated by
- * this FrameworkAdmin. If yes and this implementation can create an initialized Manipulator object
- * according to the running framework and launcher, add the service property keyed by
- *
- * {@link FrameworkAdmin#SERVICE_PROP_KEY_RUNNING_SYSTEM_FLAG}: String; if "true",
- * the service that will be returned by getRunningManipulator() is fully initialized to
- * represent the state of the running system.
- *
- * It is recommended to implement Manipulator objects created by calling methods of this interface
- * so that they cannot be used after this service is unregistered.
- *
- * *****************************************************************
- * 2. For developers who implement client bundles that use this service.
- *
- * A client of this service can obtain a Manipulator object by calling the {@link #getManipulator()} method.
- *
- * A client can search among services registered in a service registry to find the
- * desired FrameworkAdmin implementation that matches the desired framework
- * type, framework version, launcher type, and launcher version.
- *
- * In order for a client bundle to manipulate the {@link Manipulator} object
- * of the running framework and launcher, the service filter (FrameworkAdmin#SERVICE_PROP_KEY_RUNNING_FW_FLAG=true)
- * should be used.
- *
- * As with all OSGi services, the client bundle should track this service state.
- * If the service is unregistered, it should stop using any of the objects obtained from this service and
- * release them. If it continues to use them, {@link FrameworkAdminRuntimeException} might
- * be thrown.
- *
- * *****************************************************************
- * In addition, FrameworkAdminFactory will create this object. This is used by Java programs.
- *
- * @see FrameworkAdminFactory
- *
- */
-public interface FrameworkAdmin {
-
- String SERVICE_PROP_KEY_FW_NAME = "org.eclipse.equinox.frameworkhandler.framework.name";
- String SERVICE_PROP_KEY_FW_VERSION = "org.eclipse.equinox.frameworkhandler.framework.version";
-
- String SERVICE_PROP_KEY_LAUNCHER_NAME = "org.eclipse.equinox.frameworkhandler.launcher.name";
- String SERVICE_PROP_KEY_LAUNCHER_VERSION = "org.eclipse.equinox.frameworkhandler.launcher.version";
- String SERVICE_PROP_KEY_RUNNING_SYSTEM_FLAG = "org.eclipse.equinox.frameworkhandler.runningfwflag";
-
- /**
- * Create new instance of {@link Manipulator} and return it.
- *
- * @return new instance of Manipulator.
- */
- public Manipulator getManipulator();
-
- /**
- * Create new instance of {@link Manipulator} for running system
- * and return it. The instance must be initialized fully according to the
- * running environment. If this implementation cannot provide it, return null.
- *
- * @return new instance of Manipulator.
- */
- public Manipulator getRunningManipulator();
-
- /**
- * Launch a framework instance under the specified current working directory.
- *
- * @param manipulator {@link Manipulator} object to be launched.
- * @param cwd current working directory to be used for launching.
- * @return process
- * @throws IllegalArgumentException if specified arguments are null.
- * @throws IOException if any error relate with IO occurs
- * @throws FrameworkAdminRuntimeException if the FrameworkAdmin service object
- * that created the specified Manipulator object is unregistered.
- */
- public Process launch(Manipulator manipulator, File cwd) throws IllegalArgumentException, IOException, FrameworkAdminRuntimeException;
-
- /**
- *
- * @return true if this object is active. false otherwise.
- */
- public boolean isActive();
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminFactory.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminFactory.java
deleted file mode 100644
index 07fcec8..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.provisional.frameworkadmin;
-
-/**
- * Factory class for creating FrameworkAdmin object from Java programs.
- *
- * @see FrameworkAdmin
- */
-public abstract class FrameworkAdminFactory {
- abstract protected FrameworkAdmin createFrameworkAdmin() throws InstantiationException, IllegalAccessException, ClassNotFoundException;
-
- // proposed method: only for ConfiguratorManipulatorFactory, magic system property is used.
- public static FrameworkAdmin getInstance(String className) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
- FrameworkAdminFactory factory = (FrameworkAdminFactory) Class.forName(className).newInstance();
- return factory.createFrameworkAdmin();
- }
-
- // // method 3: two magic system properties are used.
- // public static FrameworkAdmin getInstance() throws InstantiationException, IllegalAccessException, ClassNotFoundException {
- // String className = System.getProperty("org.eclipse.equinox.internal.provisional.frameworkadmin.frameworkAdminFactory");
- // if (className == null)
- // throw new ClassNotFoundException("System property keyed by \"org.eclipse.equinox.internal.provisional.frameworkadmin.frameworkAdminFactory\" is not set.");
- // FrameworkAdminFactory factory = (FrameworkAdminFactory) Class.forName(className).newInstance();
- // return (FrameworkAdmin) factory.createFrameworkAdmin();
- // }
-
- // // method 1: no magic system properties are used.
- //
- // public static FrameworkAdmin getInstance(String className, String configuratorManipulatorFactoryName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
- // ExtendedFrameworkAdminFactory factory = (ExtendedFrameworkAdminFactory) Class.forName(className).newInstance();
- // return (FrameworkAdmin) factory.createFrameworkAdmin(configuratorManipulatorFactoryName);
- // }
-
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminRuntimeException.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminRuntimeException.java
deleted file mode 100644
index 0e99605..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminRuntimeException.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * 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.provisional.frameworkadmin;
-
-public class FrameworkAdminRuntimeException extends RuntimeException {
-
- private static final long serialVersionUID = -2292498677000772317L;
- public static final String FRAMEWORKADMIN_UNAVAILABLE = "FrameworkAdmin service created this object is not available any more";
- public static final String UNSUPPORTED_OPERATION = "This implementation doesn't support this method.";
-
- private final String reason;
- private Throwable cause;
-
- /**
- * @param message
- */
- public FrameworkAdminRuntimeException(String message, String reason) {
- super(message);
- this.reason = reason;
- this.cause = null;
- }
-
- /**
- * @param message
- * @param cause
- */
- public FrameworkAdminRuntimeException(String message, Throwable cause, String reason) {
- super(message);
- this.reason = reason;
- this.cause = cause;
- }
-
- /**
- * @param cause
- */
- public FrameworkAdminRuntimeException(Throwable cause, String reason) {
- super(cause.getLocalizedMessage());
- this.reason = reason;
- this.cause = cause;
- }
-
- public String getReason() {
- return reason;
- }
-
- public Throwable getCause() {
- return cause;
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/LauncherData.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/LauncherData.java
deleted file mode 100644
index 4a8bd51..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/LauncherData.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.provisional.frameworkadmin;
-
-import java.io.File;
-import java.util.*;
-
-/**
- * This object is instantiated by {@link Manipulator#getLauncherData()};
- * The class that keeps some parameters of the {@link Manipulator}
- * created this object. The manipulating of the parameters will affect
- * the {@link Manipulator}.
- *
- *
- * @see Manipulator
- */
-public class LauncherData {
- private File fwPersistentDataLocation = null;
- private File jvm = null;
- private List jvmArgs = new LinkedList();
- private List programArgs = new LinkedList();
-
- private boolean clean;
- private File fwConfigLocation;
- private File home = null;
- private File fwJar = null;
-
- private File launcher = null;
- private File launcherConfigLocation = null;
-
- private String fwName;
- private String fwVersion;
- private String launcherName;
- private String launcherVersion;
- private String os;
-
- public LauncherData(String fwName, String fwVersion, String launcherName, String launcherVersion) {
- this.fwName = fwName;
- this.fwVersion = fwVersion;
- this.launcherName = launcherName;
- this.launcherVersion = launcherVersion;
- this.initialize();
- }
-
- public void addJvmArg(String arg) {
- if (arg == null)
- return;
- jvmArgs.add(arg);
- }
-
- public void addProgramArg(String arg) {
- if (arg == null)
- return;
- programArgs.add(arg);
- }
-
- public File getFwConfigLocation() {
- return fwConfigLocation;
- }
-
- public File getFwJar() {
- return fwJar;
- }
-
- public String getFwName() {
- return fwName;
- }
-
- public File getFwPersistentDataLocation() {
- return fwPersistentDataLocation;
- }
-
- public String getFwVersion() {
- return fwVersion;
- }
-
- public File getHome() {
- return home;
- }
-
- public File getJvm() {
- return jvm;
- }
-
- public String[] getJvmArgs() {
- String[] args = new String[jvmArgs.size()];
- jvmArgs.toArray(args);
- return args;
- }
-
- public File getLauncher() {
- return launcher;
- }
-
- public File getLauncherConfigLocation() {
- return launcherConfigLocation;
- }
-
- public String getLauncherName() {
- return launcherName;
- }
-
- public String getLauncherVersion() {
- return launcherVersion;
- }
-
- public String[] getProgramArgs() {
- String[] args = new String[programArgs.size()];
- programArgs.toArray(args);
- return args;
- }
-
- public void initialize() {
- fwPersistentDataLocation = null;
- jvm = null;
- jvmArgs.clear();
- programArgs.clear();
- clean = false;
- fwConfigLocation = null;
- fwJar = null;
- launcher = null;
- }
-
- public boolean isClean() {
- return clean;
- }
-
- public void removeJvmArg(String arg) {
- jvmArgs.remove(arg);
- }
-
- public void removeProgramArg(String arg) {
- // We want to handle program args as key/value pairs subsequently
- // a key MUST start with a "-", all other args are ignored. For
- // backwards compatibility we remove all program args until the
- // next program arg key
- // (see bug 253862)
- if (!arg.startsWith("-"))
- return;
-
- int index = programArgs.indexOf(arg);
- if (index == -1)
- return;
-
- programArgs.remove(index);
- while (index < programArgs.size()) {
- String next = (String) programArgs.get(index);
- if (next.charAt(0) == '-')
- return;
- programArgs.remove(index);
- }
- }
-
- public void setFwConfigLocation(File fwConfigLocation) {
- this.fwConfigLocation = fwConfigLocation;
- }
-
- public void setFwJar(File fwJar) {
- this.fwJar = fwJar;
- }
-
- public void setFwPersistentDataLocation(File fwPersistentDataLocation, boolean clean) {
- this.fwPersistentDataLocation = fwPersistentDataLocation;
- this.clean = clean;
- }
-
- public void setHome(File home) {
- this.home = home;
- }
-
- public void setJvm(File file) {
- this.jvm = file;
- }
-
- public void setJvmArgs(String[] args) {
- if (args == null || args.length == 0) {
- jvmArgs.clear();
- return;
- }
- for (int i = 0; i < args.length; i++)
- this.addJvmArg(args[i]);
- }
-
- public void setLauncher(File launcherFile) {
- launcher = launcherFile;
- }
-
- public void setLauncherConfigLocation(File launcherConfigLocation) {
- this.launcherConfigLocation = launcherConfigLocation;
- }
-
- public void setOS(String os) {
- this.os = os;
- }
-
- public String getOS() {
- return os;
- }
-
- public void setProgramArgs(String[] args) {
- if (args == null || args.length == 0) {
- programArgs.clear();
- return;
- }
- for (int i = 0; i < args.length; i++)
- this.addProgramArg(args[i]);
- }
-
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("Class:" + this.getClass().getName() + "\n");
- sb.append("fwName=" + this.fwName + "\n");
- sb.append("fwVersion=" + this.fwVersion + "\n");
- sb.append("launcherName=" + this.launcherName + "\n");
- sb.append("launcherVersion=" + this.launcherVersion + "\n");
-
- sb.append("jvm=" + this.jvm + "\n");
- if (this.jvmArgs.size() == 0)
- sb.append("jvmArgs = null\n");
- else {
- sb.append("jvmArgs=\n");
- int i = 0;
- for (Iterator iterator = jvmArgs.iterator(); iterator.hasNext(); iterator.next())
- sb.append("\tjvmArgs[" + i++ + "]=" + iterator + "\n");
-
- }
- if (this.programArgs.size() == 0)
- sb.append("programArgs = null\n");
- else {
- sb.append("programArgs=\n");
- int i = 0;
- for (Iterator iterator = programArgs.iterator(); iterator.hasNext(); iterator.next())
- sb.append("\tprogramArgs[" + i++ + "]=" + iterator + "\n");
- }
- sb.append("fwConfigLocation=" + this.fwConfigLocation + "\n");
- sb.append("fwJar=" + this.fwJar + "\n");
- sb.append("fwPersistentDataLocation=" + this.fwPersistentDataLocation + "\n");
- sb.append("home=" + this.home + "\n");
- sb.append("launcher=" + this.launcher + "\n");
- sb.append("launcherConfigLocation=" + this.launcherConfigLocation + "\n");
- sb.append("clean=" + this.isClean() + "\n");
-
- return sb.toString();
- }
-}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/Manipulator.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/Manipulator.java
deleted file mode 100644
index 4159132..0000000
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/Manipulator.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * 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.provisional.frameworkadmin;
-
-import java.io.File;
-import java.io.IOException;
-import org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulator;
-
-/**
- * A manipulator is used to query and modify the state of a framework instance.
- * A manipulator instance is obtained by calling {@link FrameworkAdmin#getManipulator()}.
- *
- * The typical use-cases of this interface:
- *
- * Usecase 1: set parameters, check the expected state, save them into configuration files, and launch.
- * A. create a {@link Manipulator} object from a {@link FrameworkAdmin}.
- * B. set parameters to the {@link Manipulator} object.
- * C. getExpectedState() and check what bundle state will be realized.
- * If it is not same as you desire, repeat B and C until it becomes as you desire.
- * D. save parameters into configuration files by {@link Manipulator#save(boolean)}.
- * E. launch the framework by {@link FrameworkAdmin#launch(Manipulator, File)}.
- *
- * Usecase 2: set parameters required for loading, load parameters from configuration files,
- * check the expected state, and launch.
- * A. create a {@link Manipulator} object from a {@link FrameworkAdmin}.
- * B. set parameters about launcher or framework configuration file to the {@link Manipulator} object.
- * C. load parameters from configuration files by {@link Manipulator#load()};
- * D. getExpectedState() and check what bundle state will be realized.
- * E. launch the framework by {@link FrameworkAdmin#launch(Manipulator, File)}.
- * @see FrameworkAdmin
- * @see ConfigData
- * @see LauncherData
- */
-public interface Manipulator {
-
- /**
- * Return the newly created BundldsState object,
- * according to the parameters set to this object "in memory".
- *
- * None of launcher config file, framework config file and configurator config file
- * will be read by this method. However, the framework persistent data location should be
- * taken into consideration. In other words, this method will return
- * the expected {@link BundlesState} object assuming that the current parameters were saved and
- * {@link FrameworkAdmin#launch(Manipulator, File)} with an argument of this object
- * were called. (It would read the framework persistent data location if required).
- *
- * This method should not modify the parameters in this {@link Manipulator} object.
- *
- * @return framework bundle state object created according to he current parameters set.
- * @throws FrameworkAdminRuntimeException - If the {@link FrameworkAdmin} service created this object is unregistered or this implementation doesn't support this method.
- */
- BundlesState getBundlesState() throws FrameworkAdminRuntimeException;
-
- /**
- * The reference of {@link ConfigData} object representing configuration information related with framework settings will be returned.
- * Remind that manipulating returned object will affect this Manipulator behavior.
- *
- * @return ConfigData object representing configuration information related with framework setting
- * @throws FrameworkAdminRuntimeException - If the {@link FrameworkAdmin} service created this object is unregistered or this implementation doesn't support this method.
- * @see ConfigData
- */
- ConfigData getConfigData() throws FrameworkAdminRuntimeException;
-
- /**
- * Return the expected BundleInfo array representing state of bundles,
- * according to the parameters set to this object "in memory".
- *
- * None of launcher config file, framework config file and configurator config file
- * will be read by this method. However, the framework persistent data location should be
- * taken into consideration. In other words, this method will return
- * the expected bundles state assuming that the current parameters were saved and
- * {@link FrameworkAdmin#launch(Manipulator, File)} with an argument of this object
- * were called. (It would read the framework persistent data location if required).
- *
- * Returned BundleInfos must have resolved flag set.
- * This method should not modify the parameters in this {@link Manipulator} object.
- *
- * cf. getConfigData().getBundles() will return array of BundleInfo too.
- * However the resolved flag of returned BundleInfos might not be reliable.
- *
- * This method is equivalent to calling getBundlesState().getExpectedState().
- *
- * @return array of BundleInfo representing expected state of all bundles installed.
- * @throws IllegalArgumentException - If either of fwJar or cwd doesn't exist.
- * @throws IOException - If reading fw configuration file or reading persistently recorded information
- * of fw fails.
- * @throws FrameworkAdminRuntimeException - If the {@link FrameworkAdmin} service created this object is unregistered or this implementation doesn't support this method.
- */
- BundleInfo[] getExpectedState() throws IllegalStateException, IOException, FrameworkAdminRuntimeException;
-
- /**
- * The reference of {@link LauncherData} object representing configuration information
- * related with launcher settings will be returned.
- * Remember that manipulating returned object will affect this Manipulator object behavior.
- *
- * @return LauncherData object representing configuration information related with launcher setting
- * @throws FrameworkAdminRuntimeException - If the ManipulatorAdmin service created this object is unregistered or this implementation doesn't support this method.
- * @see LauncherData
- */
- LauncherData getLauncherData() throws FrameworkAdminRuntimeException;
-
- /**
- * Return timestamp of configurations which will be loaded by load() method
- * according to the parameters set to this manipulator in long value.
- *
- * This method will check last modified time of all launcher configuration file, framework configuration file,
- * and framework persistent storage according to the parameters set.
- * @return
- */
- long getTimeStamp();
-
- /**
- * Initialize all information that this object keeps at that time.
- */
- void initialize();
-
- /**
- * load configs from appropriate config files,
- * including launcher config file, fw config file, and configurator config files,
- * whose locations are determined by the current setting. In addition,
- * the fw persistent data location should be taken into consideration.
- *
- * The following procedure contains the matters of implementation detail.
- * However, it is an example how it works.
- *
- * 1. if launcher object is set, corresponding launcher config file will be read.
- * According to the information retrieved, setting of this object will be updated.
- * including fw config file.
- *
- * 2. If fw config file is not specified, IllegalStateException will be thrown.
- * Otherwise, the information will be retrieved from the fw config file.
- *
- * 3. If any ConfiguratorBundle is included in the bundle list,
- * read appropriate configurator config file by
- * {@link ConfiguratorManipulator#updateBundles(Manipulator)},
- * which will update the parameter about installed bundles in its
- * {@link Manipulator#getConfigData()} object.
- *
- * Most old parameters will be updated by this method call.
- *
- * @throws IOException - If reading info from configuration files fails.
- * @throws IllegalStateException - If config files cannot be determined.
- * @throws FrameworkAdminRuntimeException - If the {@link FrameworkAdmin} service created this object is unregistered or this implementation doesn't support this method.
- */
- void load() throws IllegalStateException, IOException, FrameworkAdminRuntimeException;
-
- /**
- * Save parameters that this object keeps at that time into appropriate configuration files,
- * which include launcher configuration file, framework configuration file, and configurator configuration files
- * (if required and implementation of this object supports), according to the current setting and situation.
- *
- * The following procedure contains the matters of implementation detail.
- * However, it is an example how it works.
- *
- * 1. if a launcher file is set,
- * the parameters to be saved into a LauncherConfigFile will be saved into the default LauncherConfigFile
- * that is determined by the location of the launcher file.
- *
- *
- * 2. if there are any {@link ConfiguratorManipulator} objects available whose corresponding ConfiguratorBundle
- * is set to be started, choose the ConfiguratorBudnle that starts the first among them and go to next step.
- * Otherwise, save the BundleInfo[] set to this object into a FwConfigFile that is determined
- * by the parameters set.
- *
- * 3. call {@link ConfiguratorManipulator#save(Manipulator, boolean)} of
- * the ConfiguratorManipulator that can manipulate the chosen ConfiguratorBudnle.
- * This method will save configurations for ConfiguratorBundle to read appropriately
- * and return BundleInfo[] to be saved in the FwConfigFile, which is determined by the parameters set.
- *
- * 4. Save the returned BundleInfo[] in the FwConfigFile, which is determined by the parameters set.
- *
- * @param backup - if true, keep old file by renaming if exists.
- * @throws IOException - If writing info into configuration files fails.
- * @throws FrameworkAdminRuntimeException - If the {@link FrameworkAdmin} service created this object is unregistered or this implementation doesn't support this method.
- */
- void save(boolean backup) throws IOException, FrameworkAdminRuntimeException;
-
- /**
- * Copy all information the specified {@link ConfigData} contains into this object.
- * All of old settings will be initialized and replaced.
- *
- * @param configData fw config data to be set to this object.
- */
- void setConfigData(ConfigData configData);
-
- /**
- * Copy all information the specified {@link LauncherData} contains into this object.
- * All of old settings will be initialized and replaced.
- *
- * @param launcherData launcher config data to be set to this object.
- */
- void setLauncherData(LauncherData launcherData);
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.classpath b/bundles/org.eclipse.equinox.p2.ql/.classpath
similarity index 95%
rename from examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.classpath
rename to bundles/org.eclipse.equinox.p2.ql/.classpath
index 64c5e31..2fbb7a2 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.classpath
+++ b/bundles/org.eclipse.equinox.p2.ql/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/.project b/bundles/org.eclipse.equinox.p2.ql/.project
similarity index 93%
rename from bundles/org.eclipse.equinox.frameworkadmin/.project
rename to bundles/org.eclipse.equinox.p2.ql/.project
index 20c6cbd..6140e1b 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin/.project
+++ b/bundles/org.eclipse.equinox.p2.ql/.project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.equinox.frameworkadmin</name>
+ <name>org.eclipse.equinox.p2.ql</name>
<comment></comment>
<projects>
</projects>
@@ -27,8 +27,8 @@
</buildCommand>
</buildSpec>
<natures>
- <nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/bundles/org.eclipse.equinox.p2.ql/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.equinox.p2.ql/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..b069b3c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Thu Nov 12 08:11:03 CET 2009
+eclipse.preferences.version=1
+encoding//model/p2ql.ecorediag=UTF-8
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.ql/.settings/org.eclipse.jdt.core.prefs
similarity index 98%
rename from bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.core.prefs
rename to bundles/org.eclipse.equinox.p2.ql/.settings/org.eclipse.jdt.core.prefs
index acf51d1..c8a5bb1 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.ql/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Mon Oct 20 11:38:02 EDT 2008
+#Sun Dec 06 23:10:54 EST 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -20,10 +20,11 @@
org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
@@ -49,11 +50,12 @@
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
@@ -79,7 +81,7 @@
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=error
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
@@ -159,7 +161,6 @@
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.p2.ql/.settings/org.eclipse.jdt.ui.prefs
similarity index 98%
rename from bundles/org.eclipse.equinox.frameworkadmin.equinox/.settings/org.eclipse.jdt.ui.prefs
rename to bundles/org.eclipse.equinox.p2.ql/.settings/org.eclipse.jdt.ui.prefs
index ad9b6dd..014501b 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/.settings/org.eclipse.jdt.ui.prefs
+++ b/bundles/org.eclipse.equinox.p2.ql/.settings/org.eclipse.jdt.ui.prefs
@@ -1,4 +1,4 @@
-#Sun Sep 23 11:57:33 EDT 2007
+#Sun Sep 23 11:57:54 EDT 2007
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_core
diff --git a/bundles/org.eclipse.equinox.p2.ql/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.ql/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..946ba90
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.equinox.p2.ql;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.4,
+ CDC-1.1/Foundation-1.1
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.equinox.internal.p2.metadata,
+ org.eclipse.equinox.internal.provisional.p2.metadata,
+ org.eclipse.equinox.internal.provisional.p2.metadata.query,
+ org.eclipse.equinox.p2.metadata,
+ org.eclipse.equinox.p2.metadata.query,
+ org.eclipse.equinox.p2.repository.artifact,
+ org.osgi.framework
+Export-Package: org.eclipse.equinox.internal.p2.ql.expression;x-internal:=true,
+ org.eclipse.equinox.p2.ql
+Bundle-Activator: org.eclipse.equinox.internal.p2.ql.QLActivator
+Require-Bundle: org.eclipse.equinox.common;bundle-version="3.5.1",
+ org.eclipse.equinox.p2.common
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/about.html b/bundles/org.eclipse.equinox.p2.ql/about.html
similarity index 100%
rename from bundles/org.eclipse.equinox.frameworkadmin/about.html
rename to bundles/org.eclipse.equinox.p2.ql/about.html
diff --git a/bundles/org.eclipse.equinox.p2.ql/build.properties b/bundles/org.eclipse.equinox.p2.ql/build.properties
new file mode 100644
index 0000000..230777f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/build.properties
@@ -0,0 +1,15 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+bin.includes = .,\
+ META-INF/,\
+ plugin.properties,\
+ about.html
+jars.compile.order = .
+source.. = src/
+output.. = bin/
+src.includes = about.html,\
+ model/
diff --git a/bundles/org.eclipse.equinox.p2.ql/model/p2ql.bnf b/bundles/org.eclipse.equinox.p2.ql/model/p2ql.bnf
new file mode 100644
index 0000000..476f541
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/model/p2ql.bnf
@@ -0,0 +1,67 @@
+condition
+ : orExpression ( '?' orExpression ':' orExpression )?
+ ;
+
+orExpression : andExpression ( '||' andExpression )* ;
+
+andExpression : binaryExpression ( '&&' binaryExpression )* ;
+
+binaryExpression : notExpression ( op notExpression )?;
+
+op : '=' | '!=' | '>' | '>=' | '<' | '<=' | '~=' ;
+
+notExpression
+ : '!' notExpression
+ | collectionExpression
+ ;
+
+collectionExpression
+ : memberExpression ( '.' collectionFunction )*
+ ;
+
+memberExpression : constructor ( ( '.' ID ) | ( '[' memberExpression ']' ) )* ;
+
+constructor
+ : ( filter | version | range | class ) '(' unaryExpression ')'
+ | set '(' ( collectionExpression ( ',' collectionExpression )* )? ')'
+ | unaryExpression
+ ;
+
+collectionFunction
+ : ( select | reject | exists | all | traverse ) '(' lambdaDefinition ')'
+ | limit '(' memberExpression ')'
+ | unique '(' memberExpression? ')'
+ | latest '(' lambdaDefinition? ')'
+ ;
+
+lambdaDefinition
+ : initializer ( ',' initializer )* ( ',' '{' lambda '}' )?
+ | '{' lambda '}'
+ | lambda
+ ;
+
+initializer
+ : '_'
+ | condition
+ ;
+
+lambda
+ : ( ID ( ',' ID )* )? '|' condition
+ ;
+
+unaryExpression
+ : '(' condition ')'
+ | '[' condition ( ',' condition )* ']' // #array construct
+ | '/' regexpPattern '/'
+ | STRING
+ | INT
+ | parameter
+ | 'null'
+ | 'true'
+ | 'false'
+ | ID
+ ;
+
+parameter
+ : '$' INT | ID
+ ;
diff --git a/bundles/org.eclipse.equinox.p2.ql/plugin.properties b/bundles/org.eclipse.equinox.p2.ql/plugin.properties
new file mode 100644
index 0000000..3223d0e
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/plugin.properties
@@ -0,0 +1,8 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+pluginName = P2ql Model
+providerName = www.example.org
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/CapabilityIndex.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/CapabilityIndex.java
new file mode 100644
index 0000000..f39aa62
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/CapabilityIndex.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql;
+
+import java.util.*;
+import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
+import org.eclipse.equinox.internal.provisional.p2.metadata.IProvidedCapability;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.ql.ICapabilityIndex;
+
+/**
+ * An in-memory implementation of a CapabilityIndex based on a Map.
+ */
+public class CapabilityIndex implements ICapabilityIndex {
+
+ private final Map capabilityMap;
+
+ private static class IUCapability {
+ final IInstallableUnit iu;
+ final IProvidedCapability capability;
+
+ IUCapability(IInstallableUnit iu, IProvidedCapability capability) {
+ this.iu = iu;
+ this.capability = capability;
+ }
+ }
+
+ public CapabilityIndex(Iterator itor) {
+ HashMap index = new HashMap();
+ while (itor.hasNext()) {
+ IInstallableUnit iu = (IInstallableUnit) itor.next();
+ IProvidedCapability[] pcs = iu.getProvidedCapabilities();
+ int idx = pcs.length;
+ while (--idx >= 0) {
+ IProvidedCapability pc = pcs[idx];
+ IUCapability iuCap = new IUCapability(iu, pc);
+ String name = pc.getName();
+ Object prev = index.put(name, iuCap);
+ if (prev != null) {
+ ArrayList lst;
+ if (prev instanceof ArrayList)
+ lst = (ArrayList) prev;
+ else {
+ lst = new ArrayList(4);
+ lst.add(prev);
+ }
+ lst.add(iuCap);
+ index.put(name, lst);
+ }
+ }
+ }
+ this.capabilityMap = index;
+ }
+
+ public Iterator satisfiesAny(Iterator requirements) {
+ if (!requirements.hasNext())
+ return Collections.EMPTY_LIST.iterator();
+
+ List collector = new ArrayList();
+ do {
+ Object nxt = requirements.next();
+ if (!(nxt instanceof IRequiredCapability))
+ throw new IllegalArgumentException();
+ collectMatchingIUs((IRequiredCapability) nxt, collector);
+ } while (requirements.hasNext());
+ return collector.iterator();
+ }
+
+ public Iterator satisfiesAll(Iterator requirements) {
+ if (!requirements.hasNext())
+ return Collections.EMPTY_LIST.iterator();
+
+ Set collector = new HashSet();
+ Object nxt = requirements.next();
+ if (!(nxt instanceof IRequiredCapability))
+ throw new IllegalArgumentException();
+ collectMatchingIUs((IRequiredCapability) nxt, collector);
+
+ while (requirements.hasNext() && !collector.isEmpty()) {
+ nxt = requirements.next();
+ if (!(nxt instanceof IRequiredCapability))
+ throw new IllegalArgumentException();
+ collector = retainMatchingIUs((IRequiredCapability) nxt, collector);
+ }
+ return collector.iterator();
+ }
+
+ private void collectMatchingIUs(IRequiredCapability rc, Collection collector) {
+ Object v = capabilityMap.get(rc.getName());
+ if (v == null)
+ return;
+
+ if (v instanceof IUCapability) {
+ IUCapability iuc = (IUCapability) v;
+ if (rc.satisfiedBy(iuc.capability))
+ collector.add(iuc.iu);
+ } else {
+ List iucs = (List) v;
+ int idx = iucs.size();
+ while (--idx >= 0) {
+ IUCapability iuc = (IUCapability) iucs.get(idx);
+ if (rc.satisfiedBy(iuc.capability))
+ collector.add(iuc.iu);
+ }
+ }
+ }
+
+ private Set retainMatchingIUs(IRequiredCapability rc, Set collector) {
+ Object v = capabilityMap.get(rc.getName());
+ if (v == null)
+ return Collections.EMPTY_SET;
+
+ Set retained = null;
+ if (v instanceof IUCapability) {
+ IUCapability iuc = (IUCapability) v;
+ if (rc.satisfiedBy(iuc.capability) && collector.contains(iuc.iu)) {
+ if (retained == null)
+ retained = new HashSet();
+ retained.add(iuc.iu);
+ }
+ } else {
+ List iucs = (List) v;
+ int idx = iucs.size();
+ while (--idx >= 0) {
+ IUCapability iuc = (IUCapability) iucs.get(idx);
+ if (rc.satisfiedBy(iuc.capability) && collector.contains(iuc.iu)) {
+ if (retained == null)
+ retained = new HashSet();
+ retained.add(iuc.iu);
+ }
+ }
+ }
+ return retained == null ? Collections.EMPTY_SET : retained;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/Everything.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/Everything.java
new file mode 100644
index 0000000..382e903
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/Everything.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql;
+
+import java.util.*;
+
+/**
+ * The immutable context used when evaluating an expression.
+ */
+public final class Everything extends MatchIteratorFilter implements IRepeatableIterator {
+ private boolean atStart = true;
+
+ private final Class elementClass;
+
+ public Everything(Class elementClass, Collection collection) {
+ super(RepeatableIterator.create(collection == null ? Collections.EMPTY_LIST : collection));
+ this.elementClass = elementClass;
+ }
+
+ public Everything(Class elementClass, Iterator iterator, boolean needsRepeat) {
+ super(needsRepeat ? RepeatableIterator.create(iterator) : iterator);
+ this.elementClass = elementClass;
+ }
+
+ public IRepeatableIterator getCopy() {
+ Iterator iterator = getInnerIterator();
+ if (iterator instanceof IRepeatableIterator)
+ return new Everything(elementClass, ((IRepeatableIterator) iterator).getCopy(), false);
+ if (atStart)
+ return this;
+ throw new UnsupportedOperationException();
+ }
+
+ public Object next() {
+ atStart = false;
+ return super.next();
+ }
+
+ public Object getIteratorProvider() {
+ Iterator iterator = getInnerIterator();
+ if (iterator instanceof IRepeatableIterator)
+ return ((IRepeatableIterator) iterator).getIteratorProvider();
+ return this;
+ }
+
+ protected boolean isMatch(Object val) {
+ return elementClass.isInstance(val);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/FlattenIterator.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/FlattenIterator.java
new file mode 100644
index 0000000..e2d659b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/FlattenIterator.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * A FlattenIterator will assume that its operand is an iterator that will produce
+ * elements that can be represented as iterators. The elements of those iterators
+ * will be returned in sequence, thus removing one iterator dimension.
+ */
+public class FlattenIterator implements Iterator {
+ private static final Object NO_ELEMENT = new Object();
+ private final Iterator iteratorIterator;
+ private Iterator currentIterator;
+
+ private Object nextObject = NO_ELEMENT;
+
+ public FlattenIterator(Iterator iterator) {
+ this.iteratorIterator = iterator;
+ }
+
+ public boolean hasNext() {
+ return positionNext();
+ }
+
+ public Object next() {
+ if (!positionNext())
+ throw new NoSuchElementException();
+
+ Object nxt = nextObject;
+ nextObject = NO_ELEMENT;
+ return nxt;
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ private boolean positionNext() {
+ if (nextObject != NO_ELEMENT)
+ return true;
+
+ while (currentIterator == null || !currentIterator.hasNext()) {
+ if (!iteratorIterator.hasNext())
+ return false;
+
+ Object nextItor = iteratorIterator.next();
+ currentIterator = (nextItor instanceof Iterator) ? (Iterator) nextItor : RepeatableIterator.create(nextItor);
+ }
+ nextObject = currentIterator.next();
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/IRepeatableIterator.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/IRepeatableIterator.java
new file mode 100644
index 0000000..7190c24
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/IRepeatableIterator.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql;
+
+import java.util.Iterator;
+
+public interface IRepeatableIterator extends Iterator {
+ /**
+ * Returns a copy that will iterate over the same elements
+ * as this iterator. The contents or position of this iterator
+ * is left unchanged.
+ * @return A re-initialized copy of this iterator.
+ */
+ IRepeatableIterator getCopy();
+
+ Object getIteratorProvider();
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/MatchIteratorFilter.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/MatchIteratorFilter.java
new file mode 100644
index 0000000..684fdc5
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/MatchIteratorFilter.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * An iterator filter using a boolean {@link #isMatch(Object)} method.
+ */
+public abstract class MatchIteratorFilter implements Iterator {
+ private static final Object NO_ELEMENT = new Object();
+
+ private final Iterator innerIterator;
+
+ private Object nextObject = NO_ELEMENT;
+
+ public MatchIteratorFilter(Iterator iterator) {
+ this.innerIterator = iterator;
+ }
+
+ public boolean hasNext() {
+ return positionNext();
+ }
+
+ public Object next() {
+ if (!positionNext())
+ throw new NoSuchElementException();
+
+ Object nxt = nextObject;
+ nextObject = NO_ELEMENT;
+ return nxt;
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ protected Iterator getInnerIterator() {
+ return innerIterator;
+ }
+
+ protected abstract boolean isMatch(Object val);
+
+ private boolean positionNext() {
+ if (nextObject != NO_ELEMENT)
+ return true;
+
+ while (innerIterator.hasNext()) {
+ Object nxt = innerIterator.next();
+ if (isMatch(nxt)) {
+ nextObject = nxt;
+ return true;
+ }
+ }
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/MultiVariableContext.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/MultiVariableContext.java
new file mode 100644
index 0000000..38bb1c0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/MultiVariableContext.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql;
+
+import org.eclipse.equinox.p2.ql.IExpression;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+public final class MultiVariableContext implements IEvaluationContext {
+ private final IEvaluationContext parentContext;
+
+ private final Object[] values;
+
+ public MultiVariableContext(IEvaluationContext parentContext, IExpression[] variables) {
+ this.parentContext = parentContext;
+ values = new Object[variables.length * 2];
+ for (int idx = 0, ndx = 0; ndx < variables.length; ++ndx, idx += 2)
+ values[idx] = variables[ndx];
+ }
+
+ public Object getParameter(int position) {
+ return parentContext.getParameter(position);
+ }
+
+ public Object getParameter(String key) {
+ return parentContext.getParameter(key);
+ }
+
+ public Object getValue(IExpression variable) {
+ for (int idx = 0; idx < values.length; ++idx)
+ if (values[idx++] == variable)
+ return values[idx];
+ return parentContext.getValue(variable);
+ }
+
+ public void setValue(IExpression variable, Object value) {
+ for (int idx = 0; idx < values.length; ++idx)
+ if (values[idx++] == variable) {
+ values[idx] = value;
+ return;
+ }
+ parentContext.setValue(variable, value);
+ }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/ParameterContext.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/ParameterContext.java
new file mode 100644
index 0000000..db16a17
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/ParameterContext.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql;
+
+import java.util.Map;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+import org.eclipse.equinox.p2.ql.IExpression;
+
+/**
+ * The immutable top level context used when evaluating an expression.
+ */
+public final class ParameterContext implements IEvaluationContext {
+ private static final Object[] noParameters = new Object[0];
+
+ private final Object[] parameters;
+
+ public ParameterContext(Object[] parameters) {
+ this.parameters = parameters == null ? noParameters : parameters;
+ }
+
+ public Object getParameter(int position) {
+ return parameters[position];
+ }
+
+ public Object getParameter(String key) {
+ return parameters.length == 1 && parameters[0] instanceof Map ? ((Map) parameters[0]).get(key) : null;
+ }
+
+ public Object getValue(IExpression variable) {
+ throw new IllegalArgumentException("No such variable: " + variable); //$NON-NLS-1$
+ }
+
+ public void setValue(IExpression variable, Object value) {
+ throw new IllegalArgumentException("No such variable: " + variable); //$NON-NLS-1$
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/QLActivator.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/QLActivator.java
new file mode 100644
index 0000000..d1fc901
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/QLActivator.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class QLActivator implements BundleActivator {
+ public static BundleContext context;
+
+ public static BundleContext getContext() {
+ return context;
+ }
+
+ public void start(BundleContext aContext) throws Exception {
+ QLActivator.context = aContext;
+ }
+
+ public void stop(BundleContext aContext) throws Exception {
+ QLActivator.context = null;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/QueryContext.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/QueryContext.java
new file mode 100644
index 0000000..515c1d7
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/QueryContext.java
@@ -0,0 +1,54 @@
+package org.eclipse.equinox.internal.p2.ql;
+
+import java.util.*;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
+import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.ql.IQueryContext;
+import org.eclipse.equinox.p2.ql.ITranslationSupport;
+
+public class QueryContext implements IQueryContext {
+
+ private final IQueryable queryable;
+
+ private Map translationSupports;
+
+ public QueryContext(IQueryable queryable) {
+ this.queryable = queryable;
+ }
+
+ public QueryContext(Iterator iterator) {
+ final IRepeatableIterator repeatable = RepeatableIterator.create(iterator);
+ this.queryable = new IQueryable() {
+ public Collector query(IQuery query, IProgressMonitor monitor) {
+ return query.perform(repeatable.getCopy(), new Collector());
+ }
+ };
+ }
+
+ public synchronized ITranslationSupport getTranslationSupport(Locale locale) {
+ if (translationSupports == null)
+ translationSupports = new HashMap();
+
+ TranslationSupport ts = (TranslationSupport) translationSupports.get(locale);
+ if (ts == null) {
+ ts = new TranslationSupport();
+ ts.setTranslationSource(queryable);
+ ts.setLocale(locale);
+ translationSupports.put(locale, ts);
+ }
+ return ts;
+ }
+
+ public Iterator iterator() {
+ final Iterator[] iteratorCatcher = new Iterator[1];
+ queryable.query(new ContextQuery() {
+ public Collector perform(Iterator iterator, Collector result) {
+ iteratorCatcher[0] = iterator;
+ return null;
+ }
+ }, new NullProgressMonitor());
+ return iteratorCatcher[0];
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/RepeatableIterator.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/RepeatableIterator.java
new file mode 100644
index 0000000..e1419e9
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/RepeatableIterator.java
@@ -0,0 +1,236 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql;
+
+import java.util.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
+
+public class RepeatableIterator implements IRepeatableIterator {
+ private final List values;
+ private int position = -1;
+
+ public static IRepeatableIterator create(Object unknown) {
+ if (unknown.getClass().isArray())
+ return create((Object[]) unknown);
+ if (unknown instanceof Iterator)
+ return create((Iterator) unknown);
+ if (unknown instanceof List)
+ return create((List) unknown);
+ if (unknown instanceof Collection)
+ return create((Collection) unknown);
+ if (unknown instanceof Map)
+ return create(((Map) unknown).entrySet());
+ if (unknown instanceof Collector)
+ return create((Collector) unknown);
+ throw new IllegalArgumentException("Cannot convert a " + unknown.getClass().getName() + " into an iterator"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public static IRepeatableIterator create(Iterator iterator) {
+ return iterator instanceof IRepeatableIterator ? ((IRepeatableIterator) iterator).getCopy() : new ElementRetainingIterator(iterator);
+ }
+
+ public static IRepeatableIterator create(List values) {
+ return new RepeatableIterator(values);
+ }
+
+ public static IRepeatableIterator create(Collection values) {
+ return new CollectionIterator(values);
+ }
+
+ public static IRepeatableIterator create(Collector values) {
+ return new CollectorIterator(values);
+ }
+
+ public static IRepeatableIterator create(Object[] values) {
+ return new ArrayIterator(values);
+ }
+
+ RepeatableIterator(List values) {
+ this.values = values;
+ }
+
+ public IRepeatableIterator getCopy() {
+ return new RepeatableIterator(values);
+ }
+
+ public boolean hasNext() {
+ return position + 1 < values.size();
+ }
+
+ public Object next() {
+ if (++position == values.size()) {
+ --position;
+ throw new NoSuchElementException();
+ }
+ return values.get(position);
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object getIteratorProvider() {
+ return values;
+ }
+
+ void setPosition(int position) {
+ this.position = position;
+ }
+
+ List getValues() {
+ return values;
+ }
+
+ static class ArrayIterator implements IRepeatableIterator {
+ private final Object[] array;
+ private int position = -1;
+
+ public ArrayIterator(Object[] array) {
+ this.array = array;
+ }
+
+ public Object getIteratorProvider() {
+ return array;
+ }
+
+ public boolean hasNext() {
+ return position + 1 < array.length;
+ }
+
+ public Object next() {
+ if (++position >= array.length)
+ throw new NoSuchElementException();
+ return array[position];
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ public IRepeatableIterator getCopy() {
+ return new ArrayIterator(array);
+ }
+ }
+
+ static class CollectionIterator implements IRepeatableIterator {
+ private final Collection collection;
+
+ private final Iterator iterator;
+
+ CollectionIterator(Collection collection) {
+ this.collection = collection;
+ this.iterator = collection.iterator();
+ }
+
+ public IRepeatableIterator getCopy() {
+ return new CollectionIterator(collection);
+ }
+
+ public Object getIteratorProvider() {
+ return collection;
+ }
+
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ public Object next() {
+ return iterator.next();
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ static class CollectorIterator implements IRepeatableIterator {
+ private final Collector collector;
+
+ private final Iterator iterator;
+
+ CollectorIterator(Collector collector) {
+ this.collector = collector;
+ this.iterator = collector.iterator();
+ }
+
+ public IRepeatableIterator getCopy() {
+ return new CollectorIterator(collector);
+ }
+
+ public Object getIteratorProvider() {
+ return collector;
+ }
+
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ public Object next() {
+ return iterator.next();
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ static class ElementRetainingIterator extends RepeatableIterator {
+
+ private Iterator innerIterator;
+
+ ElementRetainingIterator(Iterator iterator) {
+ super(new ArrayList());
+ innerIterator = iterator;
+ }
+
+ public synchronized boolean hasNext() {
+ if (innerIterator != null) {
+ if (innerIterator.hasNext())
+ return true;
+ innerIterator = null;
+ setPosition(getValues().size());
+ }
+ return super.hasNext();
+ }
+
+ public synchronized Object next() {
+ if (innerIterator != null) {
+ Object val = innerIterator.next();
+ getValues().add(val);
+ return val;
+ }
+ return super.next();
+ }
+
+ public synchronized IRepeatableIterator getCopy() {
+ // If the current iterator still exists, we must exhaust it first
+ //
+ exhaustInnerIterator();
+ return super.getCopy();
+ }
+
+ public synchronized Object getIteratorProvider() {
+ exhaustInnerIterator();
+ return super.getIteratorProvider();
+ }
+
+ private void exhaustInnerIterator() {
+ if (innerIterator != null) {
+ List values = getValues();
+ int savePos = values.size() - 1;
+ while (innerIterator.hasNext())
+ values.add(innerIterator.next());
+ innerIterator = null;
+ setPosition(savePos);
+ }
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/SingleVariableContext.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/SingleVariableContext.java
new file mode 100644
index 0000000..7e77d58
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/SingleVariableContext.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql;
+
+import org.eclipse.equinox.p2.ql.IExpression;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+public final class SingleVariableContext implements IEvaluationContext {
+ private final IEvaluationContext parentContext;
+
+ private Object value;
+
+ private final IExpression variable;
+
+ public SingleVariableContext(IEvaluationContext parentContext, IExpression variable) {
+ this.parentContext = parentContext;
+ this.variable = variable;
+ }
+
+ public Object getParameter(int position) {
+ return parentContext.getParameter(position);
+ }
+
+ public Object getParameter(String key) {
+ return parentContext.getParameter(key);
+ }
+
+ public Object getValue(IExpression var) {
+ return variable == var ? value : parentContext.getValue(var);
+ }
+
+ public void setValue(IExpression var, Object val) {
+ if (variable == var)
+ value = val;
+ else
+ parentContext.setValue(var, val);
+ }
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/TranslationSupport.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/TranslationSupport.java
new file mode 100644
index 0000000..2eac137
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/TranslationSupport.java
@@ -0,0 +1,7 @@
+package org.eclipse.equinox.internal.p2.ql;
+
+import org.eclipse.equinox.p2.ql.ITranslationSupport;
+
+public class TranslationSupport extends org.eclipse.equinox.p2.common.TranslationSupport implements ITranslationSupport {
+ // The default implementation just uses the common TranslationSupport and adds nothing to the mix.
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/All.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/All.java
new file mode 100644
index 0000000..7378448
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/All.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * A collection filter that yields true if the <code>filter</code> yields true for
+ * all of the elements of the <code>collection</code>
+ */
+final class All extends CollectionFilter {
+ All(Expression collection, LambdaExpression lambda) {
+ super(collection, lambda);
+ }
+
+ public int getExpressionType() {
+ return TYPE_ALL;
+ }
+
+ Object evaluate(IEvaluationContext context, Iterator itor) {
+ Variable variable = lambda.getItemVariable();
+ while (itor.hasNext()) {
+ variable.setValue(context, itor.next());
+ if (lambda.evaluate(context) != Boolean.TRUE)
+ return Boolean.FALSE;
+ }
+ return Boolean.TRUE;
+ }
+
+ String getOperator() {
+ return KEYWORD_ALL;
+ }
+
+ boolean isBoolean() {
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/And.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/And.java
new file mode 100644
index 0000000..4ecf87e
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/And.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.*;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * n-ary AND operator. This operator evaluates its first operand and then checks
+ * the class of the result. If the class is {@link Boolean} then it is assumed
+ * that all other operands also evaluates to a boolean and the full evaluation is
+ * <code>true</code> if all its operands evaluate to <code>true</code>. If the first
+ * result was not of class {@link Boolean}, then it is assumed that it can be accessed
+ * as an {@link Iterator} and that all other operands also evaluates to something that
+ * can be accessed as an {@link Iterator}. The AND operator will then function as a
+ * INTERSECT operator and the result is the set of elements that were found in all operands.
+ */
+final class And extends NAry {
+ And(Expression[] operands) {
+ super(assertLength(operands, 2, OPERATOR_AND));
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ Object firstValue = operands[0].evaluate(context);
+
+ // Determine operation mode
+ if (firstValue instanceof Boolean) {
+ // The first value was boolean. Assume that the rest are too
+ if (!((Boolean) firstValue).booleanValue())
+ return Boolean.FALSE;
+
+ for (int idx = 1; idx < operands.length; ++idx) {
+ if (operands[idx].evaluate(context) != Boolean.TRUE)
+ return Boolean.FALSE;
+ }
+ return Boolean.TRUE;
+ }
+
+ // Not a boolean. Assume that we can use an iterator on all values
+ Set resultSet = asSet(firstValue, false); // Safe since it will not be modified
+ for (int idx = 1; idx < operands.length && !resultSet.isEmpty(); ++idx) {
+ Iterator itor = operands[idx].evaluateAsIterator(context);
+ Set retained = new HashSet();
+ while (itor.hasNext()) {
+ Object value = itor.next();
+ if (resultSet.contains(value))
+ retained.add(value);
+ }
+ resultSet = retained;
+ }
+ return resultSet;
+ }
+
+ public int getExpressionType() {
+ return TYPE_AND;
+ }
+
+ String getOperator() {
+ return OPERATOR_AND;
+ }
+
+ int getPriority() {
+ return PRIORITY_AND;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Array.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Array.java
new file mode 100644
index 0000000..0ec9005
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Array.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import org.eclipse.equinox.internal.p2.ql.parser.IParserConstants;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * An array of expressions
+ */
+final class Array extends NAry {
+ final class ArrayIterator implements Iterator {
+ private final IEvaluationContext context;
+
+ private int pos = -1;
+
+ public ArrayIterator(IEvaluationContext context) {
+ this.context = context;
+ }
+
+ public boolean hasNext() {
+ return pos + 1 < operands.length;
+ }
+
+ public Object next() {
+ if (++pos >= operands.length) {
+ --pos;
+ throw new NoSuchElementException();
+ }
+ return operands[pos].evaluate(context);
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ static void elementsToString(StringBuffer bld, Expression[] elements) {
+ int top = elements.length;
+ if (top > 0) {
+ elements[0].toString(bld);
+ for (int idx = 1; idx < top; ++idx) {
+ bld.append(", "); //$NON-NLS-1$
+ appendOperand(bld, elements[idx], PRIORITY_COMMA);
+ }
+ }
+ }
+
+ Array(Expression[] operands) {
+ super(assertLength(operands, 0, IParserConstants.OPERATOR_ARRAY));
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ return evaluateAsIterator(context);
+ }
+
+ public Iterator evaluateAsIterator(IEvaluationContext context) {
+ return new ArrayIterator(context);
+ }
+
+ public int getExpressionType() {
+ return TYPE_ARRAY;
+ }
+
+ public void toString(StringBuffer bld) {
+ bld.append('[');
+ elementsToString(bld, operands);
+ bld.append(']');
+ }
+
+ String getOperator() {
+ return IParserConstants.OPERATOR_ARRAY;
+ }
+
+ int getPriority() {
+ return PRIORITY_CONSTRUCTOR;
+ }
+
+ boolean isBoolean() {
+ return false;
+ }
+
+ boolean isCollection() {
+ return true;
+ }
+
+ boolean isElementBoolean() {
+ return super.isBoolean();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Assignment.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Assignment.java
new file mode 100644
index 0000000..23b69e8
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Assignment.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * An expression representing a variable stack in the current thread.
+ */
+class Assignment extends Binary {
+ Assignment(Variable variable, Expression expression) {
+ super(variable, expression);
+ }
+
+ public final Object evaluate(IEvaluationContext context) {
+ Object value = rhs.evaluate(context);
+ context.setValue(lhs, value);
+ return value;
+ }
+
+ public int getExpressionType() {
+ return TYPE_ASSIGNMENT;
+ }
+
+ int getPriority() {
+ return PRIORITY_ASSIGNMENT;
+ }
+
+ String getOperator() {
+ return OPERATOR_ASSIGN;
+ }
+
+ boolean isBoolean() {
+ return rhs.isBoolean();
+ }
+
+ boolean isCollection() {
+ return rhs.isCollection();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/At.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/At.java
new file mode 100644
index 0000000..f4ae700
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/At.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.*;
+import org.eclipse.equinox.internal.p2.ql.expression.Member.DynamicMember;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+import org.eclipse.equinox.p2.ql.ITranslationSupport;
+
+/**
+ * This class represents indexed or keyed access to an indexed collection
+ * or a map.
+ */
+final class At extends Binary {
+ At(Expression lhs, Expression rhs) {
+ super(lhs, rhs);
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ Object lval;
+ if (lhs instanceof DynamicMember) {
+ DynamicMember lm = (DynamicMember) lhs;
+ Object instance = lm.operand.evaluate(context);
+ if (instance instanceof IInstallableUnit) {
+ if ("properties".equals(lm.name)) //$NON-NLS-1$
+ // Avoid full copy of the properties map just to get one member
+ return ((IInstallableUnit) instance).getProperty((String) rhs.evaluate(context));
+
+ if (VARIABLE_TRANSLATIONS.equals(lm.name)) {
+ ITranslationSupport ts = (ITranslationSupport) Variable.TRANSLATIONS.evaluate(context);
+ return ts.getIUProperty((IInstallableUnit) instance, (String) rhs.evaluate(context));
+ }
+ }
+ lval = lm.invoke(instance);
+ } else
+ lval = lhs.evaluate(context);
+
+ Object rval = rhs.evaluate(context);
+ if (lval == null)
+ throw new IllegalArgumentException("Unable to use [] on null"); //$NON-NLS-1$
+
+ if (lval instanceof Map)
+ return ((Map) lval).get(rval);
+
+ if (rval instanceof Number) {
+ if (lval instanceof List)
+ return ((List) lval).get(((Number) rval).intValue());
+ if (lval != null && lval.getClass().isArray())
+ return ((Object[]) lval)[((Number) rval).intValue()];
+ }
+
+ if (lval instanceof Dictionary)
+ return ((Dictionary) lval).get(rval);
+
+ throw new IllegalArgumentException("Unable to use [] on a " + lval.getClass().getName()); //$NON-NLS-1$
+ }
+
+ public int getExpressionType() {
+ return TYPE_AT;
+ }
+
+ public void toString(StringBuffer bld) {
+ appendOperand(bld, lhs, getPriority());
+ bld.append('[');
+ appendOperand(bld, rhs, PRIORITY_COMMA);
+ bld.append(']');
+ }
+
+ String getOperator() {
+ return OPERATOR_AT;
+ }
+
+ int getPriority() {
+ return PRIORITY_MEMBER;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Binary.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Binary.java
new file mode 100644
index 0000000..ac17e0d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Binary.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.p2.ql.IExpressionVisitor;
+
+/**
+ * The abstract base class for all binary operations
+ */
+abstract class Binary extends Expression {
+ final Expression lhs;
+
+ final Expression rhs;
+
+ Binary(Expression lhs, Expression rhs) {
+ this.lhs = lhs;
+ this.rhs = rhs;
+ }
+
+ public boolean accept(IExpressionVisitor visitor) {
+ return super.accept(visitor) && lhs.accept(visitor) && rhs.accept(visitor);
+ }
+
+ public void toString(StringBuffer bld) {
+ appendOperand(bld, lhs, getPriority());
+ bld.append(' ');
+ bld.append(getOperator());
+ bld.append(' ');
+ appendOperand(bld, rhs, getPriority());
+ }
+
+ int countReferenceToEverything() {
+ return lhs.countReferenceToEverything() + rhs.countReferenceToEverything();
+ }
+
+ int getPriority() {
+ return PRIORITY_BINARY; // Default priority
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/BooleanFunction.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/BooleanFunction.java
new file mode 100644
index 0000000..10268eb
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/BooleanFunction.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+/**
+ * A function that obtains a class based on a String
+ */
+final class BooleanFunction extends Function {
+
+ public BooleanFunction(Expression[] operands) {
+ super(assertLength(operands, 1, 1, KEYWORD_BOOLEAN));
+ assertNotCollection(operands[0], "parameter"); //$NON-NLS-1$
+ }
+
+ boolean assertSingleArgumentClass(Object v) {
+ return v instanceof String || v instanceof Boolean;
+ }
+
+ Object createInstance(Object arg) {
+ if (arg instanceof String)
+ return Boolean.valueOf("true".equalsIgnoreCase((String) arg)); //$NON-NLS-1$
+ if (arg instanceof Boolean)
+ return arg;
+ return Boolean.FALSE;
+ }
+
+ String getOperator() {
+ return KEYWORD_BOOLEAN;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/CapabilityIndexFunction.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/CapabilityIndexFunction.java
new file mode 100644
index 0000000..bd01ae7
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/CapabilityIndexFunction.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.internal.p2.ql.CapabilityIndex;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * A function that creates a {@link CapabilityIndex} based on a collection of
+ * {@link IInstallableUnit} instances.
+ */
+final class CapabilityIndexFunction extends Function {
+
+ public CapabilityIndexFunction(Expression[] operands) {
+ super(assertLength(operands, 1, 1, KEYWORD_CAPABILITY_INDEX));
+ assertNotBoolean(operands[0], "parameter"); //$NON-NLS-1$
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ return new CapabilityIndex(operands[0].evaluateAsIterator(context));
+ }
+
+ String getOperator() {
+ return KEYWORD_CAPABILITY_INDEX;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/ClassFunction.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/ClassFunction.java
new file mode 100644
index 0000000..5fe40c0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/ClassFunction.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+/**
+ * A function that obtains a class based on a String
+ */
+final class ClassFunction extends Function {
+
+ public ClassFunction(Expression[] operands) {
+ super(assertLength(operands, 1, 1, KEYWORD_CLASS));
+ assertNotBoolean(operands[0], "parameter"); //$NON-NLS-1$
+ assertNotCollection(operands[0], "parameter"); //$NON-NLS-1$
+ }
+
+ boolean assertSingleArgumentClass(Object v) {
+ return v instanceof String;
+ }
+
+ Object createInstance(Object arg) {
+ try {
+ return Class.forName((String) arg);
+ } catch (ClassNotFoundException e) {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ String getOperator() {
+ return KEYWORD_CLASS;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Collect.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Collect.java
new file mode 100644
index 0000000..1e858bc
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Collect.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+import org.eclipse.equinox.p2.ql.IExpression;
+
+/**
+ */
+final class Collect extends CollectionFilter {
+ final class CollectIterator implements Iterator {
+ private final IEvaluationContext context;
+
+ private final IExpression variable;
+
+ private final Iterator innerIterator;
+
+ public CollectIterator(IEvaluationContext context, Iterator iterator) {
+ this.context = context;
+ this.variable = lambda.getItemVariable();
+ this.innerIterator = iterator;
+ }
+
+ public boolean hasNext() {
+ return innerIterator.hasNext();
+ }
+
+ public Object next() {
+ context.setValue(variable, innerIterator.next());
+ return lambda.evaluate(context);
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ Collect(Expression collection, LambdaExpression lambda) {
+ super(collection, lambda);
+ }
+
+ Object evaluate(IEvaluationContext context, Iterator itor) {
+ return evaluateAsIterator(context, itor);
+ }
+
+ Iterator evaluateAsIterator(IEvaluationContext context, Iterator itor) {
+ return new CollectIterator(context, itor);
+ }
+
+ public int getExpressionType() {
+ return TYPE_COLLECT;
+ }
+
+ String getOperator() {
+ return KEYWORD_COLLECT;
+ }
+
+ boolean isCollection() {
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/CollectionFilter.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/CollectionFilter.java
new file mode 100644
index 0000000..325f43f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/CollectionFilter.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+import org.eclipse.equinox.p2.ql.IExpressionVisitor;
+
+/**
+ * Some kind of operation that is performed for each element of a collection. I.e.
+ * <code>x.<operation>(y | <expression&rt;)</code>
+ */
+abstract class CollectionFilter extends Unary {
+ static void appendProlog(StringBuffer bld, Expression lhs, String operator) {
+ if (lhs != Variable.EVERYTHING && lhs != Variable.ITEM) {
+ appendOperand(bld, lhs, PRIORITY_COLLECTION);
+ bld.append('.');
+ }
+ bld.append(operator);
+ bld.append('(');
+ }
+
+ final LambdaExpression lambda;
+
+ CollectionFilter(Expression collection, LambdaExpression lambda) {
+ super(collection);
+ this.lambda = lambda;
+ }
+
+ public boolean accept(IExpressionVisitor visitor) {
+ return super.accept(visitor) && lambda.accept(visitor);
+ }
+
+ public final Object evaluate(IEvaluationContext context) {
+ Iterator lval = operand.evaluateAsIterator(context);
+ context = lambda.prolog(context);
+ return evaluate(context, lval);
+ }
+
+ public final Iterator evaluateAsIterator(IEvaluationContext context) {
+ Iterator lval = operand.evaluateAsIterator(context);
+ context = lambda.prolog(context);
+ return evaluateAsIterator(context, lval);
+ }
+
+ public void toString(StringBuffer bld) {
+ appendProlog(bld, operand, getOperator());
+ appendOperand(bld, lambda, PRIORITY_LAMBDA);
+ bld.append(')');
+ }
+
+ int countReferenceToEverything() {
+ return super.countReferenceToEverything() + lambda.countReferenceToEverything();
+ }
+
+ abstract Object evaluate(final IEvaluationContext context, Iterator iterator);
+
+ Iterator evaluateAsIterator(IEvaluationContext context, Iterator iterator) {
+ throw new UnsupportedOperationException();
+ }
+
+ int getPriority() {
+ return PRIORITY_COLLECTION;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Compare.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Compare.java
new file mode 100644
index 0000000..f82f37a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Compare.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * Comparisons for magnitude.
+ */
+final class Compare extends Binary {
+ final boolean compareLess;
+ final boolean equalOK;
+
+ Compare(Expression lhs, Expression rhs, boolean compareLess, boolean equalOK) {
+ super(lhs, rhs);
+ this.compareLess = compareLess;
+ this.equalOK = equalOK;
+ assertNotCollection(lhs, "lhs"); //$NON-NLS-1$
+ assertNotCollection(rhs, "rhs"); //$NON-NLS-1$
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ Object lval = lhs.evaluate(context);
+ Object rval = rhs.evaluate(context);
+ if (lval == null || rval == null)
+ throw new IllegalArgumentException("Cannot compare null to anything"); //$NON-NLS-1$
+
+ try {
+
+ if (lval.getClass() != rval.getClass()) {
+ if (lval instanceof Version && rval instanceof String)
+ rval = Version.create((String) rval);
+ else if (rval instanceof Version && lval instanceof String)
+ lval = Version.create((String) lval);
+ else if (lval instanceof String)
+ rval = rval.toString();
+ else if (rval instanceof String)
+ lval = lval.toString();
+ }
+
+ if (lval instanceof Comparable) {
+ int cmpResult = ((Comparable) lval).compareTo(rval);
+ return Boolean.valueOf(cmpResult == 0 ? equalOK : (cmpResult < 0 ? compareLess : !compareLess));
+ }
+ } catch (Exception e) {
+ //
+ }
+ throw new IllegalArgumentException("Cannot compare a " + lval.getClass().getName() + " to a " + rval.getClass().getName()); //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ public int getExpressionType() {
+ return compareLess ? (equalOK ? TYPE_LESS_EQUAL : TYPE_LESS) : (equalOK ? TYPE_GREATER_EQUAL : TYPE_GREATER);
+ }
+
+ String getOperator() {
+ return compareLess ? (equalOK ? OPERATOR_LT_EQUAL : OPERATOR_LT) : (equalOK ? OPERATOR_GT_EQUAL : OPERATOR_GT);
+ }
+
+ boolean isBoolean() {
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Condition.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Condition.java
new file mode 100644
index 0000000..543294b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Condition.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * Comparisons for magnitude.
+ */
+final class Condition extends Binary {
+ final Expression ifFalse;
+
+ Condition(Expression test, Expression ifTrue, Expression ifFalse) {
+ super(test, ifTrue);
+ this.ifFalse = ifFalse;
+ assertNotCollection(test, "test"); //$NON-NLS-1$
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ return lhs.evaluate(context) == Boolean.TRUE ? rhs.evaluate(context) : ifFalse.evaluate(context);
+ }
+
+ public int getExpressionType() {
+ return TYPE_CONDITION;
+ }
+
+ public void toString(StringBuffer bld) {
+ super.toString(bld);
+ bld.append(' ');
+ bld.append(OPERATOR_ELSE);
+ bld.append(' ');
+ appendOperand(bld, ifFalse, getPriority());
+ }
+
+ String getOperator() {
+ return OPERATOR_IF;
+ }
+
+ int getPriority() {
+ return PRIORITY_CONDITION;
+ }
+
+ boolean isBoolean() {
+ return rhs.isBoolean() && ifFalse.isBoolean();
+ }
+
+ boolean isCollection() {
+ return rhs.isCollection() && ifFalse.isCollection();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Constant.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Constant.java
new file mode 100644
index 0000000..fdb66aa
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Constant.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.*;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+import org.eclipse.equinox.p2.ql.SimplePattern;
+
+/**
+ * An expression that represents a constant value.
+ */
+final class Constant extends Expression {
+ private final Object value;
+
+ static final Constant NULL_CONSTANT = new Constant(null);
+
+ static final Constant TRUE_CONSTANT = new Constant(Boolean.TRUE);
+
+ static final Constant FALSE_CONSTANT = new Constant(Boolean.FALSE);
+
+ static Constant create(Object value) {
+ if (value == null)
+ return NULL_CONSTANT;
+ if (value == Boolean.TRUE)
+ return TRUE_CONSTANT;
+ if (value == Boolean.FALSE)
+ return FALSE_CONSTANT;
+ return new Constant(value);
+ }
+
+ private Constant(Object value) {
+ this.value = value;
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ return value;
+ }
+
+ public int getExpressionType() {
+ return TYPE_LITERAL;
+ }
+
+ public void toString(StringBuffer bld) {
+ if (value == null)
+ bld.append("null"); //$NON-NLS-1$
+ else if (value instanceof String) {
+ String str = (String) value;
+ char sep = str.indexOf('\'') >= 0 ? '"' : '\'';
+ bld.append(sep);
+ bld.append(str);
+ bld.append(sep);
+ } else if (value instanceof SimplePattern) {
+ appendEscaped(bld, '/', value.toString());
+ } else
+ bld.append(value);
+ }
+
+ int getPriority() {
+ return PRIORITY_LITERAL;
+ }
+
+ private void appendEscaped(StringBuffer bld, char delimiter, String str) {
+ bld.append(delimiter);
+ int top = str.length();
+ for (int idx = 0; idx < top; ++idx) {
+ char c = str.charAt(idx);
+ if (c == delimiter)
+ bld.append('\\');
+ bld.append(c);
+ }
+ bld.append(delimiter);
+ }
+
+ boolean isBoolean() {
+ return value instanceof Boolean;
+ }
+
+ boolean isCollection() {
+ return value instanceof Collection || value instanceof Map || value instanceof Iterator || value != null && value.getClass().isArray();
+ }
+
+ String getOperator() {
+ return "<literal>"; //$NON-NLS-1$
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/ContextExpression.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/ContextExpression.java
new file mode 100644
index 0000000..f50b404
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/ContextExpression.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import org.eclipse.equinox.internal.p2.ql.*;
+import org.eclipse.equinox.p2.ql.*;
+
+/**
+ * The context expression is the top expression in context queries. It introduces the
+ * variable 'everything' and initialized it with the iterator that represents all
+ * available items.
+ */
+final class ContextExpression extends Unary implements IContextExpression {
+
+ ContextExpression(Expression expression) {
+ super(expression);
+ }
+
+ public void toString(StringBuffer bld) {
+ operand.toString(bld);
+ }
+
+ public IEvaluationContext createContext(Class elementClass, Iterator iterator, Object[] params) {
+ IEvaluationContext context = new SingleVariableContext(new ParameterContext(params), Variable.EVERYTHING);
+ context.setValue(Variable.EVERYTHING, new Everything(elementClass, iterator, operand.needsRepeatedIterations()));
+ return context;
+ }
+
+ public IEvaluationContext createContext(Class elementClass, Iterator iterator, Object[] params, ITranslationSupport ts) {
+ IEvaluationContext context = new MultiVariableContext(new ParameterContext(params), new IExpression[] {Variable.EVERYTHING, Variable.TRANSLATIONS});
+ context.setValue(Variable.EVERYTHING, new Everything(elementClass, iterator, operand.needsRepeatedIterations()));
+ context.setValue(Variable.TRANSLATIONS, ts);
+ return context;
+ }
+
+ public int getExpressionType() {
+ return operand.getExpressionType();
+ }
+
+ String getOperator() {
+ throw new UnsupportedOperationException();
+ }
+
+ int getPriority() {
+ return operand.getPriority();
+ }
+
+ Expression pipeFrom(Expression expr) {
+ return new ContextExpression(operand.pipeFrom(expr));
+ }
+
+ boolean isBoolean() {
+ return operand.isBoolean();
+ }
+
+ boolean isCollection() {
+ return operand.isCollection();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Equals.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Equals.java
new file mode 100644
index 0000000..773fb75
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Equals.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * An expression that performs the == and != comparisons
+ */
+final class Equals extends Binary {
+ final boolean negate;
+
+ Equals(Expression lhs, Expression rhs, boolean negate) {
+ super(lhs, rhs);
+ this.negate = negate;
+ assertNotCollection(lhs, "lhs"); //$NON-NLS-1$
+ assertNotCollection(rhs, "rhs"); //$NON-NLS-1$
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ Object lval = lhs.evaluate(context);
+ Object rval = rhs.evaluate(context);
+ boolean result;
+ if (lval == null || rval == null)
+ result = lval == rval;
+ else {
+ if (lval.getClass() != rval.getClass()) {
+ if (lval instanceof String)
+ rval = rval.toString();
+ else if (rval instanceof String)
+ lval = lval.toString();
+ }
+ result = lval.equals(rval);
+ }
+ if (negate)
+ result = !result;
+ return Boolean.valueOf(result);
+ }
+
+ public int getExpressionType() {
+ return negate ? TYPE_NOT_EQUALS : TYPE_EQUALS;
+ }
+
+ String getOperator() {
+ return negate ? OPERATOR_NOT_EQUALS : OPERATOR_EQUALS;
+ }
+
+ boolean isBoolean() {
+ return true;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Exists.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Exists.java
new file mode 100644
index 0000000..64a23d7
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Exists.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * A collection filter that yields true if the <code>filter</code> yields true for
+ * any of the elements of the <code>collection</code>
+ */
+final class Exists extends CollectionFilter {
+ Exists(Expression collection, LambdaExpression lambda) {
+ super(collection, lambda);
+ }
+
+ public int getExpressionType() {
+ return TYPE_EXISTS;
+ }
+
+ Object evaluate(IEvaluationContext context, Iterator itor) {
+ Variable variable = lambda.getItemVariable();
+ while (itor.hasNext()) {
+ variable.setValue(context, itor.next());
+ if (lambda.evaluate(context) == Boolean.TRUE)
+ return Boolean.TRUE;
+ }
+ return Boolean.FALSE;
+ }
+
+ String getOperator() {
+ return KEYWORD_EXISTS;
+ }
+
+ boolean isBoolean() {
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Expression.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Expression.java
new file mode 100644
index 0000000..7992dda
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Expression.java
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.*;
+import org.eclipse.equinox.internal.p2.ql.IRepeatableIterator;
+import org.eclipse.equinox.internal.p2.ql.RepeatableIterator;
+import org.eclipse.equinox.internal.p2.ql.parser.IParserConstants;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
+import org.eclipse.equinox.p2.ql.*;
+
+/**
+ * The base class of the expression tree.
+ */
+abstract class Expression implements IExpression, IParserConstants {
+
+ static final Expression[] emptyArray = new Expression[0];
+
+ static Set asSet(Object val, boolean forcePrivateCopy) {
+ if (val == null)
+ throw new IllegalArgumentException("Cannot convert null into an set"); //$NON-NLS-1$
+
+ if (val instanceof IRepeatableIterator) {
+ Object provider = ((IRepeatableIterator) val).getIteratorProvider();
+ if (!forcePrivateCopy) {
+ if (provider instanceof Set)
+ return (Set) provider;
+ if (provider instanceof Collector)
+ return (Set) ((Collector) provider).toCollection();
+ }
+
+ if (provider instanceof Collection)
+ val = provider;
+ } else {
+ if (!forcePrivateCopy) {
+ if (val instanceof Set)
+ return (Set) val;
+ if (val instanceof Collector)
+ return (Set) ((Collector) val).toCollection();
+ }
+ }
+
+ HashSet result;
+ if (val instanceof Collection)
+ result = new HashSet((Collection) val);
+ else {
+ result = new HashSet();
+ Iterator iterator = RepeatableIterator.create(val);
+ while (iterator.hasNext())
+ result.add(iterator.next());
+ }
+ return result;
+ }
+
+ /**
+ * Let the visitor visit this instance and all expressions that this
+ * instance contains.
+ * @param visitor The visiting visitor.
+ * @return <code>true</code> if the visitor should continue visiting, <code>false</code> otherwise.
+ */
+ public boolean accept(IExpressionVisitor visitor) {
+ return visitor.accept(this);
+ }
+
+ /**
+ * Evaluate this expression with given context and variables.
+ * @param context The evaluation context
+ * @return The result of the evaluation.
+ */
+ public abstract Object evaluate(IEvaluationContext context);
+
+ public Iterator evaluateAsIterator(IEvaluationContext context) {
+ Object value = evaluate(context);
+ if (!(value instanceof Iterator))
+ value = RepeatableIterator.create(value);
+ return (Iterator) value;
+ }
+
+ /**
+ * Checks if the expression will make repeated requests for the 'everything' iterator.
+ * @return <code>true</code> if repeated requests will be made, <code>false</code> if not.
+ */
+ public boolean needsRepeatedIterations() {
+ return countReferenceToEverything() > 1;
+ }
+
+ public final boolean needsTranslations() {
+ final boolean[] translationSupportNeeded = new boolean[] {false};
+ accept(new IExpressionVisitor() {
+ public boolean accept(IExpression expr) {
+ if (((Expression) expr).isReferencingTranslations()) {
+ translationSupportNeeded[0] = true;
+ return false;
+ }
+ return true;
+ }
+ });
+ return translationSupportNeeded[0];
+ }
+
+ public String toString() {
+ StringBuffer bld = new StringBuffer();
+ toString(bld);
+ return bld.toString();
+ }
+
+ public abstract void toString(StringBuffer bld);
+
+ static void appendOperand(StringBuffer bld, Expression operand, int priority) {
+ if (priority < operand.getPriority()) {
+ bld.append('(');
+ operand.toString(bld);
+ bld.append(')');
+ } else
+ operand.toString(bld);
+ }
+
+ void assertNotCollection(Expression expr, String usage) {
+ if (expr.isCollection())
+ throw new IllegalArgumentException("A collection cannot be used as " + usage + " in a " + getOperator()); //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ void assertNotBoolean(Expression expr, String usage) {
+ if (expr.isBoolean())
+ throw new IllegalArgumentException("A boolean cannot be used as " + usage + " in a " + getOperator()); //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ int countReferenceToEverything() {
+ return 0;
+ }
+
+ abstract String getOperator();
+
+ abstract int getPriority();
+
+ boolean isBoolean() {
+ return false;
+ }
+
+ boolean isCollection() {
+ return false;
+ }
+
+ boolean isElementBoolean() {
+ return false;
+ }
+
+ boolean isReferencingTranslations() {
+ return false;
+ }
+
+ boolean isPipeable() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ Expression pipeFrom(Expression nxt) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ boolean isElementCollection() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/ExpressionFactory.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/ExpressionFactory.java
new file mode 100644
index 0000000..e6dac86
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/ExpressionFactory.java
@@ -0,0 +1,228 @@
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.*;
+import org.eclipse.equinox.internal.p2.ql.parser.IParserConstants;
+import org.eclipse.equinox.p2.ql.*;
+
+public class ExpressionFactory implements IExpressionFactory, IParserConstants {
+ public static final IExpressionFactory INSTANCE = new ExpressionFactory();
+
+ private static final Map functionMap;
+
+ static {
+ Class[] args = new Class[] {Expression[].class};
+ Map f = new HashMap();
+ try {
+ f.put(KEYWORD_BOOLEAN, BooleanFunction.class.getConstructor(args));
+ f.put(KEYWORD_FILTER, FilterFunction.class.getConstructor(args));
+ f.put(KEYWORD_VERSION, VersionFunction.class.getConstructor(args));
+ f.put(KEYWORD_RANGE, RangeFunction.class.getConstructor(args));
+ f.put(KEYWORD_SET, SetFunction.class.getConstructor(args));
+ f.put(KEYWORD_CLASS, ClassFunction.class.getConstructor(args));
+ f.put(KEYWORD_IQUERY, WrappedIQuery.class.getConstructor(args));
+ f.put(KEYWORD_CAPABILITY_INDEX, CapabilityIndexFunction.class.getConstructor(args));
+ functionMap = Collections.unmodifiableMap(f);
+ } catch (Exception e) {
+ throw new ExceptionInInitializerError(e);
+ }
+ }
+
+ private static Expression[] convertArray(IExpression[] operands) {
+ Expression[] ops = new Expression[operands.length];
+ System.arraycopy(operands, 0, ops, 0, operands.length);
+ return ops;
+ }
+
+ private ExpressionFactory() {
+ // Maintain singleton
+ }
+
+ public IExpression all(IExpression collection, IExpression lambda) {
+ return new All((Expression) collection, (LambdaExpression) lambda);
+ }
+
+ public IExpression and(IExpression[] operands) {
+ return new And(convertArray(operands));
+ }
+
+ public IExpression array(IExpression[] operands) {
+ return new Array(convertArray(operands));
+ }
+
+ public IExpression assignment(IExpression variable, IExpression expression) {
+ return new Assignment((Variable) variable, (Expression) expression);
+ }
+
+ public IExpression at(IExpression target, IExpression key) {
+ return new At((Expression) target, (Expression) key);
+ }
+
+ public IExpression collect(IExpression collection, IExpression lambda) {
+ return new Collect((Expression) collection, (LambdaExpression) lambda);
+ }
+
+ public IExpression condition(IExpression test, IExpression ifTrue, IExpression ifFalse) {
+ return new Condition((Expression) test, (Expression) ifTrue, (Expression) ifFalse);
+ }
+
+ public IExpression constant(Object value) {
+ return Constant.create(value);
+ }
+
+ public IContextExpression contextExpression(IExpression expr) {
+ return new ContextExpression((Expression) expr);
+ }
+
+ public IExpression dynamicMember(IExpression target, String name) {
+ return new Member.DynamicMember((Expression) target, name);
+ }
+
+ public IExpression equals(IExpression lhs, IExpression rhs) {
+ return new Equals((Expression) lhs, (Expression) rhs, false);
+ }
+
+ public IExpression exists(IExpression collection, IExpression lambda) {
+ return new Exists((Expression) collection, (LambdaExpression) lambda);
+ }
+
+ public IExpression first(IExpression collection, IExpression lambda) {
+ return new First((Expression) collection, (LambdaExpression) lambda);
+ }
+
+ public IExpression flatten(IExpression collection) {
+ return new Flatten((Expression) collection);
+ }
+
+ public IExpression function(Object function, IExpression[] args) {
+ try {
+ return (IExpression) ((Constructor) function).newInstance(new Object[] {convertArray(args)});
+ } catch (IllegalArgumentException e) {
+ throw e;
+ } catch (InvocationTargetException e) {
+ Throwable t = e.getCause();
+ if (t instanceof RuntimeException)
+ throw (RuntimeException) t;
+ throw new RuntimeException(t);
+ } catch (InstantiationException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Map getFunctionMap() {
+ return functionMap;
+ }
+
+ public IExpression greater(IExpression lhs, IExpression rhs) {
+ return new Compare((Expression) lhs, (Expression) rhs, false, false);
+ }
+
+ public IExpression indexedParameter(int index) {
+ return new Parameter.Indexed(index);
+ }
+
+ public IExpression keyedParameter(String key) {
+ return new Parameter.Keyed(key);
+ }
+
+ public IExpression lambda(IExpression variable, IExpression body) {
+ return new LambdaExpression((Variable) variable, (Expression) body);
+ }
+
+ public IExpression lambda(IExpression variable, IExpression body, IExpression[] assignments) {
+ Assignment[] asgns = new Assignment[assignments.length];
+ System.arraycopy(assignments, 0, asgns, 0, assignments.length);
+ return new LambdaExpression((Variable) variable, (Expression) body, asgns);
+ }
+
+ public IExpression latest(IExpression collection) {
+ return new Latest((Expression) collection);
+ }
+
+ public IExpression less(IExpression lhs, IExpression rhs) {
+ return new Compare((Expression) lhs, (Expression) rhs, true, false);
+ }
+
+ public IExpression limit(IExpression collection, IExpression limit) {
+ return new Limit((Expression) collection, (Expression) limit);
+ }
+
+ public IExpression matches(IExpression lhs, IExpression rhs) {
+ return new Matches((Expression) lhs, (Expression) rhs);
+ }
+
+ public IMatchExpression matchExpression(IExpression expr) {
+ return new MatchExpression((Expression) expr);
+ }
+
+ public IExpression member(IExpression target, String name) {
+ return new Member.DynamicMember((Expression) target, name);
+ }
+
+ public IExpression memberCall(IExpression target, String name, IExpression[] args) {
+ if (args.length == 0)
+ return member(target, name);
+
+ Expression[] eargs = convertArray(args);
+ if (KEYWORD_SATISFIES_ANY.equals(name))
+ return new Member.CapabilityIndex_satisfiesAny((Expression) target, eargs);
+ if (KEYWORD_SATISFIES_ALL.equals(name))
+ return new Member.CapabilityIndex_satisfiesAll((Expression) target, eargs);
+
+ StringBuffer bld = new StringBuffer();
+ bld.append("Don't know how to do a member call with "); //$NON-NLS-1$
+ bld.append(name);
+ bld.append('(');
+ Array.elementsToString(bld, eargs);
+ bld.append(')');
+ throw new IllegalArgumentException(bld.toString());
+ }
+
+ public IExpression not(IExpression operand) {
+ if (operand instanceof Equals) {
+ Equals eq = (Equals) operand;
+ return new Equals(eq.lhs, eq.rhs, !eq.negate);
+ }
+ if (operand instanceof Compare) {
+ Compare cmp = (Compare) operand;
+ return new Compare(cmp.lhs, cmp.rhs, !cmp.compareLess, !cmp.equalOK);
+ }
+ if (operand instanceof Not)
+ return ((Not) operand).operand;
+
+ return new Not((Expression) operand);
+ }
+
+ public IExpression or(IExpression[] operands) {
+ return new Or(convertArray(operands));
+ }
+
+ public IExpression pipe(IExpression[] operands) {
+ if (operands.length == 0)
+ return null;
+
+ Expression pipe = (Expression) operands[0];
+ for (int idx = 1; idx < operands.length; ++idx)
+ pipe = ((Expression) operands[idx]).pipeFrom(pipe);
+ return pipe;
+ }
+
+ public IExpression select(IExpression collection, IExpression lambda) {
+ return new Select((Expression) collection, (LambdaExpression) lambda);
+ }
+
+ public IExpression traverse(IExpression collection, IExpression lambda) {
+ return new Traverse((Expression) collection, (LambdaExpression) lambda);
+ }
+
+ public IExpression unique(IExpression collection, IExpression cache) {
+ return new Unique((Expression) collection, (Expression) cache);
+ }
+
+ public IExpression variable(String name) {
+ return Variable.create(name);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/FilterFunction.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/FilterFunction.java
new file mode 100644
index 0000000..5f0130c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/FilterFunction.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.internal.p2.metadata.LDAPQuery;
+import org.eclipse.equinox.internal.p2.ql.QLActivator;
+import org.osgi.framework.InvalidSyntaxException;
+
+/**
+ * A function that creates an OSGi filter based on a String
+ */
+final class FilterFunction extends Function {
+ public FilterFunction(Expression[] operands) {
+ super(assertLength(operands, 1, 1, KEYWORD_FILTER));
+ assertNotBoolean(operands[0], "parameter"); //$NON-NLS-1$
+ assertNotCollection(operands[0], "parameter"); //$NON-NLS-1$
+ }
+
+ boolean assertSingleArgumentClass(Object v) {
+ return v instanceof LDAPQuery || v instanceof String;
+ }
+
+ Object createInstance(Object arg) {
+ String str = (arg instanceof LDAPQuery) ? ((LDAPQuery) arg).getFilter() : (String) arg;
+ try {
+ return QLActivator.context.createFilter(str);
+ } catch (InvalidSyntaxException e) {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ String getOperator() {
+ return KEYWORD_FILTER;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/First.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/First.java
new file mode 100644
index 0000000..ee20a14
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/First.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * A collection filter that yields the first element of the <code>collection</code> for which
+ * the <code>filter</code> yields <code>true</code>
+ */
+final class First extends CollectionFilter {
+ First(Expression collection, LambdaExpression lambda) {
+ super(collection, lambda);
+ }
+
+ public int getExpressionType() {
+ return TYPE_FIRST;
+ }
+
+ Object evaluate(IEvaluationContext context, Iterator itor) {
+ Variable variable = lambda.getItemVariable();
+ while (itor.hasNext()) {
+ Object each = itor.next();
+ variable.setValue(context, each);
+ if (lambda.evaluate(context) == Boolean.TRUE)
+ return each;
+ }
+ return null;
+ }
+
+ String getOperator() {
+ return KEYWORD_FIRST;
+ }
+
+ boolean isBoolean() {
+ return operand.isElementBoolean();
+ }
+
+ boolean isCollection() {
+ return operand.isElementCollection();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Flatten.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Flatten.java
new file mode 100644
index 0000000..2aaf288
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Flatten.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import org.eclipse.equinox.internal.p2.ql.FlattenIterator;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * An expression that yields a new collection consisting of all elements of the
+ * <code>collection</code> for which the <code>filter</code> yields <code>true</code>.
+ */
+final class Flatten extends UnaryCollectionFilter {
+ Flatten(Expression collection) {
+ super(collection);
+ }
+
+ public Iterator evaluateAsIterator(IEvaluationContext context) {
+ return new FlattenIterator(operand.evaluateAsIterator(context));
+ }
+
+ public int getExpressionType() {
+ return TYPE_FLATTEN;
+ }
+
+ String getOperator() {
+ return KEYWORD_FLATTEN;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Function.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Function.java
new file mode 100644
index 0000000..5497dca
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Function.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * An expression that represents a function such as filter(<expr>) or version(<expr>)
+ */
+abstract class Function extends NAry {
+
+ private Object instance;
+
+ Function(Expression[] operands) {
+ super(operands);
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ if (instance != null)
+ return instance;
+
+ Expression operand = operands[0];
+ Object arg = operand.evaluate(context);
+ if (assertSingleArgumentClass(arg)) {
+ Object result = createInstance(arg);
+ if (operand instanceof Constant || operand instanceof Parameter)
+ // operand won't change over time so we can cache this instance.
+ instance = result;
+ return result;
+ }
+ String what = arg == null ? "null" : ("a " + arg.getClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new IllegalArgumentException("Cannot create a " + getOperator() + " from " + what); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ boolean assertSingleArgumentClass(Object v) {
+ return true;
+ }
+
+ public int getExpressionType() {
+ return TYPE_FUNCTION;
+ }
+
+ public void toString(StringBuffer bld) {
+ bld.append(getOperator());
+ bld.append('(');
+ Array.elementsToString(bld, operands);
+ bld.append(')');
+ }
+
+ final Object createInstance(String arg) {
+ throw new UnsupportedOperationException();
+ }
+
+ Object createInstance(Object arg) {
+ throw new UnsupportedOperationException();
+ }
+
+ int getPriority() {
+ return PRIORITY_CONSTRUCTOR;
+ }
+
+ boolean isBoolean() {
+ return false;
+ }
+
+ boolean isCollection() {
+ return false;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/LambdaExpression.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/LambdaExpression.java
new file mode 100644
index 0000000..cdc1d72
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/LambdaExpression.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.internal.p2.ql.MultiVariableContext;
+import org.eclipse.equinox.internal.p2.ql.SingleVariableContext;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+import org.eclipse.equinox.p2.ql.IExpressionVisitor;
+
+/**
+ * A function that executes some code
+ */
+final class LambdaExpression extends Unary {
+ private static final Assignment[] emptyAssignmentArray = new Assignment[0];
+ private final Assignment[] assignments;
+ private final Variable each;
+
+ LambdaExpression(Variable each, Expression body, Assignment[] assignments) {
+ super(body);
+ this.each = each;
+ if (assignments == null)
+ assignments = emptyAssignmentArray;
+ this.assignments = assignments;
+ }
+
+ LambdaExpression(Variable variable, Expression body) {
+ this(variable, body, null);
+ }
+
+ public boolean accept(IExpressionVisitor visitor) {
+ if (super.accept(visitor) && each.accept(visitor)) {
+ for (int idx = 0; idx < assignments.length; ++idx)
+ if (!assignments[idx].accept(visitor))
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ public int getExpressionType() {
+ return TYPE_LAMBDA;
+ }
+
+ public void toString(StringBuffer bld) {
+ int top = assignments.length;
+ if (top > 0) {
+ for (int idx = 0; idx < top; ++idx) {
+ appendOperand(bld, assignments[idx].rhs, PRIORITY_COMMA);
+ bld.append(", "); //$NON-NLS-1$
+ }
+ bld.append(OPERATOR_EACH);
+ bld.append(", {"); //$NON-NLS-1$
+ for (int idx = 0; idx < top; ++idx) {
+ appendOperand(bld, assignments[idx].lhs, PRIORITY_COMMA);
+ bld.append(", "); //$NON-NLS-1$
+ }
+ }
+ each.toString(bld);
+ bld.append(" | "); //$NON-NLS-1$
+ appendOperand(bld, operand, PRIORITY_COMMA);
+ if (top > 0)
+ bld.append('}');
+ }
+
+ int countReferenceToEverything() {
+ if (super.countReferenceToEverything() > 0)
+ return 2;
+ for (int idx = 0; idx < assignments.length; ++idx)
+ if (assignments[idx].countReferenceToEverything() > 0)
+ return 2;
+ return 0;
+ }
+
+ Variable getItemVariable() {
+ return each;
+ }
+
+ String getOperator() {
+ return "|"; //$NON-NLS-1$
+ }
+
+ int getPriority() {
+ return PRIORITY_LAMBDA;
+ }
+
+ boolean isBoolean() {
+ return operand.isBoolean();
+ }
+
+ boolean isCollection() {
+ return operand.isCollection();
+ }
+
+ IEvaluationContext prolog(IEvaluationContext context) {
+ IEvaluationContext lambdaContext = new SingleVariableContext(context, each);
+ int top = assignments.length;
+ if (top > 0) {
+ if (top == 1) {
+ Assignment v = assignments[0];
+ lambdaContext = new SingleVariableContext(lambdaContext, v.lhs);
+ lambdaContext.setValue(v.lhs, v.rhs.evaluate(context));
+ } else {
+ Variable[] vars = new Variable[top];
+ for (int idx = 0; idx < top; ++idx)
+ vars[idx] = (Variable) assignments[idx].lhs;
+ lambdaContext = new MultiVariableContext(lambdaContext, vars);
+ for (int idx = 0; idx < top; ++idx)
+ lambdaContext.setValue(vars[idx], assignments[idx].rhs.evaluate(context));
+ }
+ }
+ return lambdaContext;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Latest.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Latest.java
new file mode 100644
index 0000000..d4ddc00
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Latest.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.*;
+import org.eclipse.equinox.p2.metadata.IVersionedId;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * An expression that is especially targeted towards {@link IVersionedId} instances. It will
+ * reject any objects that is not an <code>IVersionedId</code> and it will ensure that the
+ * resulting iterator only iterates over the latest version of any found id.
+ */
+final class Latest extends UnaryCollectionFilter {
+
+ Latest(Expression collection) {
+ super(collection);
+ }
+
+ public Iterator evaluateAsIterator(IEvaluationContext context) {
+ HashMap greatestIUVersion;
+ if (operand instanceof Select) {
+ // Inline element evaluation here so that we don't build a map that is
+ // larger then it has to be
+ Select select = (Select) operand;
+ Iterator iterator = select.operand.evaluateAsIterator(context);
+ if (!iterator.hasNext())
+ return Collections.EMPTY_SET.iterator();
+
+ greatestIUVersion = new HashMap();
+ LambdaExpression lambda = select.lambda;
+ context = lambda.prolog(context);
+ Variable variable = lambda.getItemVariable();
+ while (iterator.hasNext()) {
+ Object next = iterator.next();
+ if (!(next instanceof IVersionedId))
+ continue;
+
+ variable.setValue(context, next);
+ if (lambda.evaluate(context) != Boolean.TRUE)
+ continue;
+
+ IVersionedId versionedID = (IVersionedId) next;
+ String id = versionedID.getId();
+ IVersionedId prev = (IVersionedId) greatestIUVersion.put(id, versionedID);
+ if (prev == null)
+ continue;
+ if (prev.getVersion().compareTo(versionedID.getVersion()) > 0)
+ greatestIUVersion.put(id, prev);
+ }
+ } else {
+ Iterator iterator = operand.evaluateAsIterator(context);
+ if (iterator == null)
+ return null;
+ if (!iterator.hasNext())
+ return Collections.EMPTY_SET.iterator();
+
+ greatestIUVersion = new HashMap();
+ while (iterator.hasNext()) {
+ Object next = iterator.next();
+ if (!(next instanceof IVersionedId))
+ continue;
+
+ IVersionedId versionedID = (IVersionedId) next;
+ String id = versionedID.getId();
+
+ IVersionedId prev = (IVersionedId) greatestIUVersion.put(id, versionedID);
+ if (prev == null)
+ continue;
+
+ if (prev.getVersion().compareTo(versionedID.getVersion()) > 0)
+ greatestIUVersion.put(id, prev);
+ }
+ }
+ return greatestIUVersion.values().iterator();
+ }
+
+ public int getExpressionType() {
+ return TYPE_LATEST;
+ }
+
+ String getOperator() {
+ return KEYWORD_LATEST;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Limit.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Limit.java
new file mode 100644
index 0000000..5c0ae42
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Limit.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * A collection filter that limits the number of entries in the collection
+ */
+final class Limit extends Binary {
+
+ /**
+ * An iterator that stops iterating after a given number of iterations.
+ */
+ static final class CountingIterator implements Iterator {
+ private final Iterator innerIterator;
+ private int counter;
+
+ public CountingIterator(Iterator iterator, int count) {
+ this.innerIterator = iterator;
+ this.counter = count;
+ }
+
+ public boolean hasNext() {
+ return counter > 0 && innerIterator.hasNext();
+ }
+
+ public Object next() {
+ if (counter > 0) {
+ --counter;
+ return innerIterator.next();
+ }
+ throw new NoSuchElementException();
+ }
+
+ public void remove() {
+ innerIterator.remove();
+ }
+ }
+
+ Limit(Expression operand, Expression param) {
+ super(operand, param);
+ assertNotBoolean(operand, "operand"); //$NON-NLS-1$
+ assertNotCollection(param, "parameter"); //$NON-NLS-1$
+ }
+
+ Limit(Expression operand, int limit) {
+ this(operand, Constant.create(new Integer(limit)));
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ Object rval = rhs.evaluate(context);
+ int limit = -1;
+ if (rval instanceof Integer)
+ limit = ((Integer) rval).intValue();
+ if (limit <= 0)
+ throw new IllegalArgumentException("limit expression did not evalutate to a positive integer"); //$NON-NLS-1$
+ return new CountingIterator(lhs.evaluateAsIterator(context), limit);
+ }
+
+ public int getExpressionType() {
+ return TYPE_LIMIT;
+ }
+
+ public void toString(StringBuffer bld) {
+ CollectionFilter.appendProlog(bld, lhs, getOperator());
+ appendOperand(bld, rhs, PRIORITY_COMMA);
+ bld.append(')');
+ }
+
+ String getOperator() {
+ return KEYWORD_LIMIT;
+ }
+
+ int getPriority() {
+ return PRIORITY_COLLECTION;
+ }
+
+ boolean isCollection() {
+ return true;
+ }
+
+ boolean isElementBoolean() {
+ return lhs.isElementBoolean();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/MatchExpression.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/MatchExpression.java
new file mode 100644
index 0000000..dadd153
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/MatchExpression.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.internal.p2.ql.*;
+import org.eclipse.equinox.p2.ql.*;
+
+/**
+ * The match expression is the top expression in item queries. It introduces the
+ * variable 'item' and initializes it with the item to match.
+ */
+final class MatchExpression extends Unary implements IMatchExpression {
+
+ MatchExpression(Expression expression) {
+ super(expression);
+ }
+
+ public boolean isMatch(IEvaluationContext context, Object value) {
+ Variable.ITEM.setValue(context, value);
+ return operand.evaluate(context) == Boolean.TRUE;
+ }
+
+ public IEvaluationContext createContext(Object[] params) {
+ return new SingleVariableContext(new ParameterContext(params), Variable.ITEM);
+ }
+
+ public IEvaluationContext createContext(Object[] params, ITranslationSupport ts) {
+ IEvaluationContext context = new MultiVariableContext(new ParameterContext(params), new IExpression[] {Variable.ITEM, Variable.TRANSLATIONS});
+ context.setValue(Variable.TRANSLATIONS, ts);
+ return context;
+ }
+
+ public int getExpressionType() {
+ return operand.getExpressionType();
+ }
+
+ public void toString(StringBuffer bld) {
+ operand.toString(bld);
+ }
+
+ protected int getPriority() {
+ return operand.getPriority();
+ }
+
+ String getOperator() {
+ throw new UnsupportedOperationException();
+ }
+
+ Expression pipeFrom(Expression expr) {
+ return new MatchExpression(operand.pipeFrom(expr));
+ }
+
+ boolean isBoolean() {
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Matches.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Matches.java
new file mode 100644
index 0000000..b36aa16
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Matches.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.*;
+import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
+import org.eclipse.equinox.internal.provisional.p2.metadata.*;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+import org.eclipse.equinox.p2.ql.SimplePattern;
+import org.osgi.framework.Filter;
+
+/**
+ * <p>A class that performs "matching" The actual algorithm used for
+ * performing the match varies depending on the types of the items to match.</p>
+ * <p>The following things can be matched:</p>
+ * <table border="1" cellpadding="3">
+ * <tr><th>LHS</th><th>RHS</th><th>Implemented as</th></tr>
+ * <tr><td>IProvidedCapability</td><td>IRequiredCapability</td><td>lhs.satisfies(rhs)</td></tr>
+ * <tr><td>IInstallableUnit</td><td>IRequiredCapability</td><td>lhs.satisfies(rhs)</td></tr>
+ * <tr><td>Version</td><td>VersionRange</td><td>rhs.isIncluded(lhs)</td></tr>
+ * <tr><td>IInstallableUnit</td><td>Filter</td><td>rhs.matches(lhs.properties)</td></tr>
+ * <tr><td>Map</td><td>Filter</td><td>rhs.match(lhs)</td></tr>
+ * <tr><td>String</td><td>Pattern</td><td>rhs.matcher(lhs).matches()</td></tr>
+ * <tr><td><any></td><td>Class</td><td>rhs.isInstance(lhs)</td></tr>
+ * <tr><td>Class</td><td>Class</td><td>rhs.isAssignableFrom(lhs)</td></tr>
+ * </table>
+ */
+final class Matches extends Binary {
+ Matches(Expression lhs, Expression rhs) {
+ super(lhs, rhs);
+ assertNotBoolean(lhs, "lhs"); //$NON-NLS-1$
+ assertNotBoolean(rhs, "rhs"); //$NON-NLS-1$
+ assertNotCollection(rhs, "rhs"); //$NON-NLS-1$
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ Object lval = lhs.evaluate(context);
+ Object rval = rhs.evaluate(context);
+
+ if (rval instanceof IRequiredCapability) {
+ IRequiredCapability cap = (IRequiredCapability) rval;
+ if (lval instanceof IInstallableUnit)
+ return Boolean.valueOf(((IInstallableUnit) lval).satisfies(cap));
+ if (lval instanceof IProvidedCapability)
+ return Boolean.valueOf(cap.satisfiedBy((IProvidedCapability) lval));
+
+ } else if (rval instanceof VersionRange) {
+ if (lval instanceof Version)
+ return Boolean.valueOf(((VersionRange) rval).isIncluded((Version) lval));
+
+ } else if (rval instanceof SimplePattern) {
+ if (lval instanceof CharSequence)
+ return Boolean.valueOf(((SimplePattern) rval).isMatch((CharSequence) lval));
+
+ } else if (rval instanceof IUpdateDescriptor) {
+ if (lval instanceof IInstallableUnit)
+ return Boolean.valueOf(((IUpdateDescriptor) rval).isUpdateOf((IInstallableUnit) lval));
+
+ } else if (rval instanceof Filter) {
+ if (lval instanceof IInstallableUnit)
+ return Boolean.valueOf(((Filter) rval).match(new Hashtable(((IInstallableUnit) lval).getProperties())));
+ if (lval instanceof Dictionary)
+ return Boolean.valueOf(((Filter) rval).match((Dictionary) lval));
+ if (lval instanceof Map)
+ return Boolean.valueOf(((Filter) rval).match(new Hashtable((Map) lval)));
+
+ } else if (rval instanceof Locale) {
+ if (lval instanceof String)
+ return Boolean.valueOf(matchLocaleVariants((Locale) rval, (String) lval));
+
+ } else if (rval instanceof Class) {
+ Class rclass = (Class) rval;
+ return Boolean.valueOf(lval instanceof Class ? rclass.isAssignableFrom((Class) lval) : rclass.isInstance(lval));
+ }
+
+ if (lval == null || rval == null)
+ return Boolean.FALSE;
+
+ throw new IllegalArgumentException("Cannot match a " + lval.getClass().getName() + " with a " + rval.getClass().getName()); //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ public int getExpressionType() {
+ return TYPE_MATCHES;
+ }
+
+ private static boolean equals(String a, String b, int startPos, int endPos) {
+ if (endPos - startPos != b.length())
+ return false;
+
+ int bidx = 0;
+ while (startPos < endPos)
+ if (a.charAt(startPos++) != b.charAt(bidx++))
+ return false;
+ return true;
+ }
+
+ private static boolean matchLocaleVariants(Locale rval, String lval) {
+ int uscore = lval.indexOf('_');
+ if (uscore < 0)
+ // No country and no variant. Just match language
+ return lval.equals(rval.getLanguage());
+
+ if (!equals(lval, rval.getLanguage(), 0, uscore))
+ // Language part doesn't match. Give up.
+ return false;
+
+ // Check country and variant
+ int countryStart = uscore + 1;
+ uscore = lval.indexOf('_', countryStart);
+ return uscore < 0 ? equals(lval, rval.getCountry(), countryStart, lval.length()) //
+ : equals(lval, rval.getCountry(), countryStart, uscore) && equals(lval, rval.getVariant(), uscore + 1, lval.length());
+ }
+
+ String getOperator() {
+ return OPERATOR_MATCHES;
+ }
+
+ boolean isBoolean() {
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Member.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Member.java
new file mode 100644
index 0000000..ff8efbc
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Member.java
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.lang.reflect.*;
+import java.util.Iterator;
+import org.eclipse.equinox.p2.ql.*;
+
+/**
+ * <p>An expression that performs member calls to obtain some value
+ * from some object instance. It uses standard bean semantics so
+ * that an attempt to obtain "value" will cause an
+ * attempt to call <code>getValue()</code> and if no such method
+ * exists, <code>isValue()</code> and if that doesn't work either,
+ * <code>value()</code>.</p>
+ */
+abstract class Member extends Unary {
+
+ static Member createDynamicMember(Expression operand, String name) {
+ return new DynamicMember(operand, name);
+ }
+
+ static final Object[] NO_ARGS = new Object[0];
+
+ final String name;
+ final Expression[] argExpressions;
+
+ static abstract class CapabilityIndexMethod extends Member {
+ public CapabilityIndexMethod(Expression operand, String name, Expression[] args) {
+ super(operand, name, args);
+ }
+
+ final ICapabilityIndex getSelf(IEvaluationContext context) {
+ Object self = operand.evaluate(context);
+ if (self instanceof ICapabilityIndex)
+ return (ICapabilityIndex) self;
+ throw new IllegalArgumentException("lhs of member expected to be an ICapabilityIndex implementation"); //$NON-NLS-1$
+ }
+
+ public final Object evaluate(IEvaluationContext context) {
+ return evaluateAsIterator(context);
+ }
+
+ boolean isCollection() {
+ return true;
+ }
+ }
+
+ static final class CapabilityIndex_satisfiesAny extends CapabilityIndexMethod {
+
+ public CapabilityIndex_satisfiesAny(Expression operand, Expression[] argExpressions) {
+ super(operand, KEYWORD_SATISFIES_ANY, NAry.assertLength(argExpressions, 1, 1, KEYWORD_SATISFIES_ANY));
+ }
+
+ public Iterator evaluateAsIterator(IEvaluationContext context) {
+ return getSelf(context).satisfiesAny(argExpressions[0].evaluateAsIterator(context));
+ }
+ }
+
+ static final class CapabilityIndex_satisfiesAll extends CapabilityIndexMethod {
+
+ public CapabilityIndex_satisfiesAll(Expression operand, Expression[] argExpressions) {
+ super(operand, KEYWORD_SATISFIES_ALL, NAry.assertLength(argExpressions, 1, 1, KEYWORD_SATISFIES_ALL));
+ }
+
+ public Iterator evaluateAsIterator(IEvaluationContext context) {
+ return getSelf(context).satisfiesAll(argExpressions[0].evaluateAsIterator(context));
+ }
+ }
+
+ public boolean accept(IExpressionVisitor visitor) {
+ if (super.accept(visitor))
+ for (int idx = 0; idx < argExpressions.length; ++idx)
+ if (!argExpressions[idx].accept(visitor))
+ return false;
+ return true;
+ }
+
+ Member(Expression operand, String name, Expression[] args) {
+ super(operand);
+ this.name = name;
+ this.argExpressions = args;
+ }
+
+ public int getExpressionType() {
+ return TYPE_MEMBER;
+ }
+
+ public void toString(StringBuffer bld) {
+ if (operand == Variable.ITEM || operand == Variable.EVERYTHING)
+ bld.append(name);
+ else {
+ appendOperand(bld, operand, getPriority());
+ bld.append('.');
+ bld.append(name);
+ }
+ if (argExpressions.length > 0) {
+ bld.append('(');
+ Array.elementsToString(bld, argExpressions);
+ bld.append(')');
+ }
+ }
+
+ String getOperator() {
+ return OPERATOR_MEMBER;
+ }
+
+ int getPriority() {
+ return PRIORITY_MEMBER;
+ }
+
+ static final class DynamicMember extends Member {
+ private static final Class[] NO_ARG_TYPES = new Class[0];
+ private static final String GET_PREFIX = "get"; //$NON-NLS-1$
+ private static final String IS_PREFIX = "is"; //$NON-NLS-1$
+
+ DynamicMember(Expression operand, String name) {
+ super(operand, name, Expression.emptyArray);
+ if (!(name.startsWith(GET_PREFIX) || name.startsWith(IS_PREFIX)))
+ name = GET_PREFIX + Character.toUpperCase(name.charAt(0)) + name.substring(1);
+ this.methodName = name;
+ }
+
+ private Class lastClass;
+ private Method method;
+ private String methodName;
+
+ public Object evaluate(IEvaluationContext context) {
+ return invoke(operand.evaluate(context));
+ }
+
+ boolean isReferencingTranslations() {
+ return VARIABLE_TRANSLATIONS.equals(name);
+ }
+
+ Object invoke(Object self) {
+ if (self == null)
+ throw new IllegalArgumentException("Cannot access member " + name + " in null"); //$NON-NLS-1$//$NON-NLS-2$
+
+ Class c = self.getClass();
+ if (lastClass == null || !lastClass.isAssignableFrom(c)) {
+ Method m;
+ for (;;) {
+ try {
+ m = c.getMethod(methodName, NO_ARG_TYPES);
+ if (!Modifier.isPublic(m.getModifiers()))
+ throw new NoSuchMethodException();
+ break;
+ } catch (NoSuchMethodException e) {
+ if (methodName.startsWith(GET_PREFIX))
+ // Switch from using getXxx() to isXxx()
+ methodName = IS_PREFIX + Character.toUpperCase(name.charAt(0)) + name.substring(1);
+ else if (methodName.startsWith(IS_PREFIX))
+ // Switch from using isXxx() to xxx()
+ methodName = name;
+ else
+ throw new IllegalArgumentException("Cannot find a public member " + name + " in a " + self.getClass().getName()); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ }
+
+ // Since we already checked that it's public. This will speed
+ // up the calls a bit.
+ m.setAccessible(true);
+ lastClass = c;
+ method = m;
+ }
+
+ Exception checked;
+ try {
+ return method.invoke(self, NO_ARGS);
+ } catch (IllegalArgumentException e) {
+ throw e;
+ } catch (IllegalAccessException e) {
+ checked = e;
+ } catch (InvocationTargetException e) {
+ Throwable cause = e.getTargetException();
+ if (cause instanceof RuntimeException)
+ throw (RuntimeException) cause;
+ if (cause instanceof Error)
+ throw (Error) cause;
+ checked = (Exception) cause;
+ }
+ throw new RuntimeException("Problem invoking " + methodName + " on a " + self.getClass().getName(), checked); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/NAry.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/NAry.java
new file mode 100644
index 0000000..22595de
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/NAry.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.p2.ql.IExpressionVisitor;
+
+/**
+ * The abstract baseclass for all N-ary expressions
+ *
+ */
+abstract class NAry extends Expression {
+ static Expression[] assertLength(Expression[] operands, int length, String operand) {
+ if (operands == null)
+ operands = emptyArray;
+ if (operands.length < length)
+ throw new IllegalArgumentException("Not enough operands for " + operand); //$NON-NLS-1$
+ return operands;
+ }
+
+ static Expression[] assertLength(Expression[] operands, int minLength, int maxLength, String operand) {
+ if (operands == null)
+ operands = emptyArray;
+ if (operands.length < minLength)
+ throw new IllegalArgumentException("Not enough operands for " + operand); //$NON-NLS-1$
+ if (operands.length > maxLength)
+ throw new IllegalArgumentException("Too many operands for " + operand); //$NON-NLS-1$
+ return operands;
+ }
+
+ final Expression[] operands;
+
+ NAry(Expression[] operands) {
+ this.operands = operands;
+ }
+
+ public boolean accept(IExpressionVisitor visitor) {
+ if (super.accept(visitor))
+ for (int idx = 0; idx < operands.length; ++idx)
+ if (!operands[idx].accept(visitor))
+ return false;
+ return true;
+ }
+
+ public void toString(StringBuffer bld) {
+ appendOperand(bld, operands[0], getPriority());
+ for (int idx = 1; idx < operands.length; ++idx) {
+ bld.append(' ');
+ bld.append(getOperator());
+ bld.append(' ');
+ appendOperand(bld, operands[idx], getPriority());
+ }
+ }
+
+ int countReferenceToEverything() {
+ int count = 0;
+ for (int idx = 0; count < 2 && idx < operands.length; ++idx)
+ count += operands[idx].countReferenceToEverything();
+ return count;
+ }
+
+ abstract String getOperator();
+
+ boolean isBoolean() {
+ int idx = operands.length;
+ while (--idx >= 0)
+ if (!operands[idx].isBoolean())
+ return false;
+ return true;
+ }
+
+ boolean isCollection() {
+ int idx = operands.length;
+ while (--idx >= 0)
+ if (!operands[idx].isCollection())
+ return false;
+ return true;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Not.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Not.java
new file mode 100644
index 0000000..ab7b31f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Not.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * An expression that yields <code>true</code> when its operand does not.
+ */
+final class Not extends Unary {
+ Not(Expression operand) {
+ super(operand);
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ return Boolean.valueOf(operand.evaluate(context) != Boolean.TRUE);
+ }
+
+ public int getExpressionType() {
+ return TYPE_NOT;
+ }
+
+ String getOperator() {
+ return OPERATOR_NOT;
+ }
+
+ int getPriority() {
+ return PRIORITY_NOT;
+ }
+
+ boolean isBoolean() {
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Or.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Or.java
new file mode 100644
index 0000000..c4fad53
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Or.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import java.util.Set;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * n-ary OR operator. This operator evaluates its first operand and then checks
+ * the class of the result. If the class is {@link Boolean} then it is assumed
+ * that all other operands also evaluates to a boolean and the full evaluation is
+ * <code>false</code> if none of its operands evaluate to <code>true</code>. If the
+ * first result was not of class {@link Boolean}, then it is assumed that it can
+ * be accessed as an {@link Iterator} and that all other operands also evaluates to
+ * something that can be accessed an {@link Iterator}. The OR operator will then
+ * function as a UNION operator and the result is the unique sum of all elements that
+ * were found in all operands.
+ */
+final class Or extends NAry {
+ public Or(Expression[] operands) {
+ super(assertLength(operands, 2, OPERATOR_OR));
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ Object firstValue = operands[0].evaluate(context);
+
+ // Determine operation mode
+ if (firstValue instanceof Boolean) {
+ // The first value was boolean. Assume that the rest are too
+ if (((Boolean) firstValue).booleanValue())
+ return Boolean.TRUE;
+
+ for (int idx = 1; idx < operands.length; ++idx) {
+ if (operands[idx].evaluate(context) == Boolean.TRUE)
+ return Boolean.TRUE;
+ }
+ return Boolean.FALSE;
+ }
+
+ // Not a boolean. Assume that we can use an iterator on all values
+ Set resultSet = asSet(firstValue, true);
+ for (int idx = 1; idx < operands.length; ++idx) {
+ Iterator itor = operands[idx].evaluateAsIterator(context);
+ while (itor.hasNext())
+ resultSet.add(itor.next());
+ }
+ return resultSet;
+ }
+
+ public int getExpressionType() {
+ return TYPE_OR;
+ }
+
+ String getOperator() {
+ return OPERATOR_OR;
+ }
+
+ int getPriority() {
+ return PRIORITY_OR;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Parameter.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Parameter.java
new file mode 100644
index 0000000..c6374ea
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Parameter.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * The abstract base class for the indexed and keyed parameters
+ */
+abstract class Parameter extends Expression {
+ public int getExpressionType() {
+ return TYPE_PARAMETER;
+ }
+
+ int getPriority() {
+ return PRIORITY_PARAMETER;
+ }
+
+ String getOperator() {
+ return OPERATOR_PARAMETER;
+ }
+
+ static final class Indexed extends Parameter {
+ final int position;
+
+ Indexed(int position) {
+ this.position = position;
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ return context.getParameter(position);
+ }
+
+ public void toString(StringBuffer bld) {
+ bld.append('$');
+ bld.append(position);
+ }
+ }
+
+ static final class Keyed extends Parameter {
+ final String key;
+
+ public Keyed(String key) {
+ this.key = key;
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ return context.getParameter(key);
+ }
+
+ public void toString(StringBuffer bld) {
+ bld.append('$');
+ bld.append(key);
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/RangeFunction.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/RangeFunction.java
new file mode 100644
index 0000000..a749ac8
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/RangeFunction.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
+
+/**
+ * A function that creates a {@link VersionRange} from a String
+ */
+final class RangeFunction extends Function {
+
+ public RangeFunction(Expression[] operands) {
+ super(assertLength(operands, 1, 1, KEYWORD_RANGE));
+ assertNotBoolean(operands[0], "parameter"); //$NON-NLS-1$
+ assertNotCollection(operands[0], "parameter"); //$NON-NLS-1$
+ }
+
+ boolean assertSingleArgumentClass(Object v) {
+ return v instanceof String;
+ }
+
+ Object createInstance(Object arg) {
+ return new VersionRange((String) arg);
+ }
+
+ String getOperator() {
+ return KEYWORD_RANGE;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Select.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Select.java
new file mode 100644
index 0000000..76ee0ca
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Select.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import org.eclipse.equinox.internal.p2.ql.MatchIteratorFilter;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * An expression that yields a new collection consisting of all elements of the
+ * <code>collection</code> for which the <code>filter</code> yields <code>true</code>.
+ */
+final class Select extends CollectionFilter {
+ Select(Expression collection, LambdaExpression lambda) {
+ super(collection, lambda);
+ }
+
+ public int getExpressionType() {
+ return TYPE_SELECT;
+ }
+
+ Object evaluate(IEvaluationContext context, Iterator itor) {
+ return evaluateAsIterator(context, itor);
+ }
+
+ Iterator evaluateAsIterator(final IEvaluationContext context, Iterator itor) {
+ return new MatchIteratorFilter(itor) {
+ protected boolean isMatch(Object val) {
+ lambda.getItemVariable().setValue(context, val);
+ return lambda.evaluate(context) == Boolean.TRUE;
+ }
+ };
+ }
+
+ String getOperator() {
+ return KEYWORD_SELECT;
+ }
+
+ boolean isCollection() {
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/SetFunction.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/SetFunction.java
new file mode 100644
index 0000000..b8c83f1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/SetFunction.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.HashSet;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+final class SetFunction extends Function {
+
+ public SetFunction(Expression[] operands) {
+ super(operands);
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ HashSet result = new HashSet();
+ for (int idx = 0; idx < operands.length; ++idx)
+ result.add(operands[idx].evaluate(context));
+ return result;
+ }
+
+ String getOperator() {
+ return KEYWORD_SET;
+ }
+
+ boolean isCollection() {
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Traverse.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Traverse.java
new file mode 100644
index 0000000..27fad3e
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Traverse.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.*;
+import org.eclipse.equinox.internal.p2.ql.SingleVariableContext;
+import org.eclipse.equinox.internal.p2.ql.parser.IParserConstants;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * An expression that will collect items recursively based on a <code>rule</code>.
+ * The <code>rule</code> is applied for each item in the <code>collection</code> and
+ * is supposed to create a new collection. The <code>rule</code> is then applied for each item
+ * in the new collection. All items are collected into a set and items that are already
+ * in that set will not be perused again. The set becomes the result of the traversal.
+ */
+final class Traverse extends CollectionFilter {
+
+ Traverse(Expression collection, LambdaExpression lambda) {
+ super(collection, lambda);
+ }
+
+ public int getExpressionType() {
+ return TYPE_TRAVERSE;
+ }
+
+ Object evaluate(IEvaluationContext context, Iterator itor) {
+ return evaluateAsIterator(context, itor);
+ }
+
+ Iterator evaluateAsIterator(IEvaluationContext context, Iterator iterator) {
+ HashSet collector = new HashSet();
+ while (iterator.hasNext())
+ traverse(collector, iterator.next(), context);
+ return collector.iterator();
+ }
+
+ String getOperator() {
+ return IParserConstants.KEYWORD_TRAVERSE;
+ }
+
+ void traverse(Set collector, Object parent, IEvaluationContext context) {
+ if (collector.add(parent)) {
+ Variable variable = lambda.getItemVariable();
+ context = new SingleVariableContext(context, variable);
+ variable.setValue(context, parent);
+ Iterator subIterator = lambda.evaluateAsIterator(context);
+ while (subIterator.hasNext())
+ traverse(collector, subIterator.next(), context);
+ }
+ }
+
+ boolean isCollection() {
+ return true;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Unary.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Unary.java
new file mode 100644
index 0000000..ff4e017
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Unary.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+import org.eclipse.equinox.p2.ql.IExpressionVisitor;
+
+/**
+ * The abstract base class for all unary expressions
+ */
+abstract class Unary extends Expression {
+ public final Expression operand;
+
+ Unary(Expression operand) {
+ this.operand = operand;
+ }
+
+ public boolean accept(IExpressionVisitor visitor) {
+ return super.accept(visitor) && operand.accept(visitor);
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ return operand.evaluate(context);
+ }
+
+ public void toString(StringBuffer bld) {
+ bld.append(getOperator());
+ appendOperand(bld, operand, getPriority());
+ }
+
+ public Expression getOperand() {
+ return operand;
+ }
+
+ int countReferenceToEverything() {
+ return operand.countReferenceToEverything();
+ }
+
+ abstract String getOperator();
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/UnaryCollectionFilter.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/UnaryCollectionFilter.java
new file mode 100644
index 0000000..85d2a55
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/UnaryCollectionFilter.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+abstract class UnaryCollectionFilter extends Unary {
+
+ UnaryCollectionFilter(Expression collection) {
+ super(collection);
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ return evaluateAsIterator(context);
+ }
+
+ public void toString(StringBuffer bld) {
+ if (operand instanceof Select) {
+ Select select = (Select) operand;
+ CollectionFilter.appendProlog(bld, select.operand, getOperator());
+ appendOperand(bld, select.lambda, getPriority());
+ } else
+ CollectionFilter.appendProlog(bld, operand, getOperator());
+ bld.append(')');
+ }
+
+ int getPriority() {
+ return PRIORITY_COLLECTION;
+ }
+
+ boolean isCollection() {
+ return true;
+ }
+
+ boolean isElementBoolean() {
+ return operand.isElementBoolean();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Unique.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Unique.java
new file mode 100644
index 0000000..1d59279
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Unique.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.*;
+import org.eclipse.equinox.internal.p2.ql.MatchIteratorFilter;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+
+/**
+ * An expression that ensures that the elements of its collection is only returned
+ * once throughout the whole query.
+ */
+final class Unique extends Binary {
+ static class UniqueIterator extends MatchIteratorFilter {
+ private final Set uniqueSet;
+
+ public UniqueIterator(Iterator iterator, Set uniqueSet) {
+ super(iterator);
+ this.uniqueSet = uniqueSet;
+ }
+
+ protected boolean isMatch(Object val) {
+ synchronized (uniqueSet) {
+ return uniqueSet.add(val);
+ }
+ }
+ }
+
+ Unique(Expression collection, Expression explicitCache) {
+ super(collection, explicitCache);
+ assertNotBoolean(collection, "collection"); //$NON-NLS-1$
+ assertNotBoolean(explicitCache, "cache"); //$NON-NLS-1$
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ Object explicitCache = rhs.evaluate(context);
+ Set uniqueSet;
+ if (explicitCache == null)
+ // No cache, we just ensure that the iteration is unique
+ uniqueSet = new HashSet();
+ else {
+ if (!(explicitCache instanceof Set))
+ throw new IllegalArgumentException("Unique cache must be a java.util.Set"); //$NON-NLS-1$
+ uniqueSet = (Set) explicitCache;
+ }
+ return new UniqueIterator(lhs.evaluateAsIterator(context), uniqueSet);
+ }
+
+ public int getExpressionType() {
+ return TYPE_UNIQUE;
+ }
+
+ public void toString(StringBuffer bld) {
+ CollectionFilter.appendProlog(bld, lhs, getOperator());
+ if (rhs != Constant.NULL_CONSTANT)
+ appendOperand(bld, rhs, PRIORITY_COMMA);
+ bld.append(')');
+ }
+
+ String getOperator() {
+ return KEYWORD_UNIQUE;
+ }
+
+ int getPriority() {
+ return PRIORITY_COLLECTION;
+ }
+
+ boolean isCollection() {
+ return true;
+ }
+
+ boolean isElementBoolean() {
+ return lhs.isElementBoolean();
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Variable.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Variable.java
new file mode 100644
index 0000000..fcc51ff
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/Variable.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import org.eclipse.equinox.internal.p2.ql.IRepeatableIterator;
+import org.eclipse.equinox.internal.p2.ql.RepeatableIterator;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+import org.eclipse.equinox.p2.ql.IExpression;
+
+/**
+ * An expression representing a variable stack in the current thread.
+ */
+class Variable extends Expression {
+
+ static final Variable EVERYTHING = new Variable(VARIABLE_EVERYTHING);
+
+ static final Variable TRANSLATIONS = new Variable(VARIABLE_TRANSLATIONS);
+
+ static final Variable ITEM = new Variable(VARIABLE_ITEM);
+
+ private final String name;
+
+ public static Variable create(String name) {
+ if (VARIABLE_ITEM.equals(name))
+ return ITEM;
+ if (VARIABLE_EVERYTHING.equals(name))
+ return EVERYTHING;
+ if (VARIABLE_TRANSLATIONS.equals(name))
+ return TRANSLATIONS;
+ return new Variable(name);
+ }
+
+ Variable(String name) {
+ this.name = name;
+ }
+
+ public final Object evaluate(IEvaluationContext context) {
+ return context.getValue(this);
+ }
+
+ public Iterator evaluateAsIterator(IEvaluationContext context) {
+ Object value = context.getValue(this);
+ if (value instanceof IRepeatableIterator)
+ return ((IRepeatableIterator) value).getCopy();
+
+ Iterator itor = RepeatableIterator.create(value);
+ setValue(context, itor);
+ return itor;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public final void setValue(IEvaluationContext context, Object value) {
+ context.setValue(this, value);
+ }
+
+ public void toString(StringBuffer bld) {
+ bld.append(name);
+ }
+
+ public int getExpressionType() {
+ return TYPE_VARIABLE;
+ }
+
+ int countReferenceToEverything() {
+ return IExpression.VARIABLE_EVERYTHING.equals(name) ? 1 : 0;
+ }
+
+ int getPriority() {
+ return PRIORITY_VARIABLE;
+ }
+
+ String getOperator() {
+ return "<variable>"; //$NON-NLS-1$
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/VersionFunction.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/VersionFunction.java
new file mode 100644
index 0000000..7d2694e
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/VersionFunction.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
+
+/**
+ * A function that creates a {@link Version} from a string
+ */
+final class VersionFunction extends Function {
+
+ public VersionFunction(Expression[] operands) {
+ super(assertLength(operands, 1, 1, KEYWORD_VERSION));
+ assertNotBoolean(operands[0], "parameter"); //$NON-NLS-1$
+ assertNotCollection(operands[0], "parameter"); //$NON-NLS-1$
+ }
+
+ boolean assertSingleArgumentClass(Object v) {
+ return v instanceof String;
+ }
+
+ Object createInstance(Object arg) {
+ return Version.create((String) arg);
+ }
+
+ String getOperator() {
+ return KEYWORD_VERSION;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/WrappedIQuery.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/WrappedIQuery.java
new file mode 100644
index 0000000..88fbbdd
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/expression/WrappedIQuery.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.expression;
+
+import java.util.Iterator;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IMatchQuery;
+import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.ql.IEvaluationContext;
+import org.eclipse.equinox.p2.ql.QLContextQuery;
+
+final class WrappedIQuery extends Function {
+
+ public WrappedIQuery(Expression[] operands) {
+ super(assertLength(operands, 1, 3, KEYWORD_IQUERY));
+ assertNotBoolean(operands[0], "parameter"); //$NON-NLS-1$
+ assertNotCollection(operands[0], "parameter"); //$NON-NLS-1$
+ }
+
+ public Object evaluate(IEvaluationContext context) {
+ Object query = operands[0].evaluate(context);
+
+ if (query instanceof IMatchQuery) {
+ if (operands.length > 2)
+ throw new IllegalArgumentException("iquery third argument cannot be combined with a match query"); //$NON-NLS-1$
+
+ Object value = null;
+ if (operands.length > 1)
+ value = operands[1].evaluate(context);
+ else
+ value = Variable.ITEM.evaluate(context);
+ return Boolean.valueOf(((IMatchQuery) query).isMatch(value));
+ }
+
+ if (!(query instanceof IQuery))
+ throw new IllegalArgumentException("iquery first argument must be an IQuery instance"); //$NON-NLS-1$
+
+ Collector collector = null;
+ if (operands.length == 3) {
+ Object cobj = operands[2].evaluate(context);
+ if (cobj instanceof Collector)
+ collector = (Collector) cobj;
+ else if (cobj == null)
+ collector = new Collector();
+ else
+ throw new IllegalArgumentException("iquery third argument must be a collector"); //$NON-NLS-1$
+ }
+
+ Iterator iterator = null;
+ if (operands.length > 1)
+ iterator = operands[1].evaluateAsIterator(context);
+ else
+ iterator = Variable.EVERYTHING.evaluateAsIterator(context);
+
+ if (collector == null) {
+ if (query instanceof QLContextQuery)
+ return ((QLContextQuery) query).evaluate(iterator);
+ collector = new Collector();
+ }
+ return ((IQuery) query).perform(iterator, collector);
+ }
+
+ String getOperator() {
+ return KEYWORD_IQUERY;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/parser/ExpressionParser.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/parser/ExpressionParser.java
new file mode 100644
index 0000000..630b719
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/parser/ExpressionParser.java
@@ -0,0 +1,849 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.parser;
+
+import org.eclipse.equinox.p2.ql.IExpression;
+
+import java.util.*;
+import org.eclipse.equinox.p2.ql.*;
+
+public class ExpressionParser extends Stack implements IParserConstants, IExpressionParser {
+ private static final long serialVersionUID = 882034383978853143L;
+
+ private static final int TOKEN_OR = 1;
+ private static final int TOKEN_AND = 2;
+
+ private static final int TOKEN_EQUAL = 10;
+ private static final int TOKEN_NOT_EQUAL = 11;
+ private static final int TOKEN_LESS = 12;
+ private static final int TOKEN_LESS_EQUAL = 13;
+ private static final int TOKEN_GREATER = 14;
+ private static final int TOKEN_GREATER_EQUAL = 15;
+ private static final int TOKEN_MATCHES = 16;
+
+ private static final int TOKEN_NOT = 20;
+ private static final int TOKEN_DOT = 21;
+ private static final int TOKEN_COMMA = 22;
+ private static final int TOKEN_PIPE = 23;
+ private static final int TOKEN_DOLLAR = 24;
+ private static final int TOKEN_IF = 25;
+ private static final int TOKEN_ELSE = 26;
+
+ private static final int TOKEN_LP = 30;
+ private static final int TOKEN_RP = 31;
+ private static final int TOKEN_LB = 32;
+ private static final int TOKEN_RB = 33;
+ private static final int TOKEN_LC = 34;
+ private static final int TOKEN_RC = 35;
+
+ private static final int TOKEN_IDENTIFIER = 40;
+ private static final int TOKEN_LITERAL = 41;
+ private static final int TOKEN_ANY = 42;
+
+ private static final int TOKEN_NULL = 50;
+ private static final int TOKEN_TRUE = 51;
+ private static final int TOKEN_FALSE = 52;
+
+ private static final int TOKEN_LATEST = 60;
+ private static final int TOKEN_LIMIT = 61;
+ private static final int TOKEN_FIRST = 62;
+ private static final int TOKEN_FLATTEN = 63;
+ private static final int TOKEN_UNIQUE = 64;
+ private static final int TOKEN_SELECT = 65;
+ private static final int TOKEN_COLLECT = 66;
+ private static final int TOKEN_TRAVERSE = 67;
+ private static final int TOKEN_EXISTS = 68;
+ private static final int TOKEN_ALL = 69;
+
+ private static final int TOKEN_END = 0;
+ private static final int TOKEN_ERROR = -1;
+
+ private static final Map keywords;
+ static {
+ keywords = new HashMap();
+ keywords.put(KEYWORD_ALL, new Integer(TOKEN_ALL));
+ keywords.put(KEYWORD_COLLECT, new Integer(TOKEN_COLLECT));
+ keywords.put(KEYWORD_EXISTS, new Integer(TOKEN_EXISTS));
+ keywords.put(KEYWORD_FALSE, new Integer(TOKEN_FALSE));
+ keywords.put(KEYWORD_FIRST, new Integer(TOKEN_FIRST));
+ keywords.put(KEYWORD_FLATTEN, new Integer(TOKEN_FLATTEN));
+ keywords.put(KEYWORD_LATEST, new Integer(TOKEN_LATEST));
+ keywords.put(KEYWORD_LIMIT, new Integer(TOKEN_LIMIT));
+ keywords.put(KEYWORD_NULL, new Integer(TOKEN_NULL));
+ keywords.put(KEYWORD_SELECT, new Integer(TOKEN_SELECT));
+ keywords.put(KEYWORD_TRAVERSE, new Integer(TOKEN_TRAVERSE));
+ keywords.put(KEYWORD_TRUE, new Integer(TOKEN_TRUE));
+ keywords.put(KEYWORD_UNIQUE, new Integer(TOKEN_UNIQUE));
+ keywords.put(OPERATOR_EACH, new Integer(TOKEN_ANY));
+ }
+
+ private final IExpressionFactory factory;
+
+ private String expression;
+ private int tokenPos;
+ private int currentToken;
+ private int lastTokenPos;
+ private Object tokenValue;
+ private String rootVariable;
+
+ public ExpressionParser(IExpressionFactory factory) {
+ this.factory = factory;
+ }
+
+ public synchronized IMatchExpression parsePredicate(String exprString) {
+ expression = exprString;
+ tokenPos = 0;
+ currentToken = 0;
+ tokenValue = null;
+ rootVariable = IExpression.VARIABLE_ITEM;
+ IExpression itemVariable = factory.variable(IExpression.VARIABLE_ITEM);
+ push(itemVariable);
+ try {
+ nextToken();
+ IExpression expr = currentToken == TOKEN_END ? factory.constant(Boolean.TRUE) : parseCondition();
+ assertToken(TOKEN_END);
+ return factory.matchExpression(expr);
+ } finally {
+ popVariable(); // pop item
+ }
+ }
+
+ public synchronized IContextExpression parseQuery(String exprString) {
+ expression = exprString;
+ tokenPos = 0;
+ currentToken = 0;
+ tokenValue = null;
+ rootVariable = IExpression.VARIABLE_EVERYTHING;
+ IExpression everythingVariable = factory.variable(IExpression.VARIABLE_EVERYTHING);
+ push(everythingVariable);
+ try {
+ nextToken();
+ IExpression expr = parseCondition();
+ assertToken(TOKEN_END);
+ return factory.contextExpression(expr);
+ } finally {
+ popVariable(); // pop context
+ }
+ }
+
+ private IExpression parseCondition() {
+ IExpression expr = parseOr();
+ if (currentToken == TOKEN_IF) {
+ nextToken();
+ IExpression ifTrue = parseOr();
+ assertToken(TOKEN_ELSE);
+ nextToken();
+ expr = factory.condition(expr, ifTrue, parseOr());
+ }
+ return expr;
+ }
+
+ private IExpression parseOr() {
+ IExpression expr = parseAnd();
+ if (currentToken != TOKEN_OR)
+ return expr;
+
+ ArrayList exprs = new ArrayList();
+ exprs.add(expr);
+ do {
+ nextToken();
+ exprs.add(parseAnd());
+ } while (currentToken == TOKEN_OR);
+ return factory.or((IExpression[]) exprs.toArray(new IExpression[exprs.size()]));
+ }
+
+ private IExpression parseAnd() {
+ IExpression expr = parseBinary();
+ if (currentToken != TOKEN_AND)
+ return expr;
+
+ ArrayList exprs = new ArrayList();
+ exprs.add(expr);
+ do {
+ nextToken();
+ exprs.add(parseBinary());
+ } while (currentToken == TOKEN_AND);
+ return factory.and((IExpression[]) exprs.toArray(new IExpression[exprs.size()]));
+ }
+
+ private IExpression parseBinary() {
+ IExpression expr = parseNot();
+ switch (currentToken) {
+ case TOKEN_OR :
+ case TOKEN_AND :
+ case TOKEN_RP :
+ case TOKEN_RB :
+ case TOKEN_RC :
+ case TOKEN_COMMA :
+ case TOKEN_IF :
+ case TOKEN_ELSE :
+ case TOKEN_END :
+ break;
+ case TOKEN_EQUAL :
+ case TOKEN_NOT_EQUAL :
+ case TOKEN_GREATER :
+ case TOKEN_GREATER_EQUAL :
+ case TOKEN_LESS :
+ case TOKEN_LESS_EQUAL :
+ case TOKEN_MATCHES :
+ int realToken = currentToken;
+ nextToken();
+ IExpression rhs = parseNot();
+ switch (realToken) {
+ case TOKEN_EQUAL :
+ expr = factory.equals(expr, rhs);
+ break;
+ case TOKEN_NOT_EQUAL :
+ expr = factory.not(factory.equals(expr, rhs));
+ break;
+ case TOKEN_GREATER :
+ expr = factory.greater(expr, rhs);
+ break;
+ case TOKEN_GREATER_EQUAL :
+ expr = factory.not(factory.less(expr, rhs));
+ break;
+ case TOKEN_LESS :
+ expr = factory.less(expr, rhs);
+ break;
+ case TOKEN_LESS_EQUAL :
+ expr = factory.not(factory.greater(expr, rhs));
+ break;
+ default :
+ expr = factory.matches(expr, rhs);
+ }
+ break;
+ default :
+ throw syntaxError();
+ }
+ return expr;
+ }
+
+ private IExpression parseNot() {
+ if (currentToken == TOKEN_NOT) {
+ nextToken();
+ IExpression expr = parseNot();
+ return factory.not(expr);
+ }
+ return parseCollectionExpression();
+ }
+
+ private IExpression parseCollectionExpression() {
+ IExpression expr;
+ switch (currentToken) {
+ case TOKEN_SELECT :
+ case TOKEN_COLLECT :
+ case TOKEN_EXISTS :
+ case TOKEN_FIRST :
+ case TOKEN_FLATTEN :
+ case TOKEN_ALL :
+ case TOKEN_TRAVERSE :
+ case TOKEN_LATEST :
+ case TOKEN_LIMIT :
+ case TOKEN_UNIQUE :
+ expr = getVariableOrRootMember(rootVariable);
+ break;
+ default :
+ expr = parseMember();
+ if (currentToken != TOKEN_DOT)
+ return expr;
+ nextToken();
+ }
+
+ for (;;) {
+ int filterToken = currentToken;
+ nextToken();
+ assertToken(TOKEN_LP);
+ nextToken();
+ switch (filterToken) {
+ case TOKEN_SELECT :
+ expr = factory.select(expr, parseLambdaDefinition());
+ break;
+ case TOKEN_COLLECT :
+ expr = factory.collect(expr, parseLambdaDefinition());
+ break;
+ case TOKEN_EXISTS :
+ expr = factory.exists(expr, parseLambdaDefinition());
+ break;
+ case TOKEN_FIRST :
+ expr = factory.first(expr, parseLambdaDefinition());
+ break;
+ case TOKEN_ALL :
+ expr = factory.all(expr, parseLambdaDefinition());
+ break;
+ case TOKEN_TRAVERSE :
+ expr = factory.traverse(expr, parseLambdaDefinition());
+ break;
+ case TOKEN_LATEST :
+ if (currentToken == TOKEN_RP) {
+ expr = factory.latest(expr);
+ assertToken(TOKEN_RP);
+ nextToken();
+ } else
+ expr = factory.latest(factory.select(expr, parseLambdaDefinition()));
+ break;
+ case TOKEN_FLATTEN :
+ if (currentToken == TOKEN_RP) {
+ expr = factory.flatten(expr);
+ assertToken(TOKEN_RP);
+ nextToken();
+ } else
+ expr = factory.flatten(factory.select(expr, parseLambdaDefinition()));
+ break;
+ case TOKEN_LIMIT :
+ expr = factory.limit(expr, parseCondition());
+ assertToken(TOKEN_RP);
+ nextToken();
+ break;
+ case TOKEN_UNIQUE :
+ if (currentToken == TOKEN_RP)
+ expr = factory.unique(expr, factory.constant(null));
+ else {
+ expr = factory.unique(expr, parseMember());
+ assertToken(TOKEN_RP);
+ nextToken();
+ }
+ break;
+ default :
+ throw syntaxError();
+ }
+ if (currentToken != TOKEN_DOT)
+ break;
+ nextToken();
+ }
+ return expr;
+ }
+
+ private IExpression parseMember() {
+ IExpression expr = parseConstructor();
+ String name;
+ while (currentToken == TOKEN_DOT || currentToken == TOKEN_LB) {
+ int savePos = tokenPos;
+ int saveToken = currentToken;
+ Object saveTokenValue = tokenValue;
+ nextToken();
+ if (saveToken == TOKEN_DOT) {
+ switch (currentToken) {
+ case TOKEN_SELECT :
+ case TOKEN_COLLECT :
+ case TOKEN_EXISTS :
+ case TOKEN_FIRST :
+ case TOKEN_FLATTEN :
+ case TOKEN_ALL :
+ case TOKEN_TRAVERSE :
+ case TOKEN_LATEST :
+ case TOKEN_LIMIT :
+ case TOKEN_UNIQUE :
+ tokenPos = savePos;
+ currentToken = saveToken;
+ tokenValue = saveTokenValue;
+ return expr;
+
+ case TOKEN_IDENTIFIER :
+ name = (String) tokenValue;
+ nextToken();
+ if (currentToken == TOKEN_LP) {
+ nextToken();
+ IExpression[] callArgs = parseArray();
+ assertToken(TOKEN_RP);
+ nextToken();
+ expr = factory.memberCall(expr, name, callArgs);
+ } else
+ expr = factory.memberCall(expr, name, IExpressionFactory.NO_ARGS);
+ break;
+
+ default :
+ throw syntaxError();
+ }
+ } else {
+ IExpression atExpr = parseMember();
+ assertToken(TOKEN_RB);
+ nextToken();
+ expr = factory.at(expr, atExpr);
+ }
+ }
+ return expr;
+ }
+
+ private IExpression parseLambdaDefinition() {
+ boolean endingRC = false;
+ int anyIndex = -1;
+ IExpression[] initializers = IExpressionFactory.NO_ARGS;
+ IExpression[] variables;
+ if (currentToken == TOKEN_LC) {
+ // Lambda starts without currying.
+ endingRC = true;
+ nextToken();
+ anyIndex = 0;
+ variables = parseVariables();
+ if (variables == null)
+ // empty means no pipe at the end.
+ throw syntaxError();
+ } else {
+ anyIndex = 0;
+ variables = parseVariables();
+ if (variables == null) {
+ anyIndex = -1;
+ initializers = parseArray();
+ assertToken(TOKEN_LC);
+ nextToken();
+ endingRC = true;
+ for (int idx = 0; idx < initializers.length; ++idx) {
+ IExpression initializer = initializers[idx];
+ if (initializer.getExpressionType() == IExpression.TYPE_VARIABLE && OPERATOR_EACH.equals(initializer.toString())) {
+ if (anyIndex == -1)
+ anyIndex = idx;
+ else
+ anyIndex = -1; // Second Each. This is illegal
+ break;
+ }
+ }
+ if (anyIndex == -1)
+ throw new IllegalArgumentException("Exaclty one _ must be present among the currying expressions"); //$NON-NLS-1$
+
+ variables = parseVariables();
+ if (variables == null)
+ // empty means no pipe at the end.
+ throw syntaxError();
+ }
+
+ }
+ nextToken();
+ IExpression body = parseCondition();
+ if (endingRC) {
+ assertToken(TOKEN_RC);
+ nextToken();
+ }
+
+ assertToken(TOKEN_RP);
+ nextToken();
+ IExpression each;
+ IExpression[] assignments;
+ if (initializers.length == 0) {
+ if (variables.length != 1)
+ throw new IllegalArgumentException("Must have exactly one variable unless currying is used"); //$NON-NLS-1$
+ each = variables[0];
+ assignments = IExpressionFactory.NO_ARGS;
+ } else {
+ if (initializers.length != variables.length)
+ throw new IllegalArgumentException("Number of currying expressions and variables differ"); //$NON-NLS-1$
+
+ if (initializers.length == 1) {
+ // This is just a map from _ to some variable
+ each = variables[0];
+ assignments = IExpressionFactory.NO_ARGS;
+ } else {
+ int idx;
+ each = variables[anyIndex];
+ assignments = new IExpression[initializers.length - 1];
+ for (idx = 0; idx < anyIndex; ++idx)
+ assignments[idx] = factory.assignment(variables[idx], initializers[idx]);
+ for (++idx; idx < initializers.length; ++idx)
+ assignments[idx] = factory.assignment(variables[idx], initializers[idx]);
+ }
+ }
+ return factory.lambda(each, body, assignments);
+ }
+
+ private IExpression[] parseVariables() {
+ int savePos = tokenPos;
+ int saveToken = currentToken;
+ Object saveTokenValue = tokenValue;
+ List ids = null;
+ while (currentToken == TOKEN_IDENTIFIER) {
+ if (ids == null)
+ ids = new ArrayList();
+ ids.add(tokenValue);
+ nextToken();
+ if (currentToken == TOKEN_COMMA) {
+ nextToken();
+ continue;
+ }
+ break;
+ }
+
+ if (currentToken != TOKEN_PIPE) {
+ // This was not a variable list
+ tokenPos = savePos;
+ currentToken = saveToken;
+ tokenValue = saveTokenValue;
+ return null;
+ }
+
+ if (ids == null)
+ // Empty list but otherwise OK
+ return IExpressionFactory.NO_ARGS;
+
+ int top = ids.size();
+ IExpression[] result = new IExpression[top];
+ for (int idx = 0; idx < top; ++idx) {
+ String name = (String) ids.get(idx);
+ IExpression var = factory.variable(name);
+ push(var);
+ result[idx] = var;
+ }
+ return result;
+ }
+
+ private IExpression parseConstructor() {
+ if (currentToken == TOKEN_IDENTIFIER) {
+ int savePos = tokenPos;
+ int saveToken = currentToken;
+ Object saveTokenValue = tokenValue;
+
+ Object function = factory.getFunctionMap().get(tokenValue);
+ if (function != null) {
+ nextToken();
+ if (currentToken == TOKEN_LP) {
+ nextToken();
+ IExpression[] args = currentToken == TOKEN_RP ? IExpressionFactory.NO_ARGS : parseArray();
+ assertToken(TOKEN_RP);
+ nextToken();
+ return factory.function(function, args);
+ }
+ tokenPos = savePos;
+ currentToken = saveToken;
+ tokenValue = saveTokenValue;
+ }
+ }
+ return parseUnary();
+ }
+
+ private IExpression parseUnary() {
+ IExpression expr;
+ switch (currentToken) {
+ case TOKEN_LP :
+ nextToken();
+ expr = parseCondition();
+ assertToken(TOKEN_RP);
+ nextToken();
+ break;
+ case TOKEN_LB :
+ nextToken();
+ expr = factory.array(parseArray());
+ assertToken(TOKEN_RB);
+ nextToken();
+ break;
+ case TOKEN_LITERAL :
+ expr = factory.constant(tokenValue);
+ nextToken();
+ break;
+ case TOKEN_DOLLAR :
+ expr = parseParameter();
+ break;
+ case TOKEN_IDENTIFIER :
+ expr = getVariableOrRootMember((String) tokenValue);
+ nextToken();
+ break;
+ case TOKEN_ANY :
+ expr = factory.variable(OPERATOR_EACH);
+ nextToken();
+ break;
+ case TOKEN_NULL :
+ expr = factory.constant(null);
+ nextToken();
+ break;
+ case TOKEN_TRUE :
+ expr = factory.constant(Boolean.TRUE);
+ nextToken();
+ break;
+ case TOKEN_FALSE :
+ expr = factory.constant(Boolean.FALSE);
+ nextToken();
+ break;
+ default :
+ throw syntaxError();
+ }
+ return expr;
+ }
+
+ private IExpression parseParameter() {
+ if (currentToken == TOKEN_DOLLAR) {
+ nextToken();
+
+ IExpression param = null;
+ if (currentToken == TOKEN_LITERAL && tokenValue instanceof Integer)
+ param = factory.indexedParameter(((Integer) tokenValue).intValue());
+ else if (currentToken == TOKEN_IDENTIFIER)
+ param = factory.keyedParameter((String) tokenValue);
+
+ if (param != null) {
+ nextToken();
+ return param;
+ }
+ }
+ throw syntaxError();
+ }
+
+ private IExpression[] parseArray() {
+ IExpression expr = parseCondition();
+ if (currentToken != TOKEN_COMMA)
+ return new IExpression[] {expr};
+
+ ArrayList operands = new ArrayList();
+ operands.add(expr);
+ do {
+ nextToken();
+ if (currentToken == TOKEN_LC)
+ // We don't allow lambdas in the array
+ break;
+ operands.add(parseCondition());
+ } while (currentToken == TOKEN_COMMA);
+ return (IExpression[]) operands.toArray(new IExpression[operands.size()]);
+ }
+
+ private void assertToken(int token) {
+ if (currentToken != token)
+ throw syntaxError();
+ }
+
+ private IExpression getVariableOrRootMember(String id) {
+ int idx = size();
+ while (--idx >= 0) {
+ IExpression v = (IExpression) get(idx);
+ if (id.equals(v.toString()))
+ return v;
+ }
+
+ if (rootVariable.equals(id))
+ throw syntaxError("No such variable: " + id); //$NON-NLS-1$
+
+ return factory.memberCall(getVariableOrRootMember(rootVariable), id, IExpressionFactory.NO_ARGS);
+ }
+
+ private void nextToken() {
+ tokenValue = null;
+ int top = expression.length();
+ char c = 0;
+ while (tokenPos < top) {
+ c = expression.charAt(tokenPos);
+ if (!Character.isWhitespace(c))
+ break;
+ ++tokenPos;
+ }
+ if (tokenPos >= top) {
+ lastTokenPos = top;
+ currentToken = TOKEN_END;
+ return;
+ }
+
+ lastTokenPos = tokenPos;
+ switch (c) {
+ case '|' :
+ if (tokenPos + 1 < top && expression.charAt(tokenPos + 1) == '|') {
+ tokenValue = OPERATOR_OR;
+ currentToken = TOKEN_OR;
+ tokenPos += 2;
+ } else {
+ currentToken = TOKEN_PIPE;
+ ++tokenPos;
+ }
+ break;
+
+ case '&' :
+ if (tokenPos + 1 < top && expression.charAt(tokenPos + 1) == '&') {
+ tokenValue = OPERATOR_ARRAY;
+ currentToken = TOKEN_AND;
+ tokenPos += 2;
+ } else
+ currentToken = TOKEN_ERROR;
+ break;
+
+ case '=' :
+ if (tokenPos + 1 < top && expression.charAt(tokenPos + 1) == '=') {
+ tokenValue = OPERATOR_EQUALS;
+ currentToken = TOKEN_EQUAL;
+ tokenPos += 2;
+ } else
+ currentToken = TOKEN_ERROR;
+ break;
+
+ case '!' :
+ if (tokenPos + 1 < top && expression.charAt(tokenPos + 1) == '=') {
+ tokenValue = OPERATOR_NOT_EQUALS;
+ currentToken = TOKEN_NOT_EQUAL;
+ tokenPos += 2;
+ } else {
+ currentToken = TOKEN_NOT;
+ ++tokenPos;
+ }
+ break;
+
+ case '~' :
+ if (tokenPos + 1 < top && expression.charAt(tokenPos + 1) == '=') {
+ tokenValue = IParserConstants.OPERATOR_MATCHES;
+ currentToken = TOKEN_MATCHES;
+ tokenPos += 2;
+ } else
+ currentToken = TOKEN_ERROR;
+ break;
+
+ case '>' :
+ if (tokenPos + 1 < top && expression.charAt(tokenPos + 1) == '=') {
+ tokenValue = OPERATOR_GT_EQUAL;
+ currentToken = TOKEN_GREATER_EQUAL;
+ tokenPos += 2;
+ } else {
+ currentToken = TOKEN_GREATER;
+ ++tokenPos;
+ }
+ break;
+
+ case '<' :
+ if (tokenPos + 1 < top && expression.charAt(tokenPos + 1) == '=') {
+ tokenValue = OPERATOR_LT_EQUAL;
+ currentToken = TOKEN_LESS_EQUAL;
+ tokenPos += 2;
+ } else {
+ currentToken = TOKEN_LESS;
+ ++tokenPos;
+ }
+ break;
+
+ case '?' :
+ currentToken = TOKEN_IF;
+ ++tokenPos;
+ break;
+
+ case ':' :
+ currentToken = TOKEN_ELSE;
+ ++tokenPos;
+ break;
+
+ case '.' :
+ currentToken = TOKEN_DOT;
+ ++tokenPos;
+ break;
+
+ case '$' :
+ currentToken = TOKEN_DOLLAR;
+ ++tokenPos;
+ break;
+
+ case '{' :
+ currentToken = TOKEN_LC;
+ ++tokenPos;
+ break;
+
+ case '}' :
+ currentToken = TOKEN_RC;
+ ++tokenPos;
+ break;
+
+ case '(' :
+ currentToken = TOKEN_LP;
+ ++tokenPos;
+ break;
+
+ case ')' :
+ currentToken = TOKEN_RP;
+ ++tokenPos;
+ break;
+
+ case '[' :
+ currentToken = TOKEN_LB;
+ ++tokenPos;
+ break;
+
+ case ']' :
+ currentToken = TOKEN_RB;
+ ++tokenPos;
+ break;
+
+ case ',' :
+ currentToken = TOKEN_COMMA;
+ ++tokenPos;
+ break;
+
+ case '"' :
+ case '\'' : {
+ int start = ++tokenPos;
+ while (tokenPos < top && expression.charAt(tokenPos) != c)
+ ++tokenPos;
+ if (tokenPos == top) {
+ tokenPos = start - 1;
+ currentToken = TOKEN_ERROR;
+ } else {
+ tokenValue = expression.substring(start, tokenPos++);
+ currentToken = TOKEN_LITERAL;
+ }
+ break;
+ }
+
+ case '/' : {
+ int start = ++tokenPos;
+ StringBuffer buf = new StringBuffer();
+ while (tokenPos < top) {
+ c = expression.charAt(tokenPos);
+ if (c == '\\' && tokenPos + 1 < top) {
+ c = expression.charAt(++tokenPos);
+ if (c != '/')
+ buf.append('\\');
+ } else if (c == '/')
+ break;
+ buf.append(c);
+ ++tokenPos;
+ }
+ if (tokenPos == top) {
+ tokenPos = start - 1;
+ currentToken = TOKEN_ERROR;
+ } else {
+ tokenValue = SimplePattern.compile(expression.substring(start, tokenPos++));
+ currentToken = TOKEN_LITERAL;
+ }
+ break;
+ }
+
+ default :
+ if (Character.isDigit(c)) {
+ int start = tokenPos++;
+ while (tokenPos < top && Character.isDigit(expression.charAt(tokenPos)))
+ ++tokenPos;
+ tokenValue = Integer.valueOf(expression.substring(start, tokenPos));
+ currentToken = TOKEN_LITERAL;
+ break;
+ }
+ if (Character.isJavaIdentifierStart(c)) {
+ int start = tokenPos++;
+ while (tokenPos < top && Character.isJavaIdentifierPart(expression.charAt(tokenPos)))
+ ++tokenPos;
+ String word = expression.substring(start, tokenPos);
+ Integer token = (Integer) keywords.get(word);
+ if (token == null)
+ currentToken = TOKEN_IDENTIFIER;
+ else
+ currentToken = token.intValue();
+ tokenValue = word;
+ break;
+ }
+ throw syntaxError();
+ }
+ }
+
+ private void popVariable() {
+ if (isEmpty())
+ throw syntaxError();
+ pop();
+ }
+
+ private QLParseException syntaxError() {
+ Object tv = tokenValue;
+ if (tv == null) {
+ if (lastTokenPos >= expression.length())
+ return syntaxError("Unexpeced end of expression"); //$NON-NLS-1$
+ tv = expression.substring(lastTokenPos, lastTokenPos + 1);
+ }
+ return syntaxError("Unexpected token \"" + tv + '"'); //$NON-NLS-1$
+ }
+
+ private QLParseException syntaxError(String message) {
+ return new QLParseException(expression, message, tokenPos);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/parser/IParserConstants.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/parser/IParserConstants.java
new file mode 100644
index 0000000..381ad71
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/internal/p2/ql/parser/IParserConstants.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.ql.parser;
+
+public interface IParserConstants {
+
+ String KEYWORD_ALL = "all"; //$NON-NLS-1$
+ String KEYWORD_BOOLEAN = "boolean"; //$NON-NLS-1$
+ String KEYWORD_CAPABILITY_INDEX = "capabilityIndex"; //$NON-NLS-1$
+ String KEYWORD_CLASS = "class"; //$NON-NLS-1$
+ String KEYWORD_COLLECT = "collect"; //$NON-NLS-1$
+ String KEYWORD_EXISTS = "exists"; //$NON-NLS-1$
+ String KEYWORD_FALSE = "false"; //$NON-NLS-1$
+ String KEYWORD_FILTER = "filter"; //$NON-NLS-1$
+ String KEYWORD_FIRST = "first"; //$NON-NLS-1$
+ String KEYWORD_FLATTEN = "flatten"; //$NON-NLS-1$
+ String KEYWORD_IQUERY = "iquery"; //$NON-NLS-1$
+ String KEYWORD_LATEST = "latest"; //$NON-NLS-1$
+ String KEYWORD_LIMIT = "limit"; //$NON-NLS-1$
+ String KEYWORD_LOCALIZED_KEYS = "localizedKeys"; //$NON-NLS-1$
+ String KEYWORD_LOCALIZED_MAP = "localizedMap"; //$NON-NLS-1$
+ String KEYWORD_LOCALIZED_PROPERTY = "localizedProperty"; //$NON-NLS-1$
+ String KEYWORD_NULL = "null"; //$NON-NLS-1$
+ String KEYWORD_RANGE = "range"; //$NON-NLS-1$
+ String KEYWORD_SATISFIES_ALL = "satisfiesAll"; //$NON-NLS-1$
+ String KEYWORD_SATISFIES_ANY = "satisfiesAny"; //$NON-NLS-1$
+ String KEYWORD_SELECT = "select"; //$NON-NLS-1$
+ String KEYWORD_SET = "set"; //$NON-NLS-1$
+ String KEYWORD_TRAVERSE = "traverse"; //$NON-NLS-1$
+ String KEYWORD_TRUE = "true"; //$NON-NLS-1$
+ String KEYWORD_UNIQUE = "unique"; //$NON-NLS-1$
+ String KEYWORD_VERSION = "version"; //$NON-NLS-1$
+
+ String OPERATOR_AND = "&&"; //$NON-NLS-1$
+ String OPERATOR_ARRAY = "[]"; //$NON-NLS-1$
+ String OPERATOR_ASSIGN = "="; //$NON-NLS-1$
+ String OPERATOR_AT = "[]"; //$NON-NLS-1$
+ String OPERATOR_EACH = "_"; //$NON-NLS-1$
+ String OPERATOR_ELSE = ":"; //$NON-NLS-1$
+ String OPERATOR_EQUALS = "=="; //$NON-NLS-1$
+ String OPERATOR_GT = ">"; //$NON-NLS-1$
+ String OPERATOR_GT_EQUAL = ">="; //$NON-NLS-1$
+ String OPERATOR_IF = "?"; //$NON-NLS-1$
+ String OPERATOR_LT = "<"; //$NON-NLS-1$
+ String OPERATOR_LT_EQUAL = "<="; //$NON-NLS-1$
+ String OPERATOR_MATCHES = "~="; //$NON-NLS-1$
+ String OPERATOR_MEMBER = "."; //$NON-NLS-1$
+ String OPERATOR_NOT = "!"; //$NON-NLS-1$
+ String OPERATOR_NOT_EQUALS = "!="; //$NON-NLS-1$
+ String OPERATOR_OR = "||"; //$NON-NLS-1$
+ String OPERATOR_PARAMETER = "$"; //$NON-NLS-1$
+
+ int PRIORITY_PARAMETER = 1;
+ int PRIORITY_VARIABLE = 1;
+ int PRIORITY_LITERAL = 1;
+ int PRIORITY_CONSTRUCTOR = 2;
+ int PRIORITY_MEMBER = 3;
+ int PRIORITY_COLLECTION = 4;
+ int PRIORITY_NOT = 5;
+ int PRIORITY_BINARY = 6;
+ int PRIORITY_AND = 7;
+ int PRIORITY_OR = 8;
+ int PRIORITY_CONDITION = 9;
+ int PRIORITY_ASSIGNMENT = 10;
+ int PRIORITY_LAMBDA = 11;
+ int PRIORITY_COMMA = 12;
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/ICapabilityIndex.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/ICapabilityIndex.java
new file mode 100644
index 0000000..813efe9
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/ICapabilityIndex.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+import java.util.Iterator;
+import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+
+/**
+ * An ICapabilityIndex implementation stores instances of {@link IInstallableUnit} so
+ * that they are easily retrievable using instances of {@link IRequiredCapability}.
+ */
+public interface ICapabilityIndex {
+ /**
+ * Returns an iterator that will yield all {@link IInstallableUnit} instances that
+ * satisfies at least one of the <code>requirements</code>.
+ * @param requirements An iterator over {@link IRequiredCapability} instances.
+ * @return An iterator over {@link IInstallableUnit} instances. Possibly empty but never <code>null</code>
+ */
+ Iterator satisfiesAny(Iterator requirements);
+
+ /**
+ * Returns an iterator that will yield all {@link IInstallableUnit} instances that
+ * satisfies all of the <code>requirements</code>.
+ * @param requirements An iterator over {@link IRequiredCapability} instances.
+ * @return An iterator over {@link IInstallableUnit} instances. Possibly empty but never <code>null</code>
+ */
+ Iterator satisfiesAll(Iterator requirements);
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IContextExpression.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IContextExpression.java
new file mode 100644
index 0000000..d573863
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IContextExpression.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+import java.util.Iterator;
+
+/**
+ * This is an expression that will need access to the global variable
+ * <code>everything</code>.
+ */
+public interface IContextExpression extends IExpression {
+ /**
+ * <p>Creates a new context to be passed to a subsequent evaluation. The context
+ * will have the variable 'everything' set to an expression that represents
+ * the <code>everything</code> iterator filtered for instances of <code>elementClass</code>.</p>
+ * <p>The values of the iterator will be copied if necessary (when everything is referenced
+ * more then once).</p>
+ * @param elementClass The class of the elements to extract from <code>everything</code>
+ * @param iterator The iterator that represents all queried material.
+ * @param params The parameters to use for the evaluation.
+ * @return A new evaluation context.
+ */
+ IEvaluationContext createContext(Class elementClass, Iterator everything, Object[] params);
+
+ /**
+ * <p>Creates a new context to be passed to a subsequent evaluation. The context
+ * will have the variable 'everything' set to an expression that represents
+ * the <code>everything</code> iterator filtered for instances of <code>elementClass</code>.</p>
+ * <p>The values of the iterator will be copied if necessary (when everything is referenced
+ * more then once).</p>
+ * @param elementClass The class of the elements to extract from <code>everything</code>
+ * @param iterator The iterator that represents all queried material.
+ * @param params The parameters to use for the evaluation.
+ * @param translations A translation support object to be assigned to the variable 'translations'
+ * @return A new evaluation context.
+ */
+ IEvaluationContext createContext(Class elementClass, Iterator everything, Object[] params, ITranslationSupport translations);
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IEvaluationContext.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IEvaluationContext.java
new file mode 100644
index 0000000..4f154b8
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IEvaluationContext.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+/**
+ * The evaluation context. Contexts can be nested and new contexts are pushed for each closure
+ * during an evaluation of an expression.
+ * @see IMatchExpression#createContext(Object[])
+ * @see IContextExpression#createContext(Class, java.util.Iterator, Object[])
+ */
+public interface IEvaluationContext {
+ /**
+ * Retrieve the value of the given <code>variable</code> from this context
+ * @param variable The variable who's value should be retrieved
+ * @return The current value for the variable
+ */
+ Object getValue(IExpression variable);
+
+ /**
+ * Set the current value for the given <code>variable</code> to <code>value</code>
+ * @param variable The variable who's value should be set
+ * @param value The new value for the variable.
+ */
+ void setValue(IExpression variable, Object value);
+
+ /**
+ * Returns the value of the parameter at the given <code>position</code>
+ * @param position The zero based position for the parameter
+ * @return The parameter value
+ */
+ Object getParameter(int position);
+
+ /**
+ * Returns the value of the parameter at the given <code>key</code>
+ * @param position The key for the parameter
+ * @return The parameter value
+ */
+ Object getParameter(String key);
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpression.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpression.java
new file mode 100644
index 0000000..040b0ea
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpression.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+import java.util.Iterator;
+
+/**
+ * A node in the expression tree
+ */
+public interface IExpression {
+ int TYPE_VARIABLE = 1;
+ int TYPE_PARAMETER = 2;
+ int TYPE_LITERAL = 3;
+ int TYPE_AND = 4;
+ int TYPE_OR = 5;
+ int TYPE_FUNCTION = 6;
+ int TYPE_ARRAY = 7;
+ int TYPE_AT = 8;
+ int TYPE_MEMBER = 9;
+ int TYPE_ALL = 10;
+ int TYPE_EXISTS = 11;
+ int TYPE_SELECT = 12;
+ int TYPE_COLLECT = 13;
+ int TYPE_TRAVERSE = 14;
+ int TYPE_LATEST = 15;
+ int TYPE_FLATTEN = 16;
+ int TYPE_LIMIT = 17;
+ int TYPE_FIRST = 18;
+ int TYPE_LAMBDA = 19;
+ int TYPE_EQUALS = 20;
+ int TYPE_GREATER = 21;
+ int TYPE_LESS = 22;
+ int TYPE_GREATER_EQUAL = 23;
+ int TYPE_LESS_EQUAL = 24;
+ int TYPE_MATCHES = 25;
+ int TYPE_NOT = 26;
+ int TYPE_ASSIGNMENT = 27;
+ int TYPE_CONDITION = 28;
+ int TYPE_NOT_EQUALS = 29;
+ int TYPE_UNIQUE = 30;
+
+ String VARIABLE_TRANSLATIONS = "translations"; //$NON-NLS-1$
+ String VARIABLE_EVERYTHING = "everything"; //$NON-NLS-1$
+ String VARIABLE_ITEM = "item"; //$NON-NLS-1$
+
+ /**
+ * Let the visitor visit this instance and all expressions that this
+ * instance contains.
+ * @param visitor The visiting visitor.
+ * @return <code>true</code> if the visitor should continue visiting, <code>false</code> otherwise.
+ */
+ boolean accept(IExpressionVisitor visitor);
+
+ /**
+ * Evaluate this expression with given context and variables.
+ * @param context The evaluation context
+ * @return The result of the evaluation.
+ */
+ Object evaluate(IEvaluationContext context);
+
+ /**
+ * Evaluate this expression with given context and variables and return a result
+ * in the form of an iterator.
+ * @param context The evaluation context
+ * @return The result of the evaluation.
+ */
+ Iterator evaluateAsIterator(IEvaluationContext context);
+
+ /**
+ * Returns the expression type (see TYPE_xxx constants).
+ */
+ int getExpressionType();
+
+ /**
+ * Checks if this expression will need an instance of {@link ITranslationSupport} to execute
+ * @return <code>true</code> if translation support is needed.
+ */
+ boolean needsTranslations();
+
+ /**
+ * A special toString method that can be used when efficient string concatenation is
+ * desired. Avoids the need to create new StringBuffer instances for each concatenation
+ * when traversing the expression tree.
+ * @param receiver The receiver of the string representation.
+ */
+ void toString(StringBuffer receiver);
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpressionFactory.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpressionFactory.java
new file mode 100644
index 0000000..cceafff
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpressionFactory.java
@@ -0,0 +1,301 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+import java.util.Map;
+import org.eclipse.equinox.p2.metadata.IVersionedId;
+
+/**
+ * This inteface provides all the factory methods needed to create the all possible
+ * nodes of the expression tree.
+ */
+public interface IExpressionFactory {
+ IExpression[] NO_ARGS = new IExpression[0];
+
+ /**
+ * Create a collection filter that yields true if the <code>lambda</code> yields true for
+ * all of the elements of the <code>collection</code>
+ * @param collection The collection providing the elements to test
+ * @param lambda The lambda that performs the test
+ * @return A boolean expression
+ */
+ IExpression all(IExpression collection, IExpression lambda);
+
+ /**
+ * Create a logical <i>and</i> of its <code>operands</code>.
+ * @param operands The boolean operands
+ * @return A boolean expression
+ */
+ IExpression and(IExpression[] operands);
+
+ /**
+ * Create an array of elements.
+ * @param elements The elements of the array
+ * @return An array expression
+ */
+ IExpression array(IExpression[] elements);
+
+ /**
+ * Creates an expression that represents a variable assignment
+ * @param variable The variable
+ * @param expression The expression that yields the value to assign to the variable
+ * @return An assignment expression
+ */
+ IExpression assignment(IExpression variable, IExpression expression);
+
+ /**
+ * Create an lookup of <code>key</code> in the <code>target</code>.
+ * The key expression should evaluate to a string or an integer.
+ * @param target The target for the lookup
+ * @param key The key to use for the lookup
+ * @return A lookup expression
+ */
+ IExpression at(IExpression target, IExpression key);
+
+ /**
+ * Create an expression that collects the result of evaluating each element in a new collection.
+ * @param collection The collection providing the elements to evaluate
+ * @param lambda The lambda that creates each new element
+ * @return A collection expression
+ */
+ IExpression collect(IExpression collection, IExpression lambda);
+
+ /**
+ * Create an expression that first evaluates a <code>test</code> and then, depending on the outcome,
+ * evaluates either <code>ifTrue</code> or <code>ifFalse</code>. The expression yields the result
+ * of the <code>ifTrue</code> or <code>ifFalse</code> evaluation.
+ * @param test The test
+ * @param ifTrue The code to evaluate when the test evaluates to <code>true</code>
+ * @param ifFalse The code to evaluate when the test evaluates to <code>false</code>
+ * @return The conditional expression
+ */
+ IExpression condition(IExpression test, IExpression ifTrue, IExpression ifFalse);
+
+ /**
+ * Creates an expression that evaluates to the constant <code>value</code>.
+ * @param value The constant
+ * @return A constant expression
+ */
+ IExpression constant(Object value);
+
+ /**
+ * Creates a top level expression that represents a full query.
+ * @param expr The query
+ * @return A top level query expression
+ */
+ IContextExpression contextExpression(IExpression expr);
+
+ /**
+ * Create an expression that tests if <code>lhs</code> is equal to <code>rhs</code>.
+ * @param lhs The left hand side value.
+ * @param rhs The right hand side value.
+ * @return A boolean expression
+ */
+ IExpression equals(IExpression lhs, IExpression rhs);
+
+ /**
+ * Create a collection filter that yields true if the <code>lambda</code> yields true for
+ * at least one of the elements of the <code>collection</code>
+ * @param collection The collection providing the elements to test
+ * @param lambda The lambda that performs the test
+ * @return A boolean expression
+ */
+ IExpression exists(IExpression collection, IExpression lambda);
+
+ /**
+ * Create an expression that yields the first element of the
+ * <code>collection</code> for which the <code>lambda</code> yields <code>true</code>.
+ * @param collection The collection providing the elements to test
+ * @param lambda The lambda that performs the test
+ * @return An element expression
+ */
+ IExpression first(IExpression collection, IExpression lambda);
+
+ /**
+ * Intended to be applied on collections of collections. Yields a single collection with
+ * all elements from the source collections, in the order they are evaluated.
+ * @param collection The collection providing the collections that provides all elements
+ * @return A collection expression
+ */
+ IExpression flatten(IExpression collection);
+
+ /**
+ * Given one of the value in the {@link Map} returned by {@link #getFunctionMap()}, this method
+ * returns a function expression.
+ * @param function The value obtained from the map.
+ * @param args The arguments to evaluate and pass when evaluating the function.
+ * @return A function expression
+ */
+ IExpression function(Object function, IExpression[] args);
+
+ /**
+ * Returns a map of functions supported by this factory. The map is keyed by
+ * function names and the value is an object suitable to pass to the {@link #function(Object, IExpression[])}
+ * method.
+ * @return A key/function map.
+ */
+ Map getFunctionMap();
+
+ /**
+ * Create an expression that tests if <code>lhs</code> is greater than <code>rhs</code>.
+ * @param lhs The left hand side value.
+ * @param rhs The right hand side value.
+ * @return A boolean expression
+ */
+ IExpression greater(IExpression lhs, IExpression rhs);
+
+ /**
+ * Creates an indexed parameter expression
+ * @param index The index to use
+ * @return a parameter expression
+ */
+ IExpression indexedParameter(int index);
+
+ /**
+ * Creates an keyed parameter expression
+ * @param key The key to use
+ * @return a parameter expression
+ */
+ IExpression keyedParameter(String key);
+
+ /**
+ * Creates a lambda expression that takes exactly one variable. Suitable for use
+ * in most collection expressions.
+ * @param body The body of the lambda
+ * @param variable The element variable that the lambda uses
+ * @return A lambda expression
+ */
+ IExpression lambda(IExpression body, IExpression variable);
+
+ /**
+ * Creates a lambda expression that takes more then one variable (currying). Suitable for use
+ * in most collection expressions.
+ * @param body The body of the lambda
+ * @param variable The element variable that the lambda uses
+ * @param initialAssignments Assignments to evaluate once before calling the body for each element.
+ * @return A lambda expression with currying
+ */
+ IExpression lambda(IExpression body, IExpression variable, IExpression[] initialAssignments);
+
+ /**
+ * Create an expression that yields a new collection consisting of the latest version of
+ * the elements of the <code>collection</code>. Each element in <code>collection</code>
+ * must implement the {@link IVersionedId} interface.
+ * @param collection The collection providing the versioned elements
+ * @return A collection expression
+ */
+ IExpression latest(IExpression collection);
+
+ /**
+ * Create an expression that tests if <code>lhs</code> is less than <code>rhs</code>.
+ * @param lhs The left hand side value.
+ * @param rhs The right hand side value.
+ * @return A boolean expression
+ */
+ IExpression less(IExpression lhs, IExpression rhs);
+
+ /**
+ * Create an expression that yields a new collection consisting of the <i>n</i> first
+ * elements of the source collection where <i>n</i> is determined by <code>limit</code>.
+ * @param collection The source collection
+ * @return A collection expression
+ */
+ IExpression limit(IExpression collection, IExpression limit);
+
+ /**
+ * Create an expression that tests if <code>lhs</code> matches <code>rhs</code>.
+ * @param lhs The left hand side value.
+ * @param rhs The right hand side value.
+ * @return A boolean expression
+ */
+ IExpression matches(IExpression lhs, IExpression rhs);
+
+ /**
+ * Creates a top level expression suitable for predicate matching
+ * @param expr The boolean expression
+ * @return A top level predicate expression
+ */
+ IMatchExpression matchExpression(IExpression expr);
+
+ /**
+ * Creates a member accessor expression.
+ * @param target The target for the member access
+ * @param name The name of the member
+ * @return A member expression
+ */
+ IExpression member(IExpression target, String name);
+
+ /**
+ * Creates a member call expression.
+ * @param target The target for the member call
+ * @param name The name of the member
+ * @param args The arguments to use for the call
+ * @return A member expression
+ */
+ IExpression memberCall(IExpression target, String name, IExpression[] args);
+
+ /**
+ * Creates an expression that negates the result of evaluating its <code>operand</code>.
+ * @param operand The boolean expression to negate
+ * @return A boolean expression
+ */
+ IExpression not(IExpression operand);
+
+ /**
+ * Create a logical <i>or</i> of its <code>operands</code>.
+ * @param operands The boolean operands
+ * @return A boolean expression
+ */
+ IExpression or(IExpression[] operands);
+
+ /**
+ * Create an expression that yields a new collection consisting of all elements of the
+ * <code>collection</code> for which the <code>lambda</code> yields <code>true</code>.
+ * @param collection The collection providing the elements to test
+ * @param lambda The lambda that performs the test
+ * @return A collection expression
+ */
+ IExpression select(IExpression collection, IExpression lambda);
+
+ /**
+ * <p>Recursively traverse and collect elements based on a condition</p>
+ * <p>A common scenario in p2 is that you want to start with a set of roots and then find
+ * all items that fulfill the root requirements. Those items in turn introduce new
+ * requirements so you want to find them too. The process continues until no more
+ * requirements can be satisfied. This type of query can be performed using the traverse
+ * function.</p>
+ * <p>The function will evaluate an expression, once for each element, collect
+ * elements for which the evaluation returned true, then then re-evaluate using the
+ * collected result as source of elements. No element is evaluated twice. This continues
+ * until no more elements are found.</p>
+ * @param collection The collection providing the elements to test
+ * @param lambda The lambda that collects the children for the next iteration
+ * @return A collection expression
+ */
+ IExpression traverse(IExpression collection, IExpression lambda);
+
+ /**
+ * Create an expression that yields a new collection where each element is unique. An
+ * optional <code>cache</code> can be provided if the uniqueness should span a larger
+ * scope then just the source collection.
+ * @param collection The source collection
+ * @param cache Optional cache to use when uniqueness should span over several invocations
+ * @return A collection expression
+ */
+ IExpression unique(IExpression collection, IExpression cache);
+
+ /**
+ * Creates an expression that represents a variable
+ * @param name The name of the variable
+ * @return A variable expression
+ */
+ IExpression variable(String name);
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpressionParser.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpressionParser.java
new file mode 100644
index 0000000..69c507a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpressionParser.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+/**
+ * A parser that produces an expression tree based on a string representation. An
+ * implementation will use the {@link IExpressionFactory} to create the actual expressions
+ */
+public interface IExpressionParser {
+ /**
+ * Create a new boolean expression. The expression will have access to the global
+ * variable 'item' and to the context parameters.
+ * @param exprString The string representing the boolean expression.
+ * @return The resulting expression tree.
+ * @throws QLParseException
+ */
+ IMatchExpression parsePredicate(String exprString);
+
+ /**
+ * Create an arbitrary expression. The expression will have access to the global
+ * variable 'everything' and to the context parameters.
+ * @param exprString The string representing the boolean expression.
+ * @return The resulting expression tree.
+ * @throws QLParseException
+ */
+ IContextExpression parseQuery(String exprString);
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpressionVisitor.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpressionVisitor.java
new file mode 100644
index 0000000..14a7fa0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IExpressionVisitor.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+/**
+ * A general purpose visitor that will visit each node in an expression tree.
+ */
+public interface IExpressionVisitor {
+ /**
+ * The method that will be called for each expression that is
+ * visited.
+ * @param expression The expression that the visitor visits.
+ * @return <code>true</code> to continue visiting other expressions or
+ * <code>false</code> to break out.
+ */
+ boolean accept(IExpression expression);
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IMatchExpression.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IMatchExpression.java
new file mode 100644
index 0000000..cd9dff4
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IMatchExpression.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+/**
+ * The item expression is the top expression in item queries. It introduces the
+ * variable 'item' and initializes it with the item to match.
+ */
+public interface IMatchExpression extends IExpression {
+ /**
+ * <p>Creates a new context to be passed to a subsequent evaluation. The context
+ * will introduce 'item' as an uninitialized variable and make the parameters available.
+ * @param params The parameters to use for the evaluation.
+ * @return A new evaluation context.
+ */
+ IEvaluationContext createContext(Object[] params);
+
+ /**
+ * <p>Creates a new context to be passed to a subsequent evaluation. The context
+ * will introduce 'item' as an uninitialized variable and make the parameters available.
+ * @param params The parameters to use for the evaluation.
+ * @param translations A translation support object to be assigned to the variable 'translations'
+ * @return A new evaluation context.
+ */
+ IEvaluationContext createContext(Object[] params, ITranslationSupport translations);
+
+ /**
+ * This method assigns <code>candidate</code> to the 'item' variable of the
+ * <code>context</code> and then evaluates the expression.
+ * @param context A context previously created with {@link #createContext(Object[])}
+ * @param candidate The object to test.
+ * @return the result of the evaluation.
+ */
+ boolean isMatch(IEvaluationContext context, Object candidate);
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IQueryContext.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IQueryContext.java
new file mode 100644
index 0000000..efc4820
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/IQueryContext.java
@@ -0,0 +1,10 @@
+package org.eclipse.equinox.p2.ql;
+
+import java.util.Iterator;
+import java.util.Locale;
+
+public interface IQueryContext {
+ ITranslationSupport getTranslationSupport(Locale locale);
+
+ Iterator iterator();
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/ITranslationSupport.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/ITranslationSupport.java
new file mode 100644
index 0000000..0efb192
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/ITranslationSupport.java
@@ -0,0 +1,7 @@
+package org.eclipse.equinox.p2.ql;
+
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+
+public interface ITranslationSupport {
+ String getIUProperty(IInstallableUnit iu, String key);
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QL.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QL.java
new file mode 100644
index 0000000..5b951b6
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QL.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+import java.util.Iterator;
+import org.eclipse.equinox.internal.p2.ql.QueryContext;
+import org.eclipse.equinox.internal.p2.ql.expression.ExpressionFactory;
+import org.eclipse.equinox.internal.p2.ql.parser.ExpressionParser;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
+
+/**
+ * The public access point to all QL functionality.
+ */
+public abstract class QL {
+ /**
+ * Returns the default expression factory.
+ * @return the default expression factory.
+ */
+ public static IExpressionFactory getFactory() {
+ return ExpressionFactory.INSTANCE;
+ }
+
+ /**
+ * Creates a new instance of the default expression parser.
+ * @return the new parser.
+ */
+ public static IExpressionParser newParser() {
+ return new ExpressionParser(getFactory());
+ }
+
+ /**
+ * Creates a query context based on the given queryable
+ * @param queryable The queryable to use for the creation of the context
+ * @return A new context
+ */
+ public static IQueryContext newQueryContext(IQueryable queryable) {
+ return new QueryContext(queryable);
+ }
+
+ /**
+ * Creates a query context based on the given iterator
+ * @param iterator The iterator to use for the creation of the context
+ * @return A new context
+ */
+ public static IQueryContext newQueryContext(Iterator iterator) {
+ return new QueryContext(iterator);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLContextQuery.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLContextQuery.java
new file mode 100644
index 0000000..9d97f82
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLContextQuery.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+import java.util.Iterator;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
+import org.eclipse.equinox.p2.metadata.IVersionedId;
+
+/**
+ * An IQuery 'context query' implementation that is based on the p2 query language.
+ */
+public class QLContextQuery extends QLQuery {
+ private final IContextExpression expression;
+
+ /**
+ * Creates a new query instance with indexed parameters.
+ * @param elementClass The class used for filtering elements in 'everything'
+ * @param expression The expression that represents the query.
+ * @param parameters Parameters to use for the query.
+ */
+ public QLContextQuery(Class elementClass, IContextExpression expression, Object[] parameters) {
+ super(elementClass, parameters);
+ this.expression = expression;
+ }
+
+ /**
+ * Creates a new query instance with keyed parameters.
+ * @param elementClass The class used for filtering elements in 'everything'
+ * @param expression The expression that represents the query.
+ * @param parameters Parameters to use for the query.
+ */
+ public QLContextQuery(Class elementClass, String expression, Object[] parameters) {
+ this(elementClass, parser.parseQuery(expression), parameters);
+ }
+
+ /**
+ * Convenience method that creates a new query instance without parameters.
+ * The element class defaults to {@link IVersionedId}.
+ * @param elementClass The class used for filtering elements in 'everything'
+ * @param expression The expression string that represents the query.
+ */
+ public QLContextQuery(String expression) {
+ this(IVersionedId.class, expression, noParameters);
+ }
+
+ /**
+ * Convenience method that creates a new query instance with one parameter.
+ * The element class defaults to {@link IVersionedId}.
+ * @param elementClass The class used for filtering elements in 'everything'
+ * @param expression The expression string that represents the query.
+ * @param param The first parameter.
+ */
+ public QLContextQuery(String expression, Object param) {
+ this(IVersionedId.class, expression, new Object[] {param});
+ }
+
+ /**
+ * Convenience method that creates a new query instance with two parameters.
+ * The element class defaults to {@link IVersionedId}.
+ * @param elementClass The class used for filtering elements in 'everything'
+ * @param expression The expression string that represents the query.
+ * @param param1 The first parameter.
+ * @param param2 The second parameter.
+ */
+ public QLContextQuery(String expression, Object param1, Object param2) {
+ this(IVersionedId.class, expression, new Object[] {param1, param2});
+ }
+
+ /**
+ * Convenience method that creates a new query instance with three parameters.
+ * The element class defaults to {@link IVersionedId}.
+ * @param elementClass The class used for filtering elements in 'everything'
+ * @param expression The expression string that represents the query.
+ * @param param1 The first parameter.
+ * @param param2 The second parameter.
+ * @param param2 The third parameter.
+ */
+ public QLContextQuery(String expression, Object param1, Object param2, Object param3) {
+ this(IVersionedId.class, expression, new Object[] {param1, param2, param3});
+ }
+
+ public Collector perform(Iterator iterator, Collector collector) {
+ iterator = evaluate(iterator);
+ while (iterator.hasNext()) {
+ Object nxt = iterator.next();
+ if (!collector.accept(nxt))
+ break;
+ }
+ return collector;
+ }
+
+ public Iterator evaluate(Iterator iterator) {
+ IEvaluationContext ctx;
+ if (expression.needsTranslations()) {
+ IQueryContext queryContext = QL.newQueryContext(iterator);
+ ctx = expression.createContext(elementClass, iterator, parameters, queryContext.getTranslationSupport(getLocale()));
+ } else
+ ctx = expression.createContext(elementClass, iterator, parameters);
+ return expression.evaluateAsIterator(ctx);
+ }
+
+ /**
+ * Query without using a collector. Instead, return the result of the query directly.
+ * @param queryContext The context for the query.
+ * @return The result of the query.
+ */
+ public Object query(IQueryContext queryContext) {
+ // Check if we need translation support
+ //
+ IEvaluationContext ctx;
+ if (expression.needsTranslations())
+ ctx = expression.createContext(elementClass, queryContext.iterator(), parameters, queryContext.getTranslationSupport(getLocale()));
+ else
+ ctx = expression.createContext(elementClass, queryContext.iterator(), parameters);
+ return expression.evaluate(ctx);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLMatchQuery.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLMatchQuery.java
new file mode 100644
index 0000000..c639b67
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLMatchQuery.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+import java.util.Iterator;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IMatchQuery;
+import org.eclipse.equinox.p2.metadata.IVersionedId;
+
+/**
+ * An IQuery implementation that is based on the p2 query language.
+ */
+public class QLMatchQuery extends QLQuery implements IMatchQuery {
+ private final IMatchExpression expression;
+ private IEvaluationContext context;
+
+ /**
+ * Creates a new query instance with indexed parameters.
+ * @param elementClass The class used for filtering elements before calling {@link #isMatch(Object)}
+ * @param expression The expression that represents the query.
+ * @param parameters Parameters to use for the query.
+ */
+ public QLMatchQuery(Class instanceClass, IMatchExpression expression, Object[] parameters) {
+ super(instanceClass, parameters);
+ this.expression = expression;
+ }
+
+ /**
+ * Creates a new query instance with indexed parameters.
+ * @param elementClass The class used for filtering elements before calling {@link #isMatch(Object)}
+ * @param expression The expression that represents the query.
+ * @param parameters Parameters to use for the query.
+ */
+ public QLMatchQuery(Class instanceClass, String expression, Object[] parameters) {
+ this(instanceClass, parser.parsePredicate(expression), parameters);
+ }
+
+ /**
+ * Convenience method that creates a new query instance without parameters.
+ * The element class defaults to {@link IVersionedId}.
+ * @param expression The expression string that represents the query.
+ */
+ public QLMatchQuery(String expression) {
+ this(IVersionedId.class, expression, (Object[]) null);
+ }
+
+ /**
+ * Convenience method that creates a new query instance with one parameter.
+ * The element class defaults to {@link IVersionedId}.
+ * @param expression The expression string that represents the query.
+ * @param param The first parameter.
+ */
+ public QLMatchQuery(String expression, Object param1) {
+ this(IVersionedId.class, expression, new Object[] {param1});
+ }
+
+ /**
+ * Convenience method that creates a new query instance with two parameters.
+ * The element class defaults to {@link IVersionedId}.
+ * @param expression The expression string that represents the query.
+ * @param param1 The first parameter.
+ * @param param2 The second parameter.
+ */
+ public QLMatchQuery(String expression, Object param1, Object param2) {
+ this(IVersionedId.class, expression, new Object[] {param1, param2});
+ }
+
+ /**
+ * Convenience method that creates a new query instance with three parameters.
+ * The element class defaults to {@link IVersionedId}.
+ * @param expression The expression string that represents the query.
+ * @param param1 The first parameter.
+ * @param param2 The second parameter.
+ * @param param2 The third parameter.
+ */
+ public QLMatchQuery(String expression, Object param1, Object param2, Object param3) {
+ this(IVersionedId.class, parser.parsePredicate(expression), new Object[] {param1, param2, param3});
+ }
+
+ /**
+ * Checks if the <code>candidate</code> object is an instance of the <code>elementClass</code>
+ * used by this query. If it is, the result calling {@link IMatchExpression#isMatch(IEvaluationContext, Object)}
+ * on the contained expression is returned.
+ * @param candidate The object to test
+ * @return <code>true</code> if <code>candidate</code> is an instance of the element class and the
+ * expression match test returns true.
+ */
+ public boolean isMatch(Object candidate) {
+ return elementClass.isInstance(candidate) && expression.isMatch(context, candidate);
+ }
+
+ public void postPerform() {
+ context = null;
+ }
+
+ public void prePerform() {
+ //
+ }
+
+ public Collector perform(Iterator iterator, Collector collector) {
+ if (expression.needsTranslations()) {
+ IQueryContext queryContext = QL.newQueryContext(iterator);
+ context = expression.createContext(parameters, queryContext.getTranslationSupport(getLocale()));
+ } else
+ context = expression.createContext(parameters);
+
+ prePerform();
+ try {
+ while (iterator.hasNext()) {
+ Object candidate = iterator.next();
+ if (isMatch(candidate))
+ if (!collector.accept(candidate))
+ break;
+ }
+ return collector;
+ } finally {
+ postPerform();
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLParseException.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLParseException.java
new file mode 100644
index 0000000..b4fc8e2
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLParseException.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+/**
+ * An exception used by a query parser that indicates that something went wrong when
+ * parsing.
+ */
+public class QLParseException extends RuntimeException {
+ private static final long serialVersionUID = -4834995551702455870L;
+
+ public QLParseException(String expression, String message, int position) {
+ super("Parse error in string \"" + expression + "\": " + message + " at position " + position); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLQuery.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLQuery.java
new file mode 100644
index 0000000..43942ae
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/QLQuery.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+import java.util.Locale;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.QueryHelpers;
+import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
+import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
+
+/**
+ * An IQuery 'context query' implementation that is based on the p2 query language.
+ */
+public abstract class QLQuery implements IQuery {
+ static final IExpressionParser parser = QL.newParser();
+ static final Object[] noParameters = new Object[0];
+
+ final Class elementClass;
+ final Object[] parameters;
+ private Locale locale;
+
+ protected QLQuery(Class elementClass, Object[] parameters) {
+ this.elementClass = elementClass;
+ this.parameters = parameters;
+ }
+
+ public Object getProperty(String key) {
+ if (IArtifactRepository.QUERY_EXCLUDE_KEYS.equals(key))
+ return Boolean.valueOf(!elementClass.isAssignableFrom(IArtifactKey.class));
+
+ if (IArtifactRepository.QUERY_EXCLUDE_DESCRIPTORS.equals(key))
+ return Boolean.valueOf(!elementClass.isAssignableFrom(IArtifactDescriptor.class));
+
+ return QueryHelpers.getProperty(this, key);
+ }
+
+ public Locale getLocale() {
+ return locale == null ? Locale.getDefault() : locale;
+ }
+
+ public void setLocale(Locale locale) {
+ this.locale = locale;
+ }
+
+ /**
+ * Gets the ID for this Query.
+ */
+ public String getId() {
+ return QueryHelpers.getId(this);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/SimplePattern.java b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/SimplePattern.java
new file mode 100644
index 0000000..cd94a39
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ql/src/org/eclipse/equinox/p2/ql/SimplePattern.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.ql;
+
+/**
+ * A simple compiled pattern. It supports two kinds of wildcards. The '*' (any character zero to many times)
+ * and the '?' (any character exactly one time).
+ */
+public class SimplePattern {
+ /**
+ * Matches the <code>value</code> with the compiled expression. The value
+ * is considered matching if all characters are matched by the expression. A
+ * partial match is not enough.
+ * @param value The value to match
+ * @return <code>true</code> if the value was a match.
+ */
+ public boolean isMatch(CharSequence value) {
+ return node.match(value, 0);
+ }
+
+ private final Node node;
+
+ private SimplePattern(Node node) {
+ this.node = node;
+ }
+
+ private static class RubberBandNode extends Node {
+ RubberBandNode(Node next) {
+ super(next);
+ }
+
+ boolean match(CharSequence value, int pos) {
+ if (next == null)
+ return true;
+
+ int top = value.length();
+ while (pos < top) {
+ if (next.match(value, pos++))
+ return true;
+ }
+ return false;
+ }
+ }
+
+ private static class AnyCharacterNode extends Node {
+ AnyCharacterNode(Node next) {
+ super(next);
+ }
+
+ boolean match(CharSequence value, int pos) {
+ int top = value.length();
+ return next == null ? pos + 1 == top : next.match(value, pos + 1);
+ }
+ }
+
+ private static class ConstantNode extends Node {
+ final String constant;
+
+ ConstantNode(Node next, String constant) {
+ super(next);
+ this.constant = constant;
+ }
+
+ boolean match(CharSequence value, int pos) {
+ int vtop = value.length();
+ int ctop = constant.length();
+ if (ctop + pos > vtop)
+ return false;
+
+ for (int idx = 0; idx < ctop; ++idx, ++pos)
+ if (constant.charAt(idx) != value.charAt(pos))
+ return false;
+
+ return next == null ? true : next.match(value, pos);
+ }
+ }
+
+ private static abstract class Node {
+ final Node next;
+
+ Node(Node next) {
+ this.next = next;
+ }
+
+ abstract boolean match(CharSequence value, int pos);
+ }
+
+ public static SimplePattern compile(String pattern) {
+ if (pattern == null)
+ throw new IllegalArgumentException("Pattern can not be null"); //$NON-NLS-1$
+
+ return new SimplePattern(parse(pattern, 0));
+ }
+
+ private static Node parse(String pattern, int pos) {
+ int top = pattern.length();
+ StringBuffer bld = null;
+ Node parsedNode = null;
+ while (pos < top) {
+ char c = pattern.charAt(pos);
+ switch (c) {
+ case '*' :
+ parsedNode = new RubberBandNode(parse(pattern, pos + 1));
+ break;
+ case '?' :
+ parsedNode = new AnyCharacterNode(parse(pattern, pos + 1));
+ break;
+ case '\\' :
+ if (++pos == top)
+ throw new IllegalArgumentException("Pattern ends with escape"); //$NON-NLS-1$
+ c = pattern.charAt(pos);
+ // fall through
+ default :
+ if (bld == null)
+ bld = new StringBuffer();
+ bld.append(c);
+ ++pos;
+ continue;
+ }
+ break;
+ }
+
+ if (bld != null)
+ parsedNode = new ConstantNode(parsedNode, bld.toString());
+ return parsedNode;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.classpath b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.classpath
deleted file mode 100644
index 6f3b481..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.cvsignore b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.cvsignore
deleted file mode 100644
index ba077a4..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.project b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.project
deleted file mode 100644
index 4de3c83..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.project
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.equinox.simpleconfigurator.manipulator</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ds.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index c143032..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,265 +0,0 @@
-#Fri Nov 14 17:13:48 EST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=false
-org.eclipse.jdt.core.formatter.comment.format_header=true
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
-org.eclipse.jdt.core.formatter.comment.format_line_comments=false
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=800
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=false
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index fe84d45..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,57 +0,0 @@
-#Sun Sep 23 11:59:48 EDT 2007
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_core
-formatter_settings_version=11
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=;
-org.eclipse.jdt.ui.ondemandthreshold=3
-org.eclipse.jdt.ui.staticondemandthreshold=3
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=true
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.format_source_code=true
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_variable_declarations_final=true
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=false
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=false
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=true
-sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=false
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/META-INF/MANIFEST.MF
deleted file mode 100644
index ef29ba0..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %bundleName
-Bundle-SymbolicName: org.eclipse.equinox.simpleconfigurator.manipulator;singleton:=true
-Bundle-Version: 1.0.200.qualifier
-Bundle-Localization: plugin
-Bundle-ActivationPolicy: lazy
-Import-Package: org.eclipse.equinox.internal.frameworkadmin.equinox,
- org.eclipse.equinox.internal.frameworkadmin.utils,
- org.eclipse.equinox.internal.provisional.configuratormanipulator,
- org.eclipse.equinox.internal.provisional.frameworkadmin,
- org.eclipse.equinox.internal.simpleconfigurator.utils,
- org.osgi.framework;version="1.3.0"
-Bundle-Vendor: %providerName
-Export-Package: org.eclipse.equinox.internal.provisional.simpleconfigurator.manipulator;x-friends:="org.eclipse.pde.core,org.eclipse.equinox.p2.metadata.generator,org.eclipse.equinox.p2.publisher",
- org.eclipse.equinox.internal.simpleconfigurator.manipulator;x-friends:="org.eclipse.equinox.p2.touchpoint.eclipse"
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
-Require-Bundle: org.eclipse.equinox.common;bundle-version="3.5.0"
-Service-Component: OSGI-INF/configurator.xml
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/OSGI-INF/configurator.xml b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/OSGI-INF/configurator.xml
deleted file mode 100644
index 181e07a..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/OSGI-INF/configurator.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.equinox.simpleconfigurator.manipulator">
- <implementation class="org.eclipse.equinox.internal.simpleconfigurator.manipulator.SimpleConfiguratorManipulatorImpl"/>
- <property name="org.eclipse.equinox.configurator.BundleSymbolicName" type="String" value="org.eclipse.equinox.simpleconfigurator"/>
- <property name="service.vendor" type="String" value="Eclipse.org"/>
- <service>
- <provide interface="org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulator"/>
- <provide interface="org.eclipse.equinox.internal.provisional.simpleconfigurator.manipulator.SimpleConfiguratorManipulator"/>
- </service>
-</scr:component>
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/about.html b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/about.html
deleted file mode 100644
index 4602330..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/build.properties b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/build.properties
deleted file mode 100644
index 3d8dfe4..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html,\
- plugin.properties,\
- OSGI-INF/
-src.includes = about.html
-qualifier = context
-source.. = src/
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/plugin.properties b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/plugin.properties
deleted file mode 100644
index 71be7bb..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2007, 2009 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
-###############################################################################
-bundleName= Simple Configurator Manipulator
-providerName = Eclipse.org - Equinox
-
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/provisional/simpleconfigurator/manipulator/SimpleConfiguratorManipulator.java b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/provisional/simpleconfigurator/manipulator/SimpleConfiguratorManipulator.java
deleted file mode 100644
index 4a96d46..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/provisional/simpleconfigurator/manipulator/SimpleConfiguratorManipulator.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 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.provisional.simpleconfigurator.manipulator;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulator;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo;
-
-public interface SimpleConfiguratorManipulator extends ConfiguratorManipulator {
- /**
- * An instance of an ISimpleConfiguratorManipulator is registered as a ConfiguratorManipulator
- * service with ConfiguratorManipulator.SERVICE_PROP_KEY_CONFIGURATOR_BUNDLESYMBOLICNAME =
- * SERVICE_PROP_VALUE_CONFIGURATOR_SYMBOLICNAME.
- */
- public static final String SERVICE_PROP_VALUE_CONFIGURATOR_SYMBOLICNAME = "org.eclipse.equinox.simpleconfigurator"; //$NON-NLS-1$
-
- /**
- *
- * @param url
- * @param launcherLocation
- * @return The loaded configuration
- * @throws IOException
- */
- public BundleInfo[] loadConfiguration(URL url, File launcherLocation) throws IOException;
-
- /**
- *
- * @param configuration
- * @param outputFile
- * @param base
- * @throws IOException
- */
- public void saveConfiguration(BundleInfo[] configuration, File outputFile, File base) throws IOException;
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorFactoryImpl.java b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorFactoryImpl.java
deleted file mode 100644
index 3819aac..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorFactoryImpl.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * 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 org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulator;
-import org.eclipse.equinox.internal.provisional.configuratormanipulator.ConfiguratorManipulatorFactory;
-
-public class SimpleConfiguratorManipulatorFactoryImpl extends ConfiguratorManipulatorFactory {
-
- protected ConfiguratorManipulator createConfiguratorManipulator() {
- return new SimpleConfiguratorManipulatorImpl();
- }
-
-}
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
deleted file mode 100644
index 65915df..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorImpl.java
+++ /dev/null
@@ -1,456 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URL;
-import java.util.*;
-import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.ParserUtils;
-import org.eclipse.equinox.internal.frameworkadmin.utils.Utils;
-import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
-import org.eclipse.equinox.internal.provisional.simpleconfigurator.manipulator.SimpleConfiguratorManipulator;
-import org.eclipse.equinox.internal.simpleconfigurator.utils.SimpleConfiguratorUtils;
-import org.osgi.framework.Constants;
-
-/**
- *
- */
-public class SimpleConfiguratorManipulatorImpl implements SimpleConfiguratorManipulator {
- class LocationInfo {
- URI[] prerequisiteLocations = null;
- URI systemBundleLocation = null;
- URI[] systemFragmentedBundleLocations = null;
- }
-
- private final static boolean DEBUG = false;
-
- private static final BundleInfo[] NULL_BUNDLEINFOS = new BundleInfo[0];
-
- 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$
-
- private Set manipulators = new HashSet();
-
- /**
- * Return the ConfiguratorConfigFile which is determined
- * by the parameters set in Manipulator.
- *
- * @param manipulator
- * @return File
- */
- private static File getConfigFile(Manipulator manipulator) throws IllegalStateException {
- File fwConfigLoc = manipulator.getLauncherData().getFwConfigLocation();
- File baseDir = null;
- if (fwConfigLoc == null) {
- baseDir = manipulator.getLauncherData().getHome();
- if (baseDir == null) {
- if (manipulator.getLauncherData().getLauncher() != null) {
- baseDir = manipulator.getLauncherData().getLauncher().getParentFile();
- } else {
- throw new IllegalStateException("All of fwConfigFile, home, launcher are not set.");
- }
- }
- } else {
- if (fwConfigLoc.exists())
- if (fwConfigLoc.isDirectory())
- baseDir = fwConfigLoc;
- else
- baseDir = fwConfigLoc.getParentFile();
- else {
- // TODO We need to decide whether launcher data configLocation is the location of a file or a directory
- if (fwConfigLoc.getName().endsWith(".ini")) //$NON-NLS-1$
- baseDir = fwConfigLoc.getParentFile();
- else
- baseDir = fwConfigLoc;
- }
- }
- File configuratorFolder = new File(baseDir, SimpleConfiguratorManipulatorImpl.CONFIGURATOR_FOLDER);
- File targetFile = new File(configuratorFolder, SimpleConfiguratorManipulatorImpl.CONFIG_LIST);
- if (!Utils.createParentDir(targetFile))
- return null;
- return targetFile;
- }
-
- static boolean isPrerequisiteBundles(URI location, LocationInfo info) {
- boolean ret = false;
-
- if (info.prerequisiteLocations == null)
- return false;
- for (int i = 0; i < info.prerequisiteLocations.length; i++)
- if (location.equals(info.prerequisiteLocations[i])) {
- ret = true;
- break;
- }
-
- return ret;
- }
-
- static boolean isSystemBundle(URI location, LocationInfo info) {
- if (info.systemBundleLocation == null)
- return false;
- if (location.equals(info.systemBundleLocation))
- return true;
- return false;
- }
-
- static boolean isSystemFragmentBundle(URI location, LocationInfo info) {
- boolean ret = false;
- if (info.systemFragmentedBundleLocations == null)
- return false;
- for (int i = 0; i < info.systemFragmentedBundleLocations.length; i++)
- if (location.equals(info.systemFragmentedBundleLocations[i])) {
- ret = true;
- break;
- }
- return ret;
- }
-
- private static boolean isTargetConfiguratorBundle(BundleInfo[] bInfos) {
- for (int i = 0; i < bInfos.length; i++) {
- if (isTargetConfiguratorBundle(bInfos[i].getLocation())) {
- return true;
- //TODO confirm that startlevel of configurator bundle must be no larger than beginning start level of fw. However, there is no way to know the start level of cached ones.
- }
- }
- return false;
- }
-
- private static boolean isTargetConfiguratorBundle(URI location) {
- final String symbolic = Utils.getPathFromClause(Utils.getManifestMainAttributes(location, Constants.BUNDLE_SYMBOLICNAME));
- return (SimpleConfiguratorManipulator.SERVICE_PROP_VALUE_CONFIGURATOR_SYMBOLICNAME.equals(symbolic));
- }
-
- private void algorithm(int initialSl, SortedMap bslToList, BundleInfo configuratorBInfo, List setToInitialConfig, List setToSimpleConfig, LocationInfo info) {
- int configuratorSL = configuratorBInfo.getStartLevel();
-
- Integer sL0 = (Integer) bslToList.keySet().iterator().next();// StartLevel == 0;
- List list0 = (List) bslToList.get(sL0);
- if (sL0.intValue() == 0)
- for (Iterator ite2 = list0.iterator(); ite2.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite2.next();
- if (isSystemBundle(bInfo.getLocation(), info)) {
- setToSimpleConfig.add(bInfo);
- break;
- }
- }
-
- for (Iterator ite = bslToList.keySet().iterator(); ite.hasNext();) {
- Integer sL = (Integer) ite.next();
- List list = (List) bslToList.get(sL);
-
- if (sL.intValue() < configuratorSL) {
- for (Iterator ite2 = list.iterator(); ite2.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite2.next();
- if (!isSystemBundle(bInfo.getLocation(), info))
- setToInitialConfig.add(bInfo);
- }
- } else if (sL.intValue() > configuratorSL) {
- for (Iterator ite2 = list.iterator(); ite2.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite2.next();
- if (isPrerequisiteBundles(bInfo.getLocation(), info) || isSystemFragmentBundle(bInfo.getLocation(), info))
- if (!isSystemBundle(bInfo.getLocation(), info))
- setToInitialConfig.add(bInfo);
- setToSimpleConfig.add(bInfo);
- }
- } else {
- boolean found = false;
- for (Iterator ite2 = list.iterator(); ite2.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite2.next();
- if (found) {
- if (!isSystemBundle(bInfo.getLocation(), info))
- if (isPrerequisiteBundles(bInfo.getLocation(), info) || isSystemFragmentBundle(bInfo.getLocation(), info))
- setToInitialConfig.add(bInfo);
- setToSimpleConfig.add(bInfo);
- continue;
- }
- if (isTargetConfiguratorBundle(bInfo.getLocation()))
- found = true;
- else if (!isSystemBundle(bInfo.getLocation(), info))
- setToInitialConfig.add(bInfo);
- setToSimpleConfig.add(bInfo);
- }
- }
- }
-
- setToInitialConfig.add(configuratorBInfo);
- }
-
- private boolean checkResolve(BundleInfo bInfo, BundlesState state) {//throws ManipulatorException {
- if (bInfo == null)
- throw new IllegalArgumentException("bInfo is null.");
-
- if (!state.isResolved())
- state.resolve(false);
- // if (DEBUG)
- // System.out.println(state.toString());
-
- if (!state.isResolved(bInfo)) {
- printoutUnsatisfiedConstraints(bInfo, state);
- return false;
- }
- return true;
- }
-
- private boolean divideBundleInfos(Manipulator manipulator, List setToInitialConfig, List setToSimpleConfig, final int initialBSL) throws IOException {
- BundlesState state = manipulator.getBundlesState();
- BundleInfo[] targetBundleInfos = null;
- if (state.isFullySupported()) {
- targetBundleInfos = state.getExpectedState();
- } else {
- targetBundleInfos = manipulator.getConfigData().getBundles();
- }
- BundleInfo configuratorBInfo = null;
- for (int i = 0; i < targetBundleInfos.length; i++) {
- if (isTargetConfiguratorBundle(targetBundleInfos[i].getLocation())) {
- if (targetBundleInfos[i].isMarkedAsStarted()) {
- configuratorBInfo = targetBundleInfos[i];
- break;
- }
- }
- }
- if (configuratorBInfo == null && !manipulators.contains(manipulator)) {
- return false;
- } else if (manipulators.contains(manipulator) && targetBundleInfos.length == 0) {
- // Resulting state will have no bundles - so is an uninstall, including
- // uninstall of the configurator. However, we have seen this manipulator
- // before with a target configurator bundle, so allow uninstall to proceed,
- // but only get one chance.
- manipulators.remove(manipulator);
- } else if (!manipulators.contains(manipulator)) {
- manipulators.add(manipulator);
- }
-
- if (state.isFullySupported()) {
- state.resolve(false);
- }
-
- LocationInfo info = new LocationInfo();
- setSystemBundles(state, info);
- if (configuratorBInfo != null) {
- setPrerequisiteBundles(configuratorBInfo, state, info);
- SortedMap bslToList = getSortedMap(initialBSL, targetBundleInfos);
- algorithm(initialBSL, bslToList, configuratorBInfo, setToInitialConfig, setToSimpleConfig, info);
- }
- return true;
- }
-
- private SortedMap getSortedMap(int initialSl, BundleInfo[] bInfos) {
- SortedMap bslToList = new TreeMap();
- for (int i = 0; i < bInfos.length; i++) {
- Integer sL = new Integer(bInfos[i].getStartLevel());
- if (sL.intValue() == BundleInfo.NO_LEVEL)
- sL = new Integer(initialSl);
- List list = (List) bslToList.get(sL);
- if (list == null) {
- list = new LinkedList();
- bslToList.put(sL, list);
- }
- list.add(bInfos[i]);
- }
- return bslToList;
- }
-
- private BundleInfo[] orderingInitialConfig(List setToInitialConfig) {
- List notToBeStarted = new LinkedList();
- List toBeStarted = new LinkedList();
- for (Iterator ite2 = setToInitialConfig.iterator(); ite2.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite2.next();
- if (bInfo.isMarkedAsStarted())
- toBeStarted.add(bInfo);
- else
- notToBeStarted.add(bInfo);
- }
- setToInitialConfig.clear();
- setToInitialConfig.addAll(notToBeStarted);
- setToInitialConfig.addAll(toBeStarted);
- return Utils.getBundleInfosFromList(setToInitialConfig);
-
- }
-
- private void printoutUnsatisfiedConstraints(BundleInfo bInfo, BundlesState state) {
- if (DEBUG) {
- StringBuffer sb = new StringBuffer();
- sb.append("Missing constraints:\n");
- String[] missings = state.getUnsatisfiedConstraints(bInfo);
- for (int i = 0; i < missings.length; i++)
- sb.append(" " + missings[i] + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- System.out.println(sb.toString());
- }
- }
-
- public BundleInfo[] loadConfiguration(URL url, File base) throws IOException {
- if (url == null)
- return NULL_BUNDLEINFOS;
-
- List simpleBundles = SimpleConfiguratorUtils.readConfiguration(url, base != null ? base.toURI() : null);
-
- // convert to FrameworkAdmin BundleInfo Type
- BundleInfo[] result = new BundleInfo[simpleBundles.size()];
- int i = 0;
- for (Iterator iterator = simpleBundles.iterator(); iterator.hasNext();) {
- org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo simpleInfo = (org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo) iterator.next();
- URI location = simpleInfo.getLocation();
- if (!location.isAbsolute() && simpleInfo.getBaseLocation() != null)
- location = URIUtil.makeAbsolute(location, simpleInfo.getBaseLocation());
-
- BundleInfo bundleInfo = new BundleInfo(simpleInfo.getSymbolicName(), simpleInfo.getVersion(), location, simpleInfo.getStartLevel(), simpleInfo.isMarkedAsStarted());
- result[i++] = bundleInfo;
- }
- return result;
- }
-
- public void saveConfiguration(BundleInfo[] configuration, File outputFile, File base) throws IOException {
- saveConfiguration(configuration, outputFile, base, false);
- }
-
- private void saveConfiguration(BundleInfo[] configuration, File outputFile, File base, boolean backup) throws IOException {
- if (backup && outputFile.exists()) {
- File backupFile = Utils.getSimpleDataFormattedFile(outputFile);
- if (!outputFile.renameTo(backupFile)) {
- throw new IOException("Fail to rename from (" + outputFile + ") to (" + backupFile + ")");
- }
- }
-
- // convert to SimpleConfigurator BundleInfo Type
- org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo[] simpleInfos = new org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo[configuration.length];
- for (int i = 0; i < configuration.length; i++) {
- BundleInfo bundleInfo = configuration[i];
- String symbolicName = bundleInfo.getSymbolicName();
- String bundleVersion = bundleInfo.getVersion();
- URI location = base != null ? URIUtil.makeRelative(bundleInfo.getLocation(), base.toURI()) : bundleInfo.getLocation();
- if (symbolicName == null || bundleVersion == null || location == null)
- throw new IllegalArgumentException("Cannot persist bundleinfo: " + bundleInfo.toString());
- simpleInfos[i] = new org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo(symbolicName, bundleVersion, location, bundleInfo.getStartLevel(), bundleInfo.isMarkedAsStarted());
- }
- SimpleConfiguratorManipulatorUtils.writeConfiguration(simpleInfos, outputFile);
- }
-
- public BundleInfo[] save(Manipulator manipulator, boolean backup) throws IOException {
- List setToInitialConfig = new LinkedList();
- List setToSimpleConfig = new LinkedList();
- ConfigData configData = manipulator.getConfigData();
-
- if (!divideBundleInfos(manipulator, setToInitialConfig, setToSimpleConfig, configData.getInitialBundleStartLevel()))
- return configData.getBundles();
-
- File outputFile = getConfigFile(manipulator);
- saveConfiguration((BundleInfo[]) setToSimpleConfig.toArray(new BundleInfo[setToSimpleConfig.size()]), outputFile, ParserUtils.getOSGiInstallArea(Arrays.asList(manipulator.getLauncherData().getProgramArgs()), manipulator.getConfigData().getProperties(), manipulator.getLauncherData()), backup);
- configData.setProperty(SimpleConfiguratorManipulatorImpl.PROP_KEY_CONFIGURL, outputFile.toURL().toExternalForm());
- return orderingInitialConfig(setToInitialConfig);
- }
-
- void setPrerequisiteBundles(BundleInfo configuratorBundleInfo, BundlesState state, LocationInfo info) {
- if (state.isFullySupported())
- if (!this.checkResolve(configuratorBundleInfo, state)) {
- printoutUnsatisfiedConstraints(configuratorBundleInfo, state);
- return;
- }
- BundleInfo[] prerequisites = state.getPrerequisteBundles(configuratorBundleInfo);
- info.prerequisiteLocations = new URI[prerequisites.length];
- for (int i = 0; i < prerequisites.length; i++)
- info.prerequisiteLocations[i] = prerequisites[i].getLocation();
- return;
-
- }
-
- void setSystemBundles(BundlesState state, LocationInfo info) {
- BundleInfo systemBundleInfo = state.getSystemBundle();
- if (systemBundleInfo == null) {
- // TODO Log
- //throw new IllegalStateException("There is no systemBundle.\n");
- return;
- }
- if (state.isFullySupported())
- if (!this.checkResolve(systemBundleInfo, state)) {
- printoutUnsatisfiedConstraints(systemBundleInfo, state);
- return;
- }
- info.systemBundleLocation = systemBundleInfo.getLocation();
- BundleInfo[] fragments = state.getSystemFragmentedBundles();
- info.systemFragmentedBundleLocations = new URI[fragments.length];
- for (int i = 0; i < fragments.length; i++)
- info.systemFragmentedBundleLocations[i] = fragments[i].getLocation();
- }
-
- public void updateBundles(Manipulator manipulator) throws IOException {
- if (DEBUG)
- System.out.println("SimpleConfiguratorManipulatorImpl#updateBundles()"); //$NON-NLS-1$
-
- BundlesState bundleState = manipulator.getBundlesState();
-
- if (bundleState == null)
- return;
- if (bundleState.isFullySupported())
- bundleState.resolve(true);
-
- BundleInfo[] currentBInfos = bundleState.getExpectedState();
- if (!isTargetConfiguratorBundle(currentBInfos))
- return;
- Properties properties = new Properties();
- String[] jvmArgs = manipulator.getLauncherData().getJvmArgs();
- for (int i = 0; i < jvmArgs.length; i++) {
- if (jvmArgs[i].startsWith("-D")) { //$NON-NLS-1$
- int index = jvmArgs[i].indexOf("="); //$NON-NLS-1$
- if (index > 0 && jvmArgs[i].length() > 2) {
- String key = jvmArgs[i].substring(2, index);
- String value = jvmArgs[i].substring(index + 1);
- properties.setProperty(key, value);
- }
- }
- }
-
- Utils.appendProperties(properties, manipulator.getConfigData().getProperties());
- boolean exclusiveInstallation = Boolean.valueOf(properties.getProperty(SimpleConfiguratorManipulatorImpl.PROP_KEY_EXCLUSIVE_INSTALLATION)).booleanValue();
- File configFile = getConfigFile(manipulator);
-
- BundleInfo[] toInstall = loadConfiguration(configFile.toURL(), ParserUtils.getOSGiInstallArea(Arrays.asList(manipulator.getLauncherData().getProgramArgs()), manipulator.getConfigData().getProperties(), manipulator.getLauncherData()));
-
- List toUninstall = new LinkedList();
- if (exclusiveInstallation)
- for (int i = 0; i < currentBInfos.length; i++) {
- boolean install = false;
- for (int j = 0; j < toInstall.length; j++)
- if (currentBInfos[i].getLocation().equals(toInstall[j].getLocation())) {
- install = true;
- break;
- }
- if (!install)
- toUninstall.add(currentBInfos[i]);
- }
-
- for (int i = 0; i < toInstall.length; i++) {
- try {
- bundleState.installBundle(toInstall[i]);
- } catch (RuntimeException e) {
- //Ignore
- }
- }
- if (exclusiveInstallation)
- for (Iterator ite = toUninstall.iterator(); ite.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite.next();
- bundleState.uninstallBundle(bInfo);
- }
-
- bundleState.resolve(true);
- manipulator.getConfigData().setBundles(bundleState.getExpectedState());
- }
-
- public void cleanup(Manipulator manipulator) {
- File outputFile = getConfigFile(manipulator);
- outputFile.delete();
-
- if (outputFile.getParentFile().isDirectory())
- outputFile.getParentFile().delete();
- }
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java
deleted file mode 100644
index 7c3a1ba..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 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.io.*;
-import java.net.URI;
-import java.util.Arrays;
-import java.util.Comparator;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.Messages;
-import org.eclipse.equinox.internal.frameworkadmin.utils.Utils;
-import org.eclipse.equinox.internal.provisional.simpleconfigurator.manipulator.SimpleConfiguratorManipulator;
-import org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo;
-import org.osgi.framework.Version;
-
-public class SimpleConfiguratorManipulatorUtils {
-
- private static final String VERSION_PREFIX = "#version="; //$NON-NLS-1$
- private static final String VERSION_1 = "1"; //$NON-NLS-1$
- private static final Version OLD_STYLE_SIMPLE_CONFIGURATOR_VERSION = new Version("1.0.100.v20081206"); //$NON-NLS-1$
-
- public static void writeConfiguration(BundleInfo[] simpleInfos, File outputFile) throws IOException {
-
- // if empty remove the configuration file
- if (simpleInfos == null || simpleInfos.length == 0) {
- if (outputFile.exists()) {
- outputFile.delete();
- }
- File parentDir = outputFile.getParentFile();
- if (parentDir.exists()) {
- parentDir.delete();
- }
- return;
- }
-
- // sort by symbolic name
- Arrays.sort(simpleInfos, new Comparator() {
- public int compare(Object o1, Object o2) {
- if (o1 instanceof BundleInfo && o2 instanceof BundleInfo) {
- return ((BundleInfo) o1).getSymbolicName().compareTo(((BundleInfo) o2).getSymbolicName());
- }
- return 0;
- }
- });
-
- if (!Utils.createParentDir(outputFile)) {
- throw new IllegalStateException(Messages.exception_failedToCreateDir);
- }
- BufferedWriter writer = null;
- IOException caughtException = null;
- boolean oldStyle = false;
- for (int i = 0; i < simpleInfos.length; i++) {
- if (SimpleConfiguratorManipulator.SERVICE_PROP_VALUE_CONFIGURATOR_SYMBOLICNAME.equals(simpleInfos[i].getSymbolicName())) {
- Version version = new Version(simpleInfos[i].getVersion());
- if (version.compareTo(OLD_STYLE_SIMPLE_CONFIGURATOR_VERSION) < 0)
- oldStyle = true;
- break;
- }
- }
-
- try {
- writer = new BufferedWriter(new FileWriter(outputFile));
- // version line
- writer.write(createVersionLine());
- writer.newLine();
-
- // bundle info lines
- for (int i = 0; i < simpleInfos.length; i++) {
- writer.write(createBundleInfoLine(simpleInfos[i], oldStyle));
- writer.newLine();
- }
- } catch (IOException e) {
- caughtException = e;
- } finally {
- if (writer != null) {
- try {
- writer.close();
- } catch (IOException e) {
- // we want to avoid over-writing the original exception
- if (caughtException != null)
- caughtException = e;
- }
- }
- }
- if (caughtException != null)
- throw caughtException;
- }
-
- public static String createVersionLine() {
- return VERSION_PREFIX + VERSION_1;
- }
-
- public static String createBundleInfoLine(BundleInfo bundleInfo, boolean oldStyle) {
- // symbolicName,version,location,startLevel,markedAsStarted
- StringBuffer buffer = new StringBuffer();
- buffer.append(bundleInfo.getSymbolicName());
- buffer.append(',');
- buffer.append(bundleInfo.getVersion());
- buffer.append(',');
- buffer.append(createBundleLocation(bundleInfo.getLocation(), oldStyle));
- buffer.append(',');
- buffer.append(bundleInfo.getStartLevel());
- buffer.append(',');
- buffer.append(bundleInfo.isMarkedAsStarted());
- return buffer.toString();
- }
-
- public static String createBundleLocation(URI location, boolean oldStyle) {
- if (oldStyle) {
- String scheme = location.getScheme();
- if (scheme == null)
- scheme = "file"; //$NON-NLS-1$
- return scheme + ':' + location.getSchemeSpecificPart();
- }
-
- //encode comma characters because it is used as the segment delimiter in the bundle info file
- String result = location.toString();
- int commaIndex = result.indexOf(',');
- while (commaIndex != -1) {
- result = result.substring(0, commaIndex) + "%2C" + result.substring(commaIndex + 1); //$NON-NLS-1$
- commaIndex = result.indexOf(',');
- }
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/.classpath b/bundles/org.eclipse.equinox.simpleconfigurator/.classpath
deleted file mode 100644
index 6f3b481..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/.cvsignore b/bundles/org.eclipse.equinox.simpleconfigurator/.cvsignore
deleted file mode 100644
index e043cc4..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-build.xml
-javaCompiler...args
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/.externalToolBuilders/Copy built version of simple configurator into metadata generator.launch b/bundles/org.eclipse.equinox.simpleconfigurator/.externalToolBuilders/Copy built version of simple configurator into metadata generator.launch
deleted file mode 100644
index b68ad48..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/.externalToolBuilders/Copy built version of simple configurator into metadata generator.launch
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
-<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
-<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.equinox.simpleconfigurator"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="4"/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
-<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.equinox.simpleconfigurator"/>
-<mapAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_PROPERTIES">
-<mapEntry key="buildDirectory" value="${build_project}/trash"/>
-<mapEntry key="targetFolder" value="${resource_loc:/org.eclipse.equinox.p2.metadata.generator}"/>
-<mapEntry key="eclipse.pdebuild.scripts" value="/D:/eclipse/plugins/org.eclipse.pde.build_3.3.0.v20070312/scripts/"/>
-<mapEntry key="eclipse.running" value="true"/>
-<mapEntry key="thisPlugin" value="${resource_loc:/org.eclipse.equinox.simpleconfigurator}"/>
-<mapEntry key="eclipse.pdebuild.templates" value="/D:/eclipse/plugins/org.eclipse.pde.build_3.3.0.v20070312/templates/"/>
-<mapEntry key="eclipse.pdebuild.home" value="/D:/eclipse/plugins/org.eclipse.pde.build_3.3.0.v20070312/./"/>
-<mapEntry key="eclipse.home" value="D:\eclipse"/>
-<mapEntry key="baseLocation" value="${target_home}"/>
-</mapAttribute>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.equinox.simpleconfigurator/localbuild.xml}"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
-<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
-</launchConfiguration>
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/.project b/bundles/org.eclipse.equinox.simpleconfigurator/.project
deleted file mode 100644
index b0cc0f9..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/.project
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.equinox.simpleconfigurator</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
- <triggers>full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>LaunchConfigHandle</key>
- <value><project>/.externalToolBuilders/Copy built version of simple configurator into metadata generator.launch</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.simpleconfigurator/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 34a383a..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,270 +0,0 @@
-#Wed Jan 07 13:39:09 EST 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=false
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
-org.eclipse.jdt.core.formatter.comment.format_line_comments=false
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=true
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=800
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.simpleconfigurator/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 40cde68..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,61 +0,0 @@
-#Wed Jan 07 13:39:10 EST 2009
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_core
-formatter_settings_version=11
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=;
-org.eclipse.jdt.ui.ondemandthreshold=3
-org.eclipse.jdt.ui.staticondemandthreshold=3
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=true
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=true
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=true
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=false
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=false
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=true
-sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=false
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.simpleconfigurator/META-INF/MANIFEST.MF
deleted file mode 100644
index c46f6d1..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,27 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.equinox.simpleconfigurator;singleton:=true
-Bundle-Version: 1.0.200.qualifier
-Bundle-Name: %bundleName
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Bundle-Activator: org.eclipse.equinox.internal.simpleconfigurator.Activator
-Bundle-ActivationPolicy: lazy
-Import-Package: org.eclipse.osgi.framework.console;version="1.0.0";resolution:=optional,
- org.eclipse.osgi.service.datalocation;version="1.0.0";resolution:=optional,
- org.eclipse.osgi.service.resolver;version="1.2.0";resolution:=optional,
- org.osgi.framework;version="1.3.0",
- org.osgi.service.packageadmin;version="1.2.0",
- org.osgi.service.startlevel;version="1.0.0",
- org.osgi.util.tracker;version="1.3.0"
-Export-Package: org.eclipse.equinox.internal.provisional.configurator;
- x-friends:="org.eclipse.equinox.p2.reconciler.dropins,
- org.eclipse.equinox.p2.console,
- org.eclipse.equinox.p2.operations,
- org.eclipse.equinox.p2.ui,
- org.eclipse.equinox.p2.director",
- org.eclipse.equinox.internal.simpleconfigurator;x-internal:=true,
- org.eclipse.equinox.internal.simpleconfigurator.console;x-internal:=true,
- org.eclipse.equinox.internal.simpleconfigurator.utils;x-friends:="org.eclipse.equinox.simpleconfigurator.manipulator"
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/about.html b/bundles/org.eclipse.equinox.simpleconfigurator/about.html
deleted file mode 100644
index 4602330..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/build.properties b/bundles/org.eclipse.equinox.simpleconfigurator/build.properties
deleted file mode 100644
index ac72e5e..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 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
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html,\
- plugin.properties
-qualifier=context
-src.includes = about.html
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/localbuild.xml b/bundles/org.eclipse.equinox.simpleconfigurator/localbuild.xml
deleted file mode 100644
index a5d7fd7..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/localbuild.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<!-- ======================================================================
- Mar 14, 2007 11:17:02 AM
-
- project
- description
-
- Administrator
- ====================================================================== -->
-<project name="project" default="default">
- <description>
- description
- </description>
-
- <!-- =================================
- target: default
- ================================= -->
- <target name="default" description="--> description">
- <echo message="bd is ${buildDirectory}"/>
- <tstamp/>
- <eclipse.buildScript elements="plugin@org.eclipse.equinox.simpleconfigurator"
- buildDirectory="${buildDirectory}"
- configInfo="*,*,*"
- baseLocation="${baseLocation}"
- buildingOSGi="true"
- outputUpdateJars="false"
- pluginpath="${thisPlugin}"
- forceContextQualifier="z${DSTAMP}${TSTAMP}"
- />
- <ant antfile="build.xml" target="build.jars"/>
- <ant antfile="build.xml" target="build.update.jar"/>
- <move todir="${targetFolder}" includeEmptyDirs="no" failonerror="yes">
- <fileset dir="${basedir}">
- <include name="*.jar"/>
- </fileset>
- <regexpmapper from="^(.*)_.*$" to="\1.jar"/>
- </move>
- <ant antfile="build.xml" target="clean"/>
- <delete file="build.xml"/>
- <delete file="javaCompiler...args"/>
- </target>
-
-
-</project>
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/plugin.properties b/bundles/org.eclipse.equinox.simpleconfigurator/plugin.properties
deleted file mode 100644
index b9da99e..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2009 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
-###############################################################################
-bundleName= Simple Configurator
-providerName = Eclipse.org - Equinox
-
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/provisional/configurator/Configurator.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/provisional/configurator/Configurator.java
deleted file mode 100644
index 2291eb6..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/provisional/configurator/Configurator.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * 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.provisional.configurator;
-
-import java.io.IOException;
-import java.net.URL;
-
-/**
- * The implementation of this interface will be registered into a service registry
- * by a Configurator Bundle.
- *
- * The client bundle can apply configuration which can be interpreted by referring
- * the specified location to the current running OSGi environment. In addition,
- * the client can expect bundle state in advance .
- *
- * TODO: this interface might not be required to be defined.
- *
- *
- * **********************************************
- * Current Definition of Configurator Bundle:
- *
- * Configurator Bundle will do the following operation at its startup.
- *
- * 1. Create a Configurator object.
- * 2. Register it as a service to the service registry.
- * 3. Get where to read for knowing what kinds of bundles in its implementation dependent way.
- * 4. Call {@link Configurator#applyConfiguration(URL)} with the URL.
- *
- * At its stopping, the service registered will be unregistered.
- *
- * @see ConfiguratorManipulator
- *
- */
-public interface Configurator {
-
- /**
- * Apply configuration read from the specified url to the OSGi
- * environment currently running.
- *
- * @param url URL to be read.
- * @throws IOException - If reading information from the specified url fails.
- */
- void applyConfiguration(URL url) throws IOException;
-
- /**
- * Apply configuration read from the previously used url to the OSGi
- * environment currently running. If it is never used, do nothing.
- *
- * @throws IOException - If reading information from the specified url fails.
- */
- void applyConfiguration() throws IOException;
-
- /**
- * Return the url in use.
- * If it is never used, return null.
- *
- * @return
- */
- URL getUrlInUse();
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/Activator.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/Activator.java
deleted file mode 100644
index 333df29..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/Activator.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * 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;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-import org.eclipse.equinox.internal.provisional.configurator.Configurator;
-import org.eclipse.equinox.internal.simpleconfigurator.utils.EquinoxUtils;
-import org.eclipse.equinox.internal.simpleconfigurator.utils.SimpleConfiguratorConstants;
-import org.osgi.framework.*;
-
-/**
- * At its start, SimpleConfigurator bundle does the followings.
- *
- * 1. A value will be gotten by @{link BundleContext#getProperty(key)} with
- * {@link SimpleConfiguratorConstants#PROP_KEY_CONFIGURL} as a key.
- * The value will be used for the referal URL. Under the url, there must be a simple
- * bundles list file to be installed with thier start level and flag of marked as started.
- *
- * 2. If the value is null, do nothing any more.
- * 3. Otherwise, retrieve the bundles list from the url and install,
- * set start level of and start bundles, as specified.
- *
- * 4. A value will be gotten by @{link BundleContext#getProperty(key)} with
- * {@link SimpleConfiguratorConstants#PROP_KEY_EXCLUSIVE_INSTALLATION} as a key.
- *
- * 5. If it equals "false", it will do exclusive installation, which means that
- * the bundles will not be listed in the specified url but installed at the time
- * of the method call except SystemBundle will be uninstalled.
- * Otherwise, no uninstallation will not be done.
- *
- */
-public class Activator implements BundleActivator {
- public final static boolean DEBUG = false;
- private ServiceRegistration configuratorRegistration;
- private ServiceRegistration commandRegistration;
-
- public void start(BundleContext context) throws Exception {
- SimpleConfiguratorImpl bundleConfigurator = new SimpleConfiguratorImpl(context, context.getBundle());
- bundleConfigurator.applyConfiguration();
-
- Dictionary props = new Hashtable();
- props.put(Constants.SERVICE_VENDOR, "Eclipse"); //$NON-NLS-1$
- props.put(Constants.SERVICE_PID, SimpleConfiguratorConstants.TARGET_CONFIGURATOR_NAME);
- ServiceFactory configurationFactory = new SimpleConfiguratorFactory(context);
- configuratorRegistration = context.registerService(Configurator.class.getName(), configurationFactory, props);
-
- try {
- if (null != context.getBundle().loadClass("org.eclipse.osgi.framework.console.CommandProvider")) //$NON-NLS-1$
- commandRegistration = EquinoxUtils.registerConsoleCommands(context);
- } catch (ClassNotFoundException e) {
- // CommandProvider is not available
- // Ok -- optional
- }
-
- if (DEBUG)
- System.out.println("registered Configurator"); //$NON-NLS-1$
- }
-
- public void stop(BundleContext context) throws Exception {
- if (configuratorRegistration != null) {
- configuratorRegistration.unregister();
- configuratorRegistration = null;
- }
- if (commandRegistration != null) {
- commandRegistration.unregister();
- commandRegistration = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java
deleted file mode 100644
index 1da445c..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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;
-
-import java.io.*;
-import java.net.URI;
-import java.net.URL;
-import java.util.*;
-import org.eclipse.equinox.internal.simpleconfigurator.utils.*;
-import org.osgi.framework.*;
-import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.service.startlevel.StartLevel;
-
-class ConfigApplier {
- private static final String LAST_BUNDLES_INFO = "last.bundles.info"; //$NON-NLS-1$
- private static final String PROP_DEVMODE = "osgi.dev"; //$NON-NLS-1$
-
- private final BundleContext manipulatingContext;
- private final PackageAdmin packageAdminService;
- private final StartLevel startLevelService;
- private final boolean runningOnEquinox;
- private final boolean inDevMode;
-
- private final Bundle callingBundle;
- private final URI baseLocation;
-
- ConfigApplier(BundleContext context, Bundle callingBundle) {
- manipulatingContext = context;
- this.callingBundle = callingBundle;
- runningOnEquinox = "Eclipse".equals(context.getProperty(Constants.FRAMEWORK_VENDOR)); //$NON-NLS-1$
- inDevMode = manipulatingContext.getProperty(PROP_DEVMODE) != null;
- baseLocation = runningOnEquinox ? EquinoxUtils.getInstallLocationURI(context) : null;
-
- ServiceReference packageAdminRef = manipulatingContext.getServiceReference(PackageAdmin.class.getName());
- if (packageAdminRef == null)
- throw new IllegalStateException("No PackageAdmin service is available."); //$NON-NLS-1$
- packageAdminService = (PackageAdmin) manipulatingContext.getService(packageAdminRef);
-
- ServiceReference startLevelRef = manipulatingContext.getServiceReference(StartLevel.class.getName());
- if (startLevelRef == null)
- throw new IllegalStateException("No StartLevelService service is available."); //$NON-NLS-1$
- startLevelService = (StartLevel) manipulatingContext.getService(startLevelRef);
- }
-
- void install(URL url, boolean exclusiveMode) throws IOException {
- List bundleInfoList = SimpleConfiguratorUtils.readConfiguration(url, baseLocation);
- if (Activator.DEBUG)
- System.out.println("applyConfiguration() bundleInfoList.size()=" + bundleInfoList.size());
- if (bundleInfoList.size() == 0)
- return;
-
- BundleInfo[] expectedState = Utils.getBundleInfosFromList(bundleInfoList);
-
- // check for an update to the system bundle
- String systemBundleSymbolicName = manipulatingContext.getBundle(0).getSymbolicName();
- Version systemBundleVersion = manipulatingContext.getBundle(0).getVersion();
- if (systemBundleSymbolicName != null) {
- for (int i = 0; i < expectedState.length; i++) {
- String symbolicName = expectedState[i].getSymbolicName();
- if (!systemBundleSymbolicName.equals(symbolicName))
- continue;
-
- Version version = Version.parseVersion(expectedState[i].getVersion());
- if (!systemBundleVersion.equals(version))
- throw new IllegalStateException("The System Bundle was updated. The framework must be restarted to finalize the configuration change");
- }
- }
-
- HashSet toUninstall = null;
- if (!exclusiveMode) {
- BundleInfo[] lastInstalledBundles = getLastState();
- if (lastInstalledBundles != null) {
- toUninstall = new HashSet(Arrays.asList(lastInstalledBundles));
- toUninstall.removeAll(Arrays.asList(expectedState));
- }
- saveStateAsLast(url);
- }
-
- Collection prevouslyResolved = getResolvedBundles();
- Collection toRefresh = new ArrayList();
- Collection toStart = new ArrayList();
- if (exclusiveMode) {
- toRefresh.addAll(installBundles(expectedState, toStart));
- toRefresh.addAll(uninstallBundles(expectedState, packageAdminService));
- } else {
- toRefresh.addAll(installBundles(expectedState, toStart));
- if (toUninstall != null)
- toRefresh.addAll(uninstallBundles(toUninstall));
- }
- refreshPackages((Bundle[]) toRefresh.toArray(new Bundle[toRefresh.size()]), manipulatingContext);
- if (toRefresh.size() > 0)
- try {
- manipulatingContext.getBundle().loadClass("org.eclipse.osgi.service.resolver.PlatformAdmin"); //$NON-NLS-1$
- // now see if there are any currently resolved bundles with option imports which could be resolved or
- // if there are fragments with additional constraints which conflict with an already resolved host
- Bundle[] additionalRefresh = StateResolverUtils.getAdditionalRefresh(prevouslyResolved, manipulatingContext);
- if (additionalRefresh.length > 0)
- refreshPackages(additionalRefresh, manipulatingContext);
- } catch (ClassNotFoundException cnfe) {
- // do nothing; no resolver package available
- }
- startBundles((Bundle[]) toStart.toArray(new Bundle[toStart.size()]));
- }
-
- private Collection getResolvedBundles() {
- Collection resolved = new HashSet();
- Bundle[] allBundles = manipulatingContext.getBundles();
- for (int i = 0; i < allBundles.length; i++)
- if ((allBundles[i].getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0)
- resolved.add(allBundles[i]);
- return resolved;
- }
-
- private Collection uninstallBundles(HashSet toUninstall) {
- Collection removedBundles = new ArrayList(toUninstall.size());
- for (Iterator iterator = toUninstall.iterator(); iterator.hasNext();) {
- BundleInfo current = (BundleInfo) iterator.next();
- Bundle[] matchingBundles = packageAdminService.getBundles(current.getSymbolicName(), getVersionRange(current.getVersion()));
- for (int j = 0; matchingBundles != null && j < matchingBundles.length; j++) {
- try {
- removedBundles.add(matchingBundles[j]);
- matchingBundles[j].uninstall();
- } catch (BundleException e) {
- //TODO log in debug mode...
- }
- }
- }
- return removedBundles;
- }
-
- private void saveStateAsLast(URL url) {
- InputStream sourceStream = null;
- OutputStream destinationStream = null;
-
- File lastBundlesTxt = getLastBundleInfo();
- try {
- try {
- destinationStream = new FileOutputStream(lastBundlesTxt);
- sourceStream = url.openStream();
- SimpleConfiguratorUtils.transferStreams(sourceStream, destinationStream);
- } finally {
- if (destinationStream != null)
- destinationStream.close();
- if (sourceStream != null)
- sourceStream.close();
- }
- } catch (IOException e) {
- //nothing
- }
- }
-
- private File getLastBundleInfo() {
- return manipulatingContext.getDataFile(LAST_BUNDLES_INFO);
- }
-
- private BundleInfo[] getLastState() {
- File lastBundlesInfo = getLastBundleInfo();
- if (!lastBundlesInfo.isFile())
- return null;
- try {
- return (BundleInfo[]) SimpleConfiguratorUtils.readConfiguration(lastBundlesInfo.toURL(), baseLocation).toArray(new BundleInfo[1]);
- } catch (IOException e) {
- return null;
- }
- }
-
- private ArrayList installBundles(BundleInfo[] finalList, Collection toStart) {
- ArrayList toRefresh = new ArrayList();
-
- String useReferenceProperty = manipulatingContext.getProperty(SimpleConfiguratorConstants.PROP_KEY_USE_REFERENCE);
- boolean useReference = useReferenceProperty == null ? runningOnEquinox : Boolean.valueOf(useReferenceProperty).booleanValue();
-
- for (int i = 0; i < finalList.length; i++) {
- if (finalList[i] == null)
- continue;
- //TODO here we do not deal with bundles that don't have a symbolic id
- //TODO Need to handle the case where getBundles return multiple value
-
- String symbolicName = finalList[i].getSymbolicName();
- String version = finalList[i].getVersion();
-
- Bundle[] matches = null;
- if (symbolicName != null && version != null)
- matches = packageAdminService.getBundles(symbolicName, getVersionRange(version));
-
- String bundleLocation = SimpleConfiguratorUtils.getBundleLocation(finalList[i], useReference);
-
- Bundle current = matches == null ? null : (matches.length == 0 ? null : matches[0]);
- if (current == null) {
- try {
- current = manipulatingContext.installBundle(bundleLocation);
- if (Activator.DEBUG)
- System.out.println("installed bundle:" + finalList[i]); //$NON-NLS-1$
- toRefresh.add(current);
- } catch (BundleException e) {
- if (Activator.DEBUG) {
- System.err.println("Can't install " + symbolicName + '/' + version + " from location " + finalList[i].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$
- e.printStackTrace();
- }
- continue;
- }
- } else if (inDevMode && current.getBundleId() != 0 && current != manipulatingContext.getBundle() && !bundleLocation.equals(current.getLocation()) && !current.getLocation().startsWith("initial@")) {
- // We do not do this for the system bundle (id==0), the manipulating bundle or any bundle installed from the osgi.bundles list (locations starting with "@initial"
- // The bundle exists; but the location is different. Uninstall the current and install the new one (bug 229700)
- try {
- current.uninstall();
- toRefresh.add(current);
- } catch (BundleException e) {
- if (Activator.DEBUG) {
- System.err.println("Can't uninstall " + symbolicName + '/' + version + " from location " + current.getLocation()); //$NON-NLS-1$ //$NON-NLS-2$
- e.printStackTrace();
- }
- continue;
- }
- try {
- current = manipulatingContext.installBundle(bundleLocation);
- if (Activator.DEBUG)
- System.out.println("installed bundle:" + finalList[i]); //$NON-NLS-1$
- toRefresh.add(current);
- } catch (BundleException e) {
- if (Activator.DEBUG) {
- System.err.println("Can't install " + symbolicName + '/' + version + " from location " + finalList[i].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$
- e.printStackTrace();
- }
- continue;
- }
- }
-
- // Mark Started
- if (finalList[i].isMarkedAsStarted()) {
- toStart.add(current);
- }
-
- // Set Start Level
- int startLevel = finalList[i].getStartLevel();
- if (startLevel < 1)
- continue;
- if (current.getBundleId() == 0)
- continue;
- if (packageAdminService.getBundleType(current) == PackageAdmin.BUNDLE_TYPE_FRAGMENT)
- continue;
- if (SimpleConfiguratorConstants.TARGET_CONFIGURATOR_NAME.equals(current.getSymbolicName()))
- continue;
-
- try {
- startLevelService.setBundleStartLevel(current, startLevel);
- } catch (IllegalArgumentException ex) {
- Utils.log(4, null, null, "Failed to set start level of Bundle:" + finalList[i], ex); //$NON-NLS-1$
- }
- }
- return toRefresh;
- }
-
- private void refreshPackages(Bundle[] bundles, BundleContext context) {
- if (bundles.length == 0 || packageAdminService == null)
- return;
-
- final boolean[] flag = new boolean[] {false};
- FrameworkListener listener = new FrameworkListener() {
- public void frameworkEvent(FrameworkEvent event) {
- if (event.getType() == FrameworkEvent.PACKAGES_REFRESHED) {
- synchronized (flag) {
- flag[0] = true;
- flag.notifyAll();
- }
- }
- }
- };
- context.addFrameworkListener(listener);
- packageAdminService.refreshPackages(bundles);
- synchronized (flag) {
- while (!flag[0]) {
- try {
- flag.wait();
- } catch (InterruptedException e) {
- //ignore
- }
- }
- }
- // if (DEBUG) {
- // for (int i = 0; i < bundles.length; i++) {
- // System.out.println(SimpleConfiguratorUtils.getBundleStateString(bundles[i]));
- // }
- // }
- context.removeFrameworkListener(listener);
- }
-
- private void startBundles(Bundle[] bundles) {
- for (int i = 0; i < bundles.length; i++) {
- Bundle bundle = bundles[i];
- if (bundle.getState() == Bundle.UNINSTALLED) {
- System.err.println("Could not start: " + bundle.getSymbolicName() + '(' + bundle.getLocation() + ':' + bundle.getBundleId() + ')' + ". It's state is uninstalled.");
- continue;
- }
- if (bundle.getState() == Bundle.STARTING && (bundle == callingBundle || bundle == manipulatingContext.getBundle()))
- continue;
- if (packageAdminService.getBundleType(bundle) == PackageAdmin.BUNDLE_TYPE_FRAGMENT)
- continue;
-
- try {
- bundle.start();
- if (Activator.DEBUG)
- System.out.println("started Bundle:" + bundle.getSymbolicName() + '(' + bundle.getLocation() + ':' + bundle.getBundleId() + ')'); //$NON-NLS-1$
- } catch (BundleException e) {
- e.printStackTrace();
- // FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, NLS.bind(EclipseAdaptorMsg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null);
- // log.log(entry);
- }
- }
- }
-
- /**
- * Uninstall bundles which are not listed on finalList.
- *
- * @param finalList bundles list not to be uninstalled.
- * @param packageAdmin package admin service.
- * @return Collection HashSet of bundles finally installed.
- */
- private Collection uninstallBundles(BundleInfo[] finalList, PackageAdmin packageAdmin) {
- Bundle[] allBundles = manipulatingContext.getBundles();
-
- //Build a set with all the bundles from the system
- Set removedBundles = new HashSet(allBundles.length);
- // configurator.setPrerequisiteBundles(allBundles);
- for (int i = 0; i < allBundles.length; i++) {
- if (allBundles[i].getBundleId() == 0)
- continue;
- removedBundles.add(allBundles[i]);
- }
-
- //Remove all the bundles appearing in the final list from the set of installed bundles
- for (int i = 0; i < finalList.length; i++) {
- if (finalList[i] == null)
- continue;
- Bundle[] toAdd = packageAdmin.getBundles(finalList[i].getSymbolicName(), getVersionRange(finalList[i].getVersion()));
- for (int j = 0; toAdd != null && j < toAdd.length; j++) {
- removedBundles.remove(toAdd[j]);
- }
- }
-
- for (Iterator iter = removedBundles.iterator(); iter.hasNext();) {
- try {
- Bundle bundle = ((Bundle) iter.next());
- if (bundle.getLocation().startsWith("initial@")) {
- if (Activator.DEBUG)
- System.out.println("Simple configurator thinks a bundle installed by the boot strap should be uninstalled:" + bundle.getSymbolicName() + '(' + bundle.getLocation() + ':' + bundle.getBundleId() + ')'); //$NON-NLS-1$
- // Avoid uninstalling bundles that the boot strap code thinks should be installed (bug 232191)
- iter.remove();
- continue;
- }
- bundle.uninstall();
- if (Activator.DEBUG)
- System.out.println("uninstalled Bundle:" + bundle.getSymbolicName() + '(' + bundle.getLocation() + ':' + bundle.getBundleId() + ')'); //$NON-NLS-1$
- } catch (BundleException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- return removedBundles;
- }
-
- private String getVersionRange(String version) {
- return version == null ? null : new StringBuffer().append('[').append(version).append(',').append(version).append(']').toString();
- }
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorFactory.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorFactory.java
deleted file mode 100644
index 7e8dbeb..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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;
-
-import org.osgi.framework.*;
-
-public class SimpleConfiguratorFactory implements ServiceFactory {
- private BundleContext context;
-
- public SimpleConfiguratorFactory(BundleContext context) {
- this.context = context;
- }
-
- public Object getService(Bundle bundle, ServiceRegistration registration) {
- return new SimpleConfiguratorImpl(context, bundle);
- }
-
- public void ungetService(Bundle bundle, ServiceRegistration registration, Object service) {
- // nothing to do
- }
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorImpl.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorImpl.java
deleted file mode 100644
index 7cbc420..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorImpl.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.*;
-import java.util.List;
-import org.eclipse.equinox.internal.provisional.configurator.Configurator;
-import org.eclipse.equinox.internal.simpleconfigurator.utils.*;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/*
- * SimpleConfigurator provides ways to install bundles listed in a file
- * accessible by the specified URL and expect states for it in advance without
- * actual application.
- *
- * In every methods of SimpleConfiguration object,
- *
- * 1. A value will be gotten by @{link BundleContext#getProperty(key) with
- * {@link SimpleConfiguratorConstants#PROP_KEY_EXCLUSIVE_INSTALLATION} as a key.
- * 2. If it equals "true", it will do exclusive installation, which means that
- * the bundles will not be listed in the specified url but installed at the time
- * of the method call except SystemBundle will be uninstalled. Otherwise, no
- * uninstallation will not be done.
- */
-public class SimpleConfiguratorImpl implements Configurator {
-
- private static URL configurationURL = null;
- private static Object configurationLock = new Object();
-
- private BundleContext context;
- private ConfigApplier configApplier;
- private Bundle bundle;
-
- public SimpleConfiguratorImpl(BundleContext context, Bundle bundle) {
- this.context = context;
- this.bundle = bundle;
- }
-
- private URL getConfigurationURL() throws IOException {
- String specifiedURL = context.getProperty(SimpleConfiguratorConstants.PROP_KEY_CONFIGURL);
- if (specifiedURL == null)
- specifiedURL = "file:" + SimpleConfiguratorConstants.CONFIGURATOR_FOLDER + "/" + SimpleConfiguratorConstants.CONFIG_LIST;
-
- try {
- //If it is not a file URL use it as is
- if (!specifiedURL.startsWith("file:"))
- return new URL(specifiedURL);
- } catch (MalformedURLException e) {
- return null;
- }
-
- try {
- // if it is an absolute file URL, use it as is
- boolean done = false;
- URL url = null;
- String file = specifiedURL;
- while (!done) {
- // TODO what is this while loop for? nested file:file:file: urls?
- try {
- url = Utils.buildURL(file);
- file = url.getFile();
- } catch (java.net.MalformedURLException e) {
- done = true;
- }
- }
- if (url != null && new File(url.getFile()).isAbsolute())
- return url;
-
- //if it is an relative file URL, then resolve it against the configuration area
- // TODO Support relative file URLs when not on Equinox
- URL[] configURL = EquinoxUtils.getConfigAreaURL(context);
- if (configURL != null) {
- File userConfig = new File(configURL[0].getFile(), url.getFile());
- if (configURL.length == 1)
- return userConfig.exists() ? userConfig.toURL() : null;
-
- File sharedConfig = new File(configURL[1].getFile(), url.getFile());
- if (!userConfig.exists())
- return sharedConfig.exists() ? sharedConfig.toURL() : null;
-
- if (!sharedConfig.exists())
- return userConfig.toURL();
-
- URI base = EquinoxUtils.getInstallLocationURI(context);
-
- URL sharedConfigURL = sharedConfig.toURL();
- List sharedBundles = SimpleConfiguratorUtils.readConfiguration(sharedConfigURL, base);
-
- URL userConfigURL = userConfig.toURL();
- List userBundles = SimpleConfiguratorUtils.readConfiguration(userConfigURL, base);
-
- return (userBundles.containsAll(sharedBundles)) ? userConfigURL : sharedConfigURL;
- }
- } catch (MalformedURLException e) {
- return null;
- }
-
- //Last resort
- try {
- return Utils.buildURL(specifiedURL);
- } catch (MalformedURLException e) {
- //Ignore
- }
-
- return null;
- }
-
- public void applyConfiguration(URL url) throws IOException {
- synchronized (configurationLock) {
- if (Activator.DEBUG)
- System.out.println("applyConfiguration() URL=" + url);
- if (url == null)
- return;
- configurationURL = url;
-
- if (this.configApplier == null)
- configApplier = new ConfigApplier(context, bundle);
- configApplier.install(url, isExclusiveInstallation());
- }
- }
-
- private boolean isExclusiveInstallation() {
- String value = context.getProperty(SimpleConfiguratorConstants.PROP_KEY_EXCLUSIVE_INSTALLATION);
- if (value == null || value.trim().length() == 0)
- value = "true";
- return Boolean.valueOf(value).booleanValue();
- }
-
- public void applyConfiguration() throws IOException {
- synchronized (configurationLock) {
- configurationURL = getConfigurationURL();
- applyConfiguration(configurationURL);
- }
- }
-
- public URL getUrlInUse() {
- synchronized (configurationLock) {
- return configurationURL;
- }
- }
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/console/ApplyCommand.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/console/ApplyCommand.java
deleted file mode 100644
index b4bb8b0..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/console/ApplyCommand.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * 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.console;
-
-import java.io.IOException;
-import java.net.URL;
-import org.eclipse.equinox.internal.provisional.configurator.Configurator;
-import org.eclipse.osgi.framework.console.CommandInterpreter;
-import org.osgi.framework.BundleContext;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * An OSGi console command to apply a configuration
- */
-public class ApplyCommand {
-
- private URL configURL;
- private CommandInterpreter interpreter;
- private BundleContext context;
-
- public ApplyCommand(CommandInterpreter interpreter, BundleContext context, URL configURL) {
- this.interpreter = interpreter;
- this.context = context;
- this.configURL = configURL;
- }
-
- /**
- * Runs the apply console command
- */
- public void run() {
- ServiceTracker tracker = new ServiceTracker(context, Configurator.class.getName(), null);
- tracker.open();
- Configurator configurator = (Configurator) tracker.getService();
- if (configurator != null) {
- try {
- if (configURL != null)
- configurator.applyConfiguration(configURL);
- else
- configurator.applyConfiguration();
-
- if (configurator.getUrlInUse() == null)
- interpreter.println("Config URL not set.");
- } catch (IOException e) {
- interpreter.println(e.getMessage());
- }
- } else {
- interpreter.println("No configurator registered"); //$NON-NLS-1$
- }
- tracker.close();
- }
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/console/ConfiguratorCommandProvider.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/console/ConfiguratorCommandProvider.java
deleted file mode 100644
index 99b1440..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/console/ConfiguratorCommandProvider.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * 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.console;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import org.eclipse.equinox.internal.simpleconfigurator.utils.Utils;
-import org.eclipse.osgi.framework.console.CommandInterpreter;
-import org.eclipse.osgi.framework.console.CommandProvider;
-import org.osgi.framework.BundleContext;
-
-public class ConfiguratorCommandProvider implements CommandProvider {
- public static final String NEW_LINE = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
- private BundleContext context;
-
- public ConfiguratorCommandProvider(BundleContext context) {
- this.context = context;
- }
-
- /**
- * Returns the given string as an URL, or <code>null</code> if
- * the string could not be interpreted as an URL.
- */
- private URL toURL(CommandInterpreter interpreter, String urlString) {
- try {
- return Utils.buildURL(urlString);
- } catch (MalformedURLException e) {
- interpreter.println(e.getMessage());
- return null;
- }
- }
-
- /**
- * Apply the current configuration
- * @param configuration URL (optional)
- */
- public void _confapply(CommandInterpreter interpreter) {
- String parameter = interpreter.nextArgument();
- URL configURL = null;
- if (parameter != null)
- configURL = toURL(interpreter, parameter);
-
- new ApplyCommand(interpreter, context, configURL).run();
- }
-
- public String getHelp() {
- StringBuffer help = new StringBuffer();
- help.append("---"); //$NON-NLS-1$
- help.append("Configurator Commands"); //$NON-NLS-1$
- help.append("---"); //$NON-NLS-1$
- help.append(NEW_LINE);
- help.append("\tconfapply [<config URL>] - Applies a configuration"); //$NON-NLS-1$
- help.append(NEW_LINE);
- return help.toString();
- }
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/BundleInfo.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/BundleInfo.java
deleted file mode 100644
index 8f44d08..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/BundleInfo.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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;
-
-import java.net.URI;
-
-/*
- * This object represents information of a bundle.
- */
-public class BundleInfo {
- public static final int NO_LEVEL = -1;
-
- private String symbolicName = null;
- private String version = null;
- private URI location;
- private URI baseLocation;
-
- private boolean markedAsStarted = false;
- private int startLevel = NO_LEVEL;
-
- public BundleInfo(String symbolic, String version, URI location, int startLevel, boolean started) {
- this.symbolicName = symbolic;
- this.version = version;
- this.location = location;
- this.markedAsStarted = started;
- this.startLevel = startLevel;
- }
-
- public URI getLocation() {
- return location;
- }
-
- public int getStartLevel() {
- return startLevel;
- }
-
- public String getSymbolicName() {
- return symbolicName;
- }
-
- public String getVersion() {
- return version;
- }
-
- public boolean isMarkedAsStarted() {
- return markedAsStarted;
- }
-
- public URI getBaseLocation() {
- return baseLocation;
- }
-
- public void setBaseLocation(URI baseLocation) {
- this.baseLocation = baseLocation;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("BundleInfo("); //$NON-NLS-1$
- if (symbolicName != null)
- buffer.append(symbolicName);
- buffer.append(", "); //$NON-NLS-1$
- if (version != null)
- buffer.append(version);
- if (baseLocation != null) {
- buffer.append(", baseLocation="); //$NON-NLS-1$
- buffer.append(baseLocation);
- }
- buffer.append(", location="); //$NON-NLS-1$
- buffer.append(location);
- buffer.append(", startLevel="); //$NON-NLS-1$
- buffer.append(startLevel);
- buffer.append(", toBeStarted="); //$NON-NLS-1$
- buffer.append(markedAsStarted);
- buffer.append(')');
- return buffer.toString();
- }
-
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((symbolicName == null) ? 0 : symbolicName.hashCode());
- result = prime * result + ((version == null) ? 0 : version.hashCode());
- return result;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
-
- if (obj == null)
- return false;
-
- if (getClass() != obj.getClass())
- return false;
-
- BundleInfo other = (BundleInfo) obj;
- if (symbolicName == null) {
- if (other.symbolicName != null)
- return false;
- } else if (!symbolicName.equals(other.symbolicName))
- return false;
-
- if (version == null) {
- if (other.version != null)
- return false;
- } else if (!version.equals(other.version))
- return false;
-
- if (location == null || other.location == null)
- return true;
-
- //compare absolute location URIs
- URI absoluteLocation = baseLocation == null ? location : URIUtil.append(baseLocation, location.toString());
- URI otherAbsoluteLocation = other.baseLocation == null ? other.location : URIUtil.append(other.baseLocation, other.location.toString());
- return URIUtil.sameURI(absoluteLocation, otherAbsoluteLocation);
- }
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/EquinoxUtils.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/EquinoxUtils.java
deleted file mode 100644
index d0ae2cc..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/EquinoxUtils.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * 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.utils;
-
-import java.net.*;
-import org.eclipse.equinox.internal.simpleconfigurator.console.ConfiguratorCommandProvider;
-import org.eclipse.osgi.framework.console.CommandProvider;
-import org.eclipse.osgi.service.datalocation.Location;
-import org.osgi.framework.*;
-import org.osgi.util.tracker.ServiceTracker;
-
-public class EquinoxUtils {
-
- public static URL[] getConfigAreaURL(BundleContext context) {
- Filter filter = null;
- try {
- filter = context.createFilter(Location.CONFIGURATION_FILTER);
- } catch (InvalidSyntaxException e) {
- // should not happen
- }
- ServiceTracker configLocationTracker = new ServiceTracker(context, filter, null);
- configLocationTracker.open();
- try {
- Location configLocation = (Location) configLocationTracker.getService();
- if (configLocation == null)
- return null;
-
- URL baseURL = configLocation.getURL();
- if (configLocation.getParentLocation() != null && configLocation.getURL() != null) {
- if (baseURL == null)
- return new URL[] {configLocation.getParentLocation().getURL()};
- else
- return new URL[] {baseURL, configLocation.getParentLocation().getURL()};
- }
- if (baseURL != null)
- return new URL[] {baseURL};
-
- return null;
- } finally {
- configLocationTracker.close();
- }
- }
-
- public static URI getInstallLocationURI(BundleContext context) {
- try {
- ServiceReference[] references = context.getServiceReferences(Location.class.getName(), Location.INSTALL_FILTER);
- if (references != null && references.length > 0) {
- ServiceReference reference = references[0];
- Location installLocation = (Location) context.getService(reference);
- if (installLocation != null) {
- try {
- if (installLocation.isSet()) {
- URL location = installLocation.getURL();
- return URIUtil.toURI(location);
- }
- } catch (URISyntaxException e) {
- //TODO: log an error
- } finally {
- context.ungetService(reference);
- }
- }
- }
- } catch (InvalidSyntaxException e) {
- //TODO: log an error
- }
- return null;
- }
-
- public static ServiceRegistration registerConsoleCommands(BundleContext context) {
- return context.registerService(CommandProvider.class.getName(), new ConfiguratorCommandProvider(context), null);
- }
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorConstants.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorConstants.java
deleted file mode 100644
index 425c160..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorConstants.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * 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.utils;
-
-public class SimpleConfiguratorConstants {
- /**
- * If BundleContext#getProperty(PROP_KEY_EXCLUSIVE_INSTALLATION) equals "true" ignoring case,
- * Configurator.applyConfiguration(url) will uninstall the installed bundles which are not
- * listed in the simpleconfigurator config file after install bundles listed.
- * Otherwise, it never uninstall any bundles.
- *
- * Default: true
- */
- public static final String PROP_KEY_EXCLUSIVE_INSTALLATION = "org.eclipse.equinox.simpleconfigurator.exclusiveInstallation"; //$NON-NLS-1$
-
- /**
- * If BundleContext#getProperty(PROP_KEY_USE_REFERENCE) does not equal "false" ignoring case,
- * when a SimpleConfigurator installs a bundle, "reference:" is added to its bundle location in order to avoid
- * caching its bundle jar. Otherwise, it will add nothing to any bundle location.
- *
- * Default: true
- */
- public static final String PROP_KEY_USE_REFERENCE = "org.eclipse.equinox.simpleconfigurator.useReference"; //$NON-NLS-1$
-
- /**
- * BundleContext#getProperty(PROP_KEY_CONFIGURL) is used for SimpleConfigurator to do life cycle control of bundles.
- * The file specified by the returned url is read by SimpleConfigurator and do life cycle control according to it.
- * If improper value or null is returned, SimpleConfigurator doesn't do it.
- *
- * Default: null
- */
- public static final String PROP_KEY_CONFIGURL = "org.eclipse.equinox.simpleconfigurator.configUrl"; //$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 TARGET_CONFIGURATOR_NAME = "org.eclipse.equinox.simpleconfigurator"; //$NON-NLS-1$
-
- public static final String PARAMETER_BASEURL = "org.eclipse.equinox.simpleconfigurator.baseUrl"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java
deleted file mode 100644
index c355703..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import org.eclipse.osgi.service.resolver.VersionRange;
-import org.osgi.framework.Version;
-
-public class SimpleConfiguratorUtils {
-
- private static final String UNC_PREFIX = "//";
- private static final String VERSION_PREFIX = "#version=";
- public static final Version COMPATIBLE_VERSION = new Version(1, 0, 0);
- public static final VersionRange VERSION_TOLERANCE = new VersionRange(COMPATIBLE_VERSION, true, new Version(2, 0, 0), false);
-
- private static final String FILE_SCHEME = "file";
- private static final String REFERENCE_PREFIX = "reference:";
- private static final String FILE_PREFIX = "file:";
- private static final String COMMA = ",";
- private static final String ENCODED_COMMA = "%2C";
-
- public static List readConfiguration(URL url, URI base) throws IOException {
- List bundles = new ArrayList();
-
- BufferedReader r = null;
- try {
- r = new BufferedReader(new InputStreamReader(url.openStream()));
- } catch (IOException e) {
- // if the exception is a FNF we return an empty bundle list
- if (e instanceof FileNotFoundException)
- return bundles;
- throw e;
- }
- try {
- String line;
- while ((line = r.readLine()) != null) {
- line = line.trim();
- //ignore any comment or empty lines
- if (line.length() == 0)
- continue;
-
- if (line.startsWith("#")) {//$NON-NLS-1$
- parseCommentLine(line);
- continue;
- }
-
- BundleInfo bundleInfo = parseBundleInfoLine(line, base);
- if (bundleInfo != null)
- bundles.add(bundleInfo);
- }
- } finally {
- try {
- r.close();
- } catch (IOException ex) {
- // ignore
- }
- }
- return bundles;
- }
-
- public static void parseCommentLine(String line) {
- // version
- if (line.startsWith(VERSION_PREFIX)) {
- String version = line.substring(VERSION_PREFIX.length()).trim();
- if (!VERSION_TOLERANCE.isIncluded(new Version(version)))
- throw new IllegalArgumentException("Invalid version: " + version);
- }
- }
-
- public static BundleInfo parseBundleInfoLine(String line, URI base) {
- // symbolicName,version,location,startLevel,markedAsStarted
- StringTokenizer tok = new StringTokenizer(line, COMMA);
- int numberOfTokens = tok.countTokens();
- if (numberOfTokens < 5)
- throw new IllegalArgumentException("Line does not contain at least 5 tokens: " + line);
-
- String symbolicName = tok.nextToken().trim();
- String version = tok.nextToken().trim();
- URI location = parseLocation(tok.nextToken().trim());
- int startLevel = Integer.parseInt(tok.nextToken().trim());
- boolean markedAsStarted = Boolean.valueOf(tok.nextToken()).booleanValue();
- BundleInfo result = new BundleInfo(symbolicName, version, location, startLevel, markedAsStarted);
- if (!location.isAbsolute())
- result.setBaseLocation(base);
- return result;
- }
-
- public static URI parseLocation(String location) {
- // decode any commas we previously encoded when writing this line
- int encodedCommaIndex = location.indexOf(ENCODED_COMMA);
- while (encodedCommaIndex != -1) {
- location = location.substring(0, encodedCommaIndex) + COMMA + location.substring(encodedCommaIndex + 3);
- encodedCommaIndex = location.indexOf(ENCODED_COMMA);
- }
-
- if (File.separatorChar != '/') {
- int colon = location.indexOf(':');
- String scheme = colon < 0 ? null : location.substring(0, colon);
- if (scheme == null || scheme.equals(FILE_SCHEME))
- location = location.replace(File.separatorChar, '/');
- //if the file is a UNC path, insert extra leading // if needed to make a valid URI (see bug 207103)
- if (scheme == null) {
- if (location.startsWith(UNC_PREFIX) && !location.startsWith(UNC_PREFIX, 2))
- location = UNC_PREFIX + location;
- } else {
- //insert UNC prefix after the scheme
- if (location.startsWith(UNC_PREFIX, colon + 1) && !location.startsWith(UNC_PREFIX, colon + 3))
- location = location.substring(0, colon + 3) + location.substring(colon + 1);
- }
- }
-
- try {
- URI uri = new URI(location);
- if (!uri.isOpaque())
- return uri;
- } catch (URISyntaxException e1) {
- // this will catch the use of invalid URI characters (e.g. spaces, etc.)
- // ignore and fall through
- }
-
- try {
- return URIUtil.fromString(location);
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException("Invalid location: " + location);
- }
- }
-
- public static void transferStreams(InputStream source, OutputStream destination) throws IOException {
- source = new BufferedInputStream(source);
- destination = new BufferedOutputStream(destination);
- try {
- byte[] buffer = new byte[8192];
- while (true) {
- int bytesRead = -1;
- if ((bytesRead = source.read(buffer)) == -1)
- break;
- destination.write(buffer, 0, bytesRead);
- }
- } finally {
- try {
- source.close();
- } catch (IOException e) {
- // ignore
- }
- try {
- destination.close();
- } catch (IOException e) {
- // ignore
- }
- }
- }
-
- // This will produce an unencoded URL string
- public static String getBundleLocation(BundleInfo bundle, boolean useReference) {
- URI location = bundle.getLocation();
- String scheme = location.getScheme();
- String host = location.getHost();
- String path = location.getPath();
-
- if (location.getScheme() == null) {
- URI baseLocation = bundle.getBaseLocation();
- if (baseLocation != null && baseLocation.getScheme() != null) {
- scheme = baseLocation.getScheme();
- host = baseLocation.getHost();
- }
- }
-
- String bundleLocation = null;
- try {
- URL bundleLocationURL = new URL(scheme, host, path);
- bundleLocation = bundleLocationURL.toExternalForm();
-
- } catch (MalformedURLException e1) {
- bundleLocation = location.toString();
- }
-
- if (useReference && bundleLocation.startsWith(FILE_PREFIX))
- bundleLocation = REFERENCE_PREFIX + bundleLocation;
- return bundleLocation;
- }
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/StateResolverUtils.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/StateResolverUtils.java
deleted file mode 100644
index 0b1b5f9..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/StateResolverUtils.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.utils;
-
-import java.util.*;
-import org.eclipse.osgi.service.resolver.*;
-import org.osgi.framework.*;
-
-public class StateResolverUtils {
-
- public static Bundle[] getAdditionalRefresh(Collection currentResolved, BundleContext context) {
- ServiceReference ref = context.getServiceReference(PlatformAdmin.class.getName());
- if (ref == null)
- return new Bundle[0];
- PlatformAdmin platformAdmin = (PlatformAdmin) context.getService(ref);
- if (platformAdmin == null)
- return new Bundle[0];
- try {
- State state = platformAdmin.getState(false);
- BundleDescription[] bundles = state.getBundles();
- HashSet results = new HashSet(bundles.length);
- getAdditionRefresh(bundles, state, currentResolved, results, context);
- return (Bundle[]) results.toArray(new Bundle[results.size()]);
- } finally {
- context.ungetService(ref);
- }
- }
-
- private static void getAdditionRefresh(BundleDescription[] bundleDescriptions, State state, Collection currentResolved, Set results, BundleContext context) {
- bundles: for (int i = 0; i < bundleDescriptions.length; i++) {
- Bundle bundle = context.getBundle(bundleDescriptions[i].getBundleId());
- if (bundle == null)
- continue bundles;
- // look for a fragment which adds a conflicted constraint to an already resolved host
- if (!bundleDescriptions[i].isResolved() && bundleDescriptions[i].getHost() != null) {
- ResolverError[] errors = state.getResolverErrors(bundleDescriptions[i]);
- for (int j = 0; j < errors.length; j++) {
- if ((errors[j].getType() & ResolverError.FRAGMENT_CONFLICT) != 0) {
- BundleDescription[] possibleHosts = state.getBundles(bundleDescriptions[i].getHost().getName());
- for (int k = 0; k < possibleHosts.length; k++) {
- Bundle hostBundle = context.getBundle(possibleHosts[k].getBundleId());
- if (hostBundle != null && currentResolved.contains(hostBundle) && bundleDescriptions[i].getHost().isSatisfiedBy(possibleHosts[k]))
- results.add(hostBundle);
- }
- }
- }
- continue bundles;
- }
- if (!currentResolved.contains(bundle) || !bundleDescriptions[i].isResolved())
- continue bundles;
- // look for optional imports which are unresolved but are resolvable
- ImportPackageSpecification[] imports = bundleDescriptions[i].getImportPackages();
- for (int j = 0; j < imports.length; j++)
- if (ImportPackageSpecification.RESOLUTION_OPTIONAL.equals(imports[j].getDirective(Constants.RESOLUTION_DIRECTIVE)) && !imports[j].isResolved() && state.getStateHelper().isResolvable(imports[j])) {
- results.add(bundle);
- continue bundles;
- }
- // look for optional requires which are unresolved but are resolvable
- BundleSpecification[] requires = bundleDescriptions[i].getRequiredBundles();
- for (int j = 0; j < requires.length; j++)
- if (requires[j].isOptional() && !requires[j].isResolved() && state.getStateHelper().isResolvable(requires[j])) {
- results.add(bundle);
- continue bundles;
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/URIUtil.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/URIUtil.java
deleted file mode 100644
index 7f74610..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/URIUtil.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 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;
-
-import java.io.File;
-import java.net.*;
-
-/**
- * This class copies various methods from the URIUtil class in
- * org.eclipse.equinox.common. Unless otherwise noted the implementations here
- * should mirror those in the common implementation.
- */
-public class URIUtil {
-
- private static final String SCHEME_FILE = "file"; //$NON-NLS-1$
- private static final String UNC_PREFIX = "//"; //$NON-NLS-1$
-
- /**
- * Appends the given extension to the path of the give base URI and returns
- * the corresponding new path.
- * @param base The base URI to append to
- * @param extension The path extension to be added
- * @return The appended URI
- */
- public static URI append(URI base, String extension) {
- try {
- String path = base.getPath();
- if (path == null)
- return appendOpaque(base, extension);
- //if the base is already a directory then resolve will just do the right thing
- if (path.endsWith("/")) {//$NON-NLS-1$
- URI result = base.resolve(extension);
- //Fix UNC paths that are incorrectly normalized by URI#resolve (see Java bug 4723726)
- String resultPath = result.getPath();
- if (path.startsWith(UNC_PREFIX) && (resultPath == null || !resultPath.startsWith(UNC_PREFIX)))
- result = new URI(result.getScheme(), "///" + result.getSchemeSpecificPart(), result.getFragment()); //$NON-NLS-1$
- return result;
- }
- path = path + "/" + extension; //$NON-NLS-1$
- return new URI(base.getScheme(), base.getUserInfo(), base.getHost(), base.getPort(), path, base.getQuery(), base.getFragment());
- } catch (URISyntaxException e) {
- //shouldn't happen because we started from a valid URI
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Special case of appending to an opaque URI. Since opaque URIs
- * have no path segment the best we can do is append to the scheme-specific part
- */
- private static URI appendOpaque(URI base, String extension) throws URISyntaxException {
- String ssp = base.getSchemeSpecificPart();
- if (ssp.endsWith("/")) //$NON-NLS-1$
- ssp += extension;
- else
- ssp = ssp + "/" + extension; //$NON-NLS-1$
- return new URI(base.getScheme(), ssp, base.getFragment());
- }
-
- /**
- * Returns a URI corresponding to the given unencoded string.
- * @throws URISyntaxException If the string cannot be formed into a valid URI
- */
- public static URI fromString(String uriString) throws URISyntaxException {
- int colon = uriString.indexOf(':');
- int hash = uriString.lastIndexOf('#');
- boolean noHash = hash < 0;
- if (noHash)
- hash = uriString.length();
- String scheme = colon < 0 ? null : uriString.substring(0, colon);
- String ssp = uriString.substring(colon + 1, hash);
- String fragment = noHash ? null : uriString.substring(hash + 1);
- //use java.io.File for constructing file: URIs
- if (scheme != null && scheme.equals(SCHEME_FILE)) {
- File file = new File(uriString.substring(5));
- if (file.isAbsolute())
- return file.toURI();
- scheme = null;
- if (File.separatorChar != '/')
- ssp = ssp.replace(File.separatorChar, '/');
- }
- return new URI(scheme, ssp, fragment);
- }
-
- /*
- * Compares two URI for equality.
- * Return false if one of them is null
- */
- public static boolean sameURI(URI url1, URI url2) {
- if (url1 == url2)
- return true;
- if (url1 == null || url2 == null)
- return false;
- if (url1.equals(url2))
- return true;
-
- if (url1.isAbsolute() != url2.isAbsolute())
- return false;
-
- // check if we have two local file references that are case variants
- File file1 = toFile(url1);
- return file1 == null ? false : file1.equals(toFile(url2));
- }
-
- /**
- * Returns the URI as a local file, or <code>null</code> if the given
- * URI does not represent a local file.
- * @param uri The URI to return the file for
- * @return The local file corresponding to the given URI, or <code>null</code>
- */
- public static File toFile(URI uri) {
- try {
- if (!SCHEME_FILE.equalsIgnoreCase(uri.getScheme()))
- return null;
- //assume all illegal characters have been properly encoded, so use URI class to unencode
- return new File(uri);
- } catch (IllegalArgumentException e) {
- //File constructor does not support non-hierarchical URI
- String path = uri.getPath();
- //path is null for non-hierarchical URI such as file:c:/tmp
- if (path == null)
- path = uri.getSchemeSpecificPart();
- return new File(path);
- }
- }
-
- /**
- * Returns a string representation of the given URI that doesn't have illegal
- * characters encoded. This string is suitable for later passing to {@link #fromString(String)}.
- * @param uri The URI to convert to string format
- * @return An unencoded string representation of the URI
- */
- public static String toUnencodedString(URI uri) {
- StringBuffer result = new StringBuffer();
- String scheme = uri.getScheme();
- if (scheme != null)
- result.append(scheme).append(':');
- //there is always a ssp
- result.append(uri.getSchemeSpecificPart());
- String fragment = uri.getFragment();
- if (fragment != null)
- result.append('#').append(fragment);
- return result.toString();
- }
-
- /**
- * Returns the URL as a URI. This method will handle broken URLs that are
- * not properly encoded (for example they contain unencoded space characters).
- */
- public static URI toURI(URL url) throws URISyntaxException {
- //URL behaves differently across platforms so for file: URLs we parse from string form
- if (SCHEME_FILE.equals(url.getProtocol())) {
- String pathString = url.toExternalForm().substring(5);
- //ensure there is a leading slash to handle common malformed URLs such as file:c:/tmp
- if (pathString.indexOf('/') != 0)
- pathString = '/' + pathString;
- else if (pathString.startsWith(UNC_PREFIX) && !pathString.startsWith(UNC_PREFIX, 2)) {
- //URL encodes UNC path with two slashes, but URI uses four (see bug 207103)
- pathString = UNC_PREFIX + pathString;
- }
- return new URI(SCHEME_FILE, null, pathString, null);
- }
- try {
- return new URI(url.toExternalForm());
- } catch (URISyntaxException e) {
- //try multi-argument URI constructor to perform encoding
- return new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef());
- }
- }
-
- /**
- * Returns a URI as a URL.
- *
- * @throws MalformedURLException
- */
- public static URL toURL(URI uri) throws MalformedURLException {
- return new URL(uri.toString());
- }
-}
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/Utils.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/Utils.java
deleted file mode 100644
index 2d21e13..0000000
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/Utils.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * 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.utils;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-
-/*
- * This class was copied from org.eclipse.equinox.internal.frameworkadmin.utils
- * package of org.eclipse.equinox.frameworkadmin plugin on March 3 2007.
- *
- * The reason why it was copied is to make simpleconfigurator dependent on any
- * bundles(org.eclipse.equinox.framework).
- */
-
-public class Utils {
- private final static String PATH_SEP = "/"; //$NON-NLS-1$
-
- public static URL checkFullUrl(URL url, String urlName) throws IllegalArgumentException {//throws ManipulatorException {
- if (url == null)
- throw new IllegalArgumentException(urlName + " is null");
- if (!url.getProtocol().endsWith("file"))
- return url;
- File file = new File(url.getFile());
- if (!file.isAbsolute())
- throw new IllegalArgumentException(urlName + "(" + url + ") does not have absolute path");
- if (file.getAbsolutePath().startsWith(PATH_SEP))
- return url;
- try {
- return getUrl("file", null, PATH_SEP + file.getAbsolutePath());
- } catch (MalformedURLException e) {
- throw new IllegalArgumentException(urlName + "(" + "file:" + PATH_SEP + file.getAbsolutePath() + ") is not fully quallified");
- }
- }
-
- public static void deleteDir(File file) throws IOException {
- if (file.isFile()) {
- if (!file.delete())
- throw new IOException("Fail to delete File(" + file.getAbsolutePath() + ")");
- return;
- }
- File[] children = file.listFiles();
- for (int i = 0; i < children.length; i++) {
- deleteDir(children[i]);
- }
- if (!file.delete())
- throw new IOException("Fail to delete Dir(" + file.getAbsolutePath() + ")");
- return;
- }
-
- public static BundleInfo[] getBundleInfosFromList(List list) {
- if (list == null)
- return new BundleInfo[0];
- BundleInfo[] ret = new BundleInfo[list.size()];
- list.toArray(ret);
- return ret;
- }
-
- public static URL getUrl(String protocol, String host, String file) throws MalformedURLException {// throws ManipulatorException {
- file = Utils.replaceAll(file, File.separator, "/");
- return new URL(protocol, host, file);
- }
-
- public static String removeLastCh(String target, char ch) {
- while (target.charAt(target.length() - 1) == ch) {
- target = target.substring(0, target.length() - 1);
- }
- return target;
- }
-
- public static String replaceAll(String st, String oldSt, String newSt) {
- int index = -1;
- while ((index = st.indexOf(oldSt)) != -1) {
- st = st.substring(0, index) + newSt + st.substring(index + oldSt.length());
- }
- return st;
- }
-
- public static void log(int level, Object obj, String method, String message, Throwable e) {
- String msg = "";
- if (method == null) {
- if (obj != null)
- msg = "(" + obj.getClass().getName() + ")";
- } else if (obj == null)
- msg = "[" + method + "]" + message;
- else
- msg = "[" + method + "](" + obj.getClass().getName() + ")";
- msg += message;
-
-// if (LogService logService = Activator.getLogService();
-// if (logService != null) {
-// logService.log(level, msg, e);
-// } else {
- String levelSt = null;
- if (level == 1)
- levelSt = "DEBUG";
- else if (level == 2)
- levelSt = "INFO";
- else if (level == 3)
- levelSt = "WARNING";
- else if (level == 4) {
- levelSt = "ERROR";
-// useLog = true;
- }
-// if (useLog) {
- System.err.println("[" + levelSt + "]" + msg);
- if (e != null)
- e.printStackTrace();
-// }
- }
-
- public static URL buildURL(String spec) throws MalformedURLException {
- if (spec == null)
- throw new NullPointerException("URL spec is null."); //$NON-NLS-1$
- // Construct the URL carefully so as to preserve UNC paths etc.
- if (spec.startsWith("file:")) { //$NON-NLS-1$
- // need to do this for UNC paths
- File file = new File(spec.substring(5));
- if (file.isAbsolute())
- return file.toURL();
- }
- return new URL(spec);
- }
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/.cvsignore b/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/.cvsignore
deleted file mode 100644
index 23c798c..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-repository
-buildDirectory
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/.project b/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/.project
deleted file mode 100644
index 96fb3bc..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/.project
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.equinox.p2.examples.rcp.cloud.releng</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- </buildSpec>
- <natures>
- </natures>
-</projectDescription>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/Build Cloud Example.launch b/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/Build Cloud Example.launch
deleted file mode 100644
index 9da6e2c..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/Build Cloud Example.launch
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
-<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.equinox.p2.examples.rcp.cloud.releng/buildProduct.xml"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.equinox.p2.examples.rcp.cloud.releng"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.equinox.p2.examples.rcp.cloud.releng/buildProduct.xml}"/>
-<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
-</launchConfiguration>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/build.properties b/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/build.properties
deleted file mode 100644
index 3f64da7..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/build.properties
+++ /dev/null
@@ -1,119 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2006 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
-###############################################################################
-product=/org.eclipse.equinox.p2.examples.rcp.cloud/cloud.product
-runPackager=true
-
-p2.gathering=true
- p2.metadata.repo=file:${builder}/repository
-p2.artifact.repo=file:${builder}/repository
-
-#Set the name of the archive that will result from the product build.
-#archiveNamePrefix=
-
-# The prefix that will be used in the generated archive.
-archivePrefix=eclipse
-
-# The location underwhich all of the build output will be collected.
-collectingFolder=${archivePrefix}
-
-# The list of {os, ws, arch} configurations to build. This
-# value is a '&' separated list of ',' separate triples. For example,
-# configs=win32,win32,x86 & linux,motif,x86
-# By default the value is *,*,*
-configs = win32, win32, x86
-#configs=win32, win32, x86 & \
-# linux, gtk, ppc &\
-# linux, gtk, x86 & \
-# linux, gtk, x86_64 & \
-# linux, motif, x86 & \
-# solaris, motif, sparc & \
-# solaris, gtk, sparc & \
-# aix, motif, ppc & \
-# hpux, motif, PA_RISC & \
-# macosx, carbon, ppc
-
-#Allow cycles involving at most one bundle that needs to be compiled with the rest being binary bundles.
-allowBinaryCycles = true
-
-# Type of build. Used in naming the build output. Typically this value is
-# one of I, N, M, S, ...
-buildType=I
-
-# ID of the build. Used in naming the build output.
-buildId=TestBuild
-
-# Label for the build. Used in naming the build output
-buildLabel=${buildType}.${buildId}
-
-# Timestamp for the build. Used in naming the build output
-timestamp=007
-
-#this property indicates whether the resolution should be done in development mode (i.e. ignore multiple bundles with singletons)
-resolution.devMode=false
-
-skipBase=true
-skipMaps=true
-skipFetch=true
-
-
-############# JAVA COMPILER OPTIONS ##############
-# For this example:
-# We specify the JRE locations for CDC-1.1/Foundation-1.1 and J2SE-1.5
-# because these are the required execution environments defined for the
-# bundles in the example.
-
-# The location of the Java jars to compile against. Typically the rt.jar for your JDK/JRE
-#bootclasspath=${java.home}/lib/rt.jar
-
-# If using an IBM VM, use
-#bootclasspath=${java.home}/lib/core.jar;${java.home}/lib/vm.jar
-
-# specific JRE locations to compile against. These values are used to compile bundles specifying a
-# Bundle-RequiredExecutionEnvironment. Uncomment and set values for environments that you support
-#CDC-1.0/Foundation-1.0= /path/to/rt.jar
-CDC-1.1/Foundation-1.1=${java.home}/lib/rt.jar
-#OSGi/Minimum-1.0=
-#OSGi/Minimum-1.1=
-#JRE-1.1=
-#J2SE-1.2=
-#J2SE-1.3=
-#J2SE-1.4=
-J2SE-1.5=${java.home}/lib/rt.jar
-#JavaSE-1.6=
-#PersonalJava-1.1=
-#PersonalJava-1.2=
-#CDC-1.0/PersonalBasis-1.0=
-#CDC-1.0/PersonalJava-1.0=
-#CDC-1.1/PersonalBasis-1.1=
-#CDC-1.1/PersonalJava-1.1=
-
-# Specify the output format of the compiler log when eclipse jdt is used
-logExtension=.log
-
-# Whether or not to include debug info in the output jars
-javacDebugInfo=false
-
-# Whether or not to fail the build if there are compiler errors
-javacFailOnError=true
-
-# Enable or disable verbose mode of the compiler
-javacVerbose=true
-
-# Extra arguments for the compiler. These are specific to the java compiler being used.
-#compilerArg=
-
-# Default value for the version of the source code. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacSource in build.properties
-#javacSource=1.3
-
-# Default value for the version of the byte code targeted. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacTarget in build.properties.
-#javacTarget=1.1
-
-
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/buildProduct.xml b/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/buildProduct.xml
deleted file mode 100644
index 2f1b9a9..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/buildProduct.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<project default="main">
- <target name="main">
- <property name="baseLocation" value="${eclipse.home}"/>
- <!-- by default, check for deltapack co-located with eclipse -->
- <property name="deltapack" value="${eclipse.home}/../deltapack/eclipse"/>
-
- <!-- Check that we have a deltapack -->
- <available property="haveDeltaPack" file="${deltapack}"/>
- <fail unless="haveDeltaPack" message="The deltapack is required to build this product. Please edit buildProduct.xml or set the "deltapack" property." />
-
- <property name="builder" value="${basedir}" />
- <property name="buildDirectory" value="${basedir}/buildDirectory"/>
- <property name="pluginPath" value="${basedir}/..${path.separator}${deltapack}" />
- <property name="buildTempFolder" value="${buildDirectory}" />
-
- <ant antfile="${eclipse.pdebuild.scripts}/productBuild/productBuild.xml" />
-
- <move todir="${basedir}">
- <fileset dir="${buildDirectory}/I.TestBuild" includes="*.zip"/>
- </move>
-
- <!-- refresh the workspace -->
- <eclipse.convertPath fileSystemPath="${basedir}" property="resourcePath"/>
- <eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
- </target>
-</project>
\ No newline at end of file
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/readme.txt b/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/readme.txt
deleted file mode 100644
index eb0d089..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.cloud.releng/readme.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-This project is a releng builder for the org.eclipse.equinox.p2.examples.rcp.cloud project.
-
-1) This build requires 3.5M6 or later
-
-2) This build requires the deltapack. By default it looks beside the eclipse install for "deltapack/eclipse/*".
- If your deltapack is located elsewhere, set the "deltapack" property or edit the buildProduct.xml file. The
- version of the deltapack used should match the version of the eclipse that is running.
-
-3) Due to bug 268867, if the buildDirectory/buildRepo is deleted/cleaned, then the repo must also be removed from
- the workspace Available Software Sites preferences.
-
-4) Use the included launch config, or run buildProduct.xml as an ant build using the same JRE as the workspace
-
-5) The build.properties file specifically defines the JRE's for CDC-1.1/Foundation-1.1 and
- J2SE-1.5 because these are the required bundle execution environments in the example.
- The build should be run on a 1.5 VM.
\ No newline at end of file
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/.project b/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/.project
deleted file mode 100644
index 593704f..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/.project
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- </buildSpec>
- <natures>
- </natures>
-</projectDescription>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/Build PrestartUpdate Example.launch b/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/Build PrestartUpdate Example.launch
deleted file mode 100644
index d0ceb13..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/Build PrestartUpdate Example.launch
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
-<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/buildProduct.xml"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/buildProduct.xml}"/>
-<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
-</launchConfiguration>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/build.properties b/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/build.properties
deleted file mode 100644
index 4435817..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/build.properties
+++ /dev/null
@@ -1,119 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2006 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
-###############################################################################
-product=/org.eclipse.equinox.p2.examples.rcp.prestartupdate/prestartupdate.product
-runPackager=true
-
-p2.gathering=true
- p2.metadata.repo=file:${builder}/repository
-p2.artifact.repo=file:${builder}/repository
-
-#Set the name of the archive that will result from the product build.
-#archiveNamePrefix=
-
-# The prefix that will be used in the generated archive.
-archivePrefix=eclipse
-
-# The location underwhich all of the build output will be collected.
-collectingFolder=${archivePrefix}
-
-# The list of {os, ws, arch} configurations to build. This
-# value is a '&' separated list of ',' separate triples. For example,
-# configs=win32,win32,x86 & linux,motif,x86
-# By default the value is *,*,*
-configs = win32, win32, x86
-#configs=win32, win32, x86 & \
-# linux, gtk, ppc &\
-# linux, gtk, x86 & \
-# linux, gtk, x86_64 & \
-# linux, motif, x86 & \
-# solaris, motif, sparc & \
-# solaris, gtk, sparc & \
-# aix, motif, ppc & \
-# hpux, motif, PA_RISC & \
-# macosx, carbon, ppc
-
-#Allow cycles involving at most one bundle that needs to be compiled with the rest being binary bundles.
-allowBinaryCycles = true
-
-# Type of build. Used in naming the build output. Typically this value is
-# one of I, N, M, S, ...
-buildType=I
-
-# ID of the build. Used in naming the build output.
-buildId=TestBuild
-
-# Label for the build. Used in naming the build output
-buildLabel=${buildType}.${buildId}
-
-# Timestamp for the build. Used in naming the build output
-timestamp=007
-
-#this property indicates whether the resolution should be done in development mode (i.e. ignore multiple bundles with singletons)
-resolution.devMode=false
-
-skipBase=true
-skipMaps=true
-skipFetch=true
-
-
-############# JAVA COMPILER OPTIONS ##############
-# For this example:
-# We specify the JRE locations for CDC-1.1/Foundation-1.1 and J2SE-1.5
-# because these are the required execution environments defined for the
-# bundles in the example.
-
-# The location of the Java jars to compile against. Typically the rt.jar for your JDK/JRE
-#bootclasspath=${java.home}/lib/rt.jar
-
-# If using an IBM VM, use
-#bootclasspath=${java.home}/lib/core.jar;${java.home}/lib/vm.jar
-
-# specific JRE locations to compile against. These values are used to compile bundles specifying a
-# Bundle-RequiredExecutionEnvironment. Uncomment and set values for environments that you support
-#CDC-1.0/Foundation-1.0= /path/to/rt.jar
-CDC-1.1/Foundation-1.1=${java.home}/lib/rt.jar
-#OSGi/Minimum-1.0=
-#OSGi/Minimum-1.1=
-#JRE-1.1=
-#J2SE-1.2=
-#J2SE-1.3=
-#J2SE-1.4=
-J2SE-1.5=${java.home}/lib/rt.jar
-#JavaSE-1.6=
-#PersonalJava-1.1=
-#PersonalJava-1.2=
-#CDC-1.0/PersonalBasis-1.0=
-#CDC-1.0/PersonalJava-1.0=
-#CDC-1.1/PersonalBasis-1.1=
-#CDC-1.1/PersonalJava-1.1=
-
-# Specify the output format of the compiler log when eclipse jdt is used
-logExtension=.log
-
-# Whether or not to include debug info in the output jars
-javacDebugInfo=false
-
-# Whether or not to fail the build if there are compiler errors
-javacFailOnError=true
-
-# Enable or disable verbose mode of the compiler
-javacVerbose=true
-
-# Extra arguments for the compiler. These are specific to the java compiler being used.
-#compilerArg=
-
-# Default value for the version of the source code. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacSource in build.properties
-#javacSource=1.3
-
-# Default value for the version of the byte code targeted. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacTarget in build.properties.
-#javacTarget=1.1
-
-
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/buildProduct.xml b/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/buildProduct.xml
deleted file mode 100644
index 2f1b9a9..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/buildProduct.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<project default="main">
- <target name="main">
- <property name="baseLocation" value="${eclipse.home}"/>
- <!-- by default, check for deltapack co-located with eclipse -->
- <property name="deltapack" value="${eclipse.home}/../deltapack/eclipse"/>
-
- <!-- Check that we have a deltapack -->
- <available property="haveDeltaPack" file="${deltapack}"/>
- <fail unless="haveDeltaPack" message="The deltapack is required to build this product. Please edit buildProduct.xml or set the "deltapack" property." />
-
- <property name="builder" value="${basedir}" />
- <property name="buildDirectory" value="${basedir}/buildDirectory"/>
- <property name="pluginPath" value="${basedir}/..${path.separator}${deltapack}" />
- <property name="buildTempFolder" value="${buildDirectory}" />
-
- <ant antfile="${eclipse.pdebuild.scripts}/productBuild/productBuild.xml" />
-
- <move todir="${basedir}">
- <fileset dir="${buildDirectory}/I.TestBuild" includes="*.zip"/>
- </move>
-
- <!-- refresh the workspace -->
- <eclipse.convertPath fileSystemPath="${basedir}" property="resourcePath"/>
- <eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
- </target>
-</project>
\ No newline at end of file
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/readme.txt b/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/readme.txt
deleted file mode 100644
index e0ab34e..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.prestartupdate.releng/readme.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-This project is a releng builder for the org.eclipse.equinox.p2.examples.rcp.prestartupdate project.
-
-1) This build requires 3.5M6 or later
-
-2) This build requires the deltapack. By default it looks beside the eclipse install for "deltapack/eclipse/*".
- If your deltapack is located elsewhere, set the "deltapack" property or edit the buildProduct.xml file. The
- version of the deltapack used should match the version of the eclipse that is running.
-
-3) Due to bug 268867, if the buildDirectory/buildRepo is deleted/cleaned, then the repo must also be removed from
- the workspace Available Software Sites preferences.
-
-4) Use the included launch config, or run buildProduct.xml as an ant build using the same JRE as the workspace
-
-5) The build.properties file specifically defines the JRE's for CDC-1.1/Foundation-1.1 and
- J2SE-1.5 because these are the required bundle execution environments in the example.
- The build should be run on a 1.5 VM.
\ No newline at end of file
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.project b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.project
deleted file mode 100644
index ca9f8bc..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 1fe1140..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Mon Mar 16 11:53:51 PDT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/META-INF/MANIFEST.MF b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/META-INF/MANIFEST.MF
deleted file mode 100644
index d3eaf0c..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,27 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Sdknoautoupdates
-Bundle-SymbolicName: org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.equinox.p2.ui;bundle-version="1.0.100",
- org.eclipse.equinox.p2.metadata;bundle-version="1.0.0",
- org.eclipse.equinox.p2.metadata.repository;bundle-version="1.0.0",
- org.eclipse.equinox.p2.artifact.repository;bundle-version="1.0.0",
- org.eclipse.equinox.p2.extensionlocation;bundle-version="1.0.100",
- org.eclipse.equinox.p2.updatesite;bundle-version="1.0.0",
- org.eclipse.equinox.p2.director;bundle-version="1.0.100",
- org.eclipse.equinox.p2.engine;bundle-version="1.0.100",
- org.eclipse.equinox.p2.core;bundle-version="1.0.100",
- org.eclipse.ecf;bundle-version="3.0.0",
- org.eclipse.ecf.filetransfer;bundle-version="3.0.0",
- org.eclipse.ecf.identity;bundle-version="3.0.0",
- org.eclipse.ecf.provider.filetransfer;bundle-version="3.0.0",
- org.eclipse.ecf.provider.filetransfer.httpclient;bundle-version="3.0.0",
- org.apache.commons.codec;bundle-version="1.2.0",
- org.apache.commons.httpclient;bundle-version="3.0.1",
- org.eclipse.equinox.p2.ui.sdk;bundle-version="1.0.0"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/build.properties b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/build.properties
deleted file mode 100644
index 4b6aaf2..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = plugin.xml,\
- META-INF/,\
- .,\
- icons/,\
- product_lg.gif,\
- splash.bmp
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/mail.ico b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/mail.ico
deleted file mode 100644
index b000061..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/mail.ico
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.gif b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.gif
deleted file mode 100644
index 34fb3c9..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.icns b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.icns
deleted file mode 100644
index 1e92ccc..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.icns
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample2.gif b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample2.gif
deleted file mode 100644
index 252d7eb..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample2.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample3.gif b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample3.gif
deleted file mode 100644
index b949ac9..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample3.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/p2.inf b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/p2.inf
deleted file mode 100644
index 48f31a3..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/p2.inf
+++ /dev/null
@@ -1,3 +0,0 @@
-instructions.configure=\
- addRepository(type:0,location:http${#58}//www.eclipse.org/equinox/p2/testing/updateSite);\
- addRepository(type:1,location:http${#58}//www.eclipse.org/equinox/p2/testing/updateSite);
\ No newline at end of file
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/plugin.xml b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/plugin.xml
deleted file mode 100644
index e786d29..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/plugin.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-
- <extension
- id="application"
- point="org.eclipse.core.runtime.applications">
- <application>
- <run
- class="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.Application">
- </run>
- </application>
- </extension>
- <extension
- point="org.eclipse.ui.perspectives">
- <perspective
- name="RCP Perspective"
- class="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.Perspective"
- id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.perspective">
- </perspective>
- </extension>
- <extension
- point="org.eclipse.ui.views">
- <view
- name="Message"
- allowMultiple="true"
- icon="icons/sample2.gif"
- class="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.View"
- id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.view">
- </view>
- <view
- name="Mailboxes"
- allowMultiple="true"
- icon="icons/sample3.gif"
- class="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.NavigationView"
- id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.navigationView">
- </view>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <category
- name="Mail"
- id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.category">
- </category>
- <command
- name="Open Mailbox"
- description="Opens a mailbox"
- categoryId="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.category"
- id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.open">
- </command>
- <command
- name="Open Message Dialog"
- description="Open a message dialog"
- categoryId="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.category"
- id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.openMessage">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.bindings">
- <key
- commandId="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.open"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+2">
- </key>
- <key
- commandId="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.openMessage"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+3">
- </key>
- <key
- commandId="org.eclipse.ui.file.exit"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+X">
- </key>
- </extension>
- <extension
- id="product"
- point="org.eclipse.core.runtime.products">
- <product
- application="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.application"
- name="RCP Product">
- <property
- name="aboutText"
- value="RCP Mail template created by PDE">
- </property>
- <property
- name="windowImages"
- value="icons/sample2.gif">
- </property>
- <property
- name="aboutImage"
- value="product_lg.gif">
- </property>
- </product>
- </extension>
-
-</plugin>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/product_lg.gif b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/product_lg.gif
deleted file mode 100644
index bd95e28..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/product_lg.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/sdknoautoupdates.product b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/sdknoautoupdates.product
deleted file mode 100644
index 09e70ab..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/sdknoautoupdates.product
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?pde version="3.5"?>
-
-<product name="RCP Mail Example (No Automatic Updates)" id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.product" application="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.application" version="1.0.0.qualifier" useFeatures="false">
-
- <aboutInfo>
- <image path="product_lg.gif"/>
- <text>
- RCP Mail Example (No Automatic Updates)
- </text>
- </aboutInfo>
-
- <configIni use="default">
- </configIni>
-
- <launcherArgs>
- <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
- </launcherArgs>
-
- <windowImages i16="icons/sample2.gif"/>
-
- <splash
- location="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates" />
- <launcher name="sdknoautoupdates">
- <solaris/>
- <win useIco="false">
- <bmp/>
- </win>
- </launcher>
-
- <vm>
- </vm>
-
- <plugins>
- <plugin id="com.ibm.icu"/>
- <plugin id="org.apache.commons.codec"/>
- <plugin id="org.apache.commons.httpclient"/>
- <plugin id="org.apache.commons.logging"/>
- <plugin id="org.eclipse.core.commands"/>
- <plugin id="org.eclipse.core.contenttype"/>
- <plugin id="org.eclipse.core.databinding"/>
- <plugin id="org.eclipse.core.databinding.observable"/>
- <plugin id="org.eclipse.core.databinding.property"/>
- <plugin id="org.eclipse.core.expressions"/>
- <plugin id="org.eclipse.core.jobs"/>
- <plugin id="org.eclipse.core.runtime"/>
- <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
- <plugin id="org.eclipse.ecf"/>
- <plugin id="org.eclipse.ecf.filetransfer"/>
- <plugin id="org.eclipse.ecf.identity"/>
- <plugin id="org.eclipse.ecf.provider.filetransfer"/>
- <plugin id="org.eclipse.ecf.provider.filetransfer.httpclient"/>
- <plugin id="org.eclipse.ecf.provider.filetransfer.httpclient.ssl" fragment="true"/>
- <plugin id="org.eclipse.ecf.provider.filetransfer.ssl" fragment="true"/>
- <plugin id="org.eclipse.ecf.ssl" fragment="true"/>
- <plugin id="org.eclipse.equinox.app"/>
- <plugin id="org.eclipse.equinox.common"/>
- <plugin id="org.eclipse.equinox.frameworkadmin"/>
- <plugin id="org.eclipse.equinox.frameworkadmin.equinox"/>
- <plugin id="org.eclipse.equinox.p2.artifact.repository"/>
- <plugin id="org.eclipse.equinox.p2.core"/>
- <plugin id="org.eclipse.equinox.p2.director"/>
- <plugin id="org.eclipse.equinox.p2.directorywatcher"/>
- <plugin id="org.eclipse.equinox.p2.engine"/>
- <plugin id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates"/>
- <plugin id="org.eclipse.equinox.p2.exemplarysetup"/>
- <plugin id="org.eclipse.equinox.p2.extensionlocation"/>
- <plugin id="org.eclipse.equinox.p2.garbagecollector"/>
- <plugin id="org.eclipse.equinox.p2.jarprocessor"/>
- <plugin id="org.eclipse.equinox.p2.metadata"/>
- <plugin id="org.eclipse.equinox.p2.metadata.repository"/>
- <plugin id="org.eclipse.equinox.p2.publisher"/>
- <plugin id="org.eclipse.equinox.p2.touchpoint.eclipse"/>
- <plugin id="org.eclipse.equinox.p2.ui"/>
- <plugin id="org.eclipse.equinox.p2.ui.sdk"/>
- <plugin id="org.eclipse.equinox.p2.updatesite"/>
- <plugin id="org.eclipse.equinox.preferences"/>
- <plugin id="org.eclipse.equinox.registry"/>
- <plugin id="org.eclipse.equinox.security"/>
- <plugin id="org.eclipse.equinox.security.ui"/>
- <plugin id="org.eclipse.equinox.security.win32.x86" fragment="true"/>
- <plugin id="org.eclipse.equinox.simpleconfigurator"/>
- <plugin id="org.eclipse.equinox.simpleconfigurator.manipulator"/>
- <plugin id="org.eclipse.help"/>
- <plugin id="org.eclipse.jface"/>
- <plugin id="org.eclipse.jface.databinding"/>
- <plugin id="org.eclipse.osgi"/>
- <plugin id="org.eclipse.osgi.services"/>
- <plugin id="org.eclipse.swt"/>
- <plugin id="org.eclipse.swt.win32.win32.x86" fragment="true"/>
- <plugin id="org.eclipse.ui"/>
- <plugin id="org.eclipse.ui.workbench"/>
- <plugin id="org.sat4j.core"/>
- <plugin id="org.sat4j.pb"/>
- </plugins>
-
-
-</product>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/splash.bmp b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/splash.bmp
deleted file mode 100644
index d7d2e30..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/splash.bmp
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Activator.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Activator.java
deleted file mode 100644
index c23f925..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Activator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Application.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Application.java
deleted file mode 100644
index 3279bab..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Application.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
-
-import org.eclipse.equinox.app.IApplication;
-import org.eclipse.equinox.app.IApplicationContext;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * This class controls all aspects of the application's execution
- */
-public class Application implements IApplication {
-
- /* (non-Javadoc)
- * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
- */
- public Object start(IApplicationContext context) {
- Display display = PlatformUI.createDisplay();
- try {
- int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
- if (returnCode == PlatformUI.RETURN_RESTART) {
- return IApplication.EXIT_RESTART;
- }
- return IApplication.EXIT_OK;
- } finally {
- display.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.equinox.app.IApplication#stop()
- */
- public void stop() {
- final IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench == null)
- return;
- final Display display = workbench.getDisplay();
- display.syncExec(new Runnable() {
- public void run() {
- if (!display.isDisposed())
- workbench.close();
- }
- });
- }
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationActionBarAdvisor.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationActionBarAdvisor.java
deleted file mode 100644
index 0794fc4..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationActionBarAdvisor.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.ICoolBarManager;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarContributionItem;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-
-/**
- * An action bar advisor is responsible for creating, adding, and disposing of the
- * actions added to a workbench window. Each window will be populated with
- * new actions.
- */
-public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
-
- // Actions - important to allocate these only in makeActions, and then use them
- // in the fill methods. This ensures that the actions aren't recreated
- // when fillActionBars is called with FILL_PROXY.
- private IWorkbenchAction exitAction;
- private IWorkbenchAction aboutAction;
- private IWorkbenchAction newWindowAction;
- // XXX we want to show all update preferences
- private IWorkbenchAction preferencesAction;
- private OpenViewAction openViewAction;
- private Action messagePopupAction;
-
-
- public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
- super(configurer);
- }
-
- protected void makeActions(final IWorkbenchWindow window) {
- // Creates the actions and registers them.
- // Registering is needed to ensure that key bindings work.
- // The corresponding commands keybindings are defined in the plugin.xml file.
- // Registering also provides automatic disposal of the actions when
- // the window is closed.
-
- exitAction = ActionFactory.QUIT.create(window);
- register(exitAction);
-
- aboutAction = ActionFactory.ABOUT.create(window);
- register(aboutAction);
-
- newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create(window);
- register(newWindowAction);
-
- //XXX preferences action
- preferencesAction = ActionFactory.PREFERENCES.create(window);
- register(preferencesAction);
-
- openViewAction = new OpenViewAction(window, "Open Another Message View", View.ID);
- register(openViewAction);
-
- messagePopupAction = new MessagePopupAction("Open Message", window);
- register(messagePopupAction);
- }
-
- protected void fillMenuBar(IMenuManager menuBar) {
- MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
- // XXX Window menu
- MenuManager windowMenu = new MenuManager("&Window", IWorkbenchActionConstants.M_WINDOW);
- MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);
-
- menuBar.add(fileMenu);
- // XXX Window menu
- menuBar.add(windowMenu);
- // Add a group marker indicating where action set menus will appear.
- menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- menuBar.add(helpMenu);
-
- // File
- fileMenu.add(newWindowAction);
- fileMenu.add(new Separator());
- fileMenu.add(messagePopupAction);
- fileMenu.add(openViewAction);
- fileMenu.add(new Separator());
- fileMenu.add(exitAction);
-
- // XXX Window menu
- windowMenu.add(preferencesAction);
-
- // Help
- // XXX add an additions group because this is what SDK UI expects
- helpMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- helpMenu.add(new Separator());
- helpMenu.add(aboutAction);
-
- }
-
- protected void fillCoolBar(ICoolBarManager coolBar) {
- IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
- coolBar.add(new ToolBarContributionItem(toolbar, "main"));
- toolbar.add(openViewAction);
- toolbar.add(messagePopupAction);
- }
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchAdvisor.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchAdvisor.java
deleted file mode 100644
index 183ba01..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchAdvisor.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
-
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchAdvisor;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-/**
- * This workbench advisor creates the window advisor, and specifies
- * the perspective id for the initial window.
- */
-public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
-
- public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
- return new ApplicationWorkbenchWindowAdvisor(configurer);
- }
-
- public String getInitialWindowPerspectiveId() {
- return Perspective.ID;
- }
-
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchWindowAdvisor.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchWindowAdvisor.java
deleted file mode 100644
index 94a996d..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchWindowAdvisor.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
-
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
-
- public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
- super(configurer);
- }
-
- public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
- return new ApplicationActionBarAdvisor(configurer);
- }
-
- public void preWindowOpen() {
- IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
- configurer.setInitialSize(new Point(600, 400));
- configurer.setShowCoolBar(true);
- // XXX We set the status line and progress indicator so that update
- // information can be shown there
- configurer.setShowStatusLine(true);
- configurer.setShowProgressIndicator(true);
- }
-
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ICommandIds.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ICommandIds.java
deleted file mode 100644
index 018fef1..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ICommandIds.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
-
-/**
- * Interface defining the application's command IDs.
- * Key bindings can be defined for specific commands.
- * To associate an action with a command, use IAction.setActionDefinitionId(commandId).
- *
- * @see org.eclipse.jface.action.IAction#setActionDefinitionId(String)
- */
-public interface ICommandIds {
-
- public static final String CMD_OPEN = "org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.open";
- public static final String CMD_OPEN_MESSAGE = "org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.openMessage";
-
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/MessagePopupAction.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/MessagePopupAction.java
deleted file mode 100644
index 09cf1f9..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/MessagePopupAction.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchWindow;
-
-
-public class MessagePopupAction extends Action {
-
- private final IWorkbenchWindow window;
-
- MessagePopupAction(String text, IWorkbenchWindow window) {
- super(text);
- this.window = window;
- // The id is used to refer to the action in a menu or toolbar
- setId(ICommandIds.CMD_OPEN_MESSAGE);
- // Associate the action with a pre-defined command, to allow key bindings.
- setActionDefinitionId(ICommandIds.CMD_OPEN_MESSAGE);
- setImageDescriptor(org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.Activator.getImageDescriptor("/icons/sample3.gif"));
- }
-
- public void run() {
- MessageDialog.openInformation(window.getShell(), "Open", "Open Message Dialog!");
- }
-}
\ No newline at end of file
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/NavigationView.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/NavigationView.java
deleted file mode 100644
index 8eeaa6e..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/NavigationView.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
-
-public class NavigationView extends ViewPart {
- public static final String ID = "org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.navigationView";
- private TreeViewer viewer;
-
- class TreeObject {
- private String name;
- private TreeParent parent;
-
- public TreeObject(String name) {
- this.name = name;
- }
- public String getName() {
- return name;
- }
- public void setParent(TreeParent parent) {
- this.parent = parent;
- }
- public TreeParent getParent() {
- return parent;
- }
- public String toString() {
- return getName();
- }
- }
-
- class TreeParent extends TreeObject {
- private ArrayList children;
- public TreeParent(String name) {
- super(name);
- children = new ArrayList();
- }
- public void addChild(TreeObject child) {
- children.add(child);
- child.setParent(this);
- }
- public void removeChild(TreeObject child) {
- children.remove(child);
- child.setParent(null);
- }
- public TreeObject[] getChildren() {
- return (TreeObject[]) children.toArray(new TreeObject[children.size()]);
- }
- public boolean hasChildren() {
- return children.size()>0;
- }
- }
-
- class ViewContentProvider implements IStructuredContentProvider,
- ITreeContentProvider {
-
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- }
-
- public void dispose() {
- }
-
- public Object[] getElements(Object parent) {
- return getChildren(parent);
- }
-
- public Object getParent(Object child) {
- if (child instanceof TreeObject) {
- return ((TreeObject)child).getParent();
- }
- return null;
- }
-
- public Object[] getChildren(Object parent) {
- if (parent instanceof TreeParent) {
- return ((TreeParent)parent).getChildren();
- }
- return new Object[0];
- }
-
- public boolean hasChildren(Object parent) {
- if (parent instanceof TreeParent)
- return ((TreeParent)parent).hasChildren();
- return false;
- }
- }
-
- class ViewLabelProvider extends LabelProvider {
-
- public String getText(Object obj) {
- return obj.toString();
- }
- public Image getImage(Object obj) {
- String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
- if (obj instanceof TreeParent)
- imageKey = ISharedImages.IMG_OBJ_FOLDER;
- return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
- }
- }
-
- /**
- * We will set up a dummy model to initialize tree heararchy. In real
- * code, you will connect to a real model and expose its hierarchy.
- */
- private TreeObject createDummyModel() {
- TreeObject to1 = new TreeObject("Inbox");
- TreeObject to2 = new TreeObject("Drafts");
- TreeObject to3 = new TreeObject("Sent");
- TreeParent p1 = new TreeParent("me@this.com");
- p1.addChild(to1);
- p1.addChild(to2);
- p1.addChild(to3);
-
- TreeObject to4 = new TreeObject("Inbox");
- TreeParent p2 = new TreeParent("other@aol.com");
- p2.addChild(to4);
-
- TreeParent root = new TreeParent("");
- root.addChild(p1);
- root.addChild(p2);
- return root;
- }
-
- /**
- * This is a callback that will allow us to create the viewer and initialize
- * it.
- */
- public void createPartControl(Composite parent) {
- viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- viewer.setContentProvider(new ViewContentProvider());
- viewer.setLabelProvider(new ViewLabelProvider());
- viewer.setInput(createDummyModel());
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- public void setFocus() {
- viewer.getControl().setFocus();
- }
-}
\ No newline at end of file
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/OpenViewAction.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/OpenViewAction.java
deleted file mode 100644
index e559179..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/OpenViewAction.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-
-
-public class OpenViewAction extends Action {
-
- private final IWorkbenchWindow window;
- private int instanceNum = 0;
- private final String viewId;
-
- public OpenViewAction(IWorkbenchWindow window, String label, String viewId) {
- this.window = window;
- this.viewId = viewId;
- setText(label);
- // The id is used to refer to the action in a menu or toolbar
- setId(ICommandIds.CMD_OPEN);
- // Associate the action with a pre-defined command, to allow key bindings.
- setActionDefinitionId(ICommandIds.CMD_OPEN);
- setImageDescriptor(org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.Activator.getImageDescriptor("/icons/sample2.gif"));
- }
-
- public void run() {
- if(window != null) {
- try {
- window.getActivePage().showView(viewId, Integer.toString(instanceNum++), IWorkbenchPage.VIEW_ACTIVATE);
- } catch (PartInitException e) {
- MessageDialog.openError(window.getShell(), "Error", "Error opening view:" + e.getMessage());
- }
- }
- }
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Perspective.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Perspective.java
deleted file mode 100644
index dbe205e..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Perspective.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
-
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-
-public class Perspective implements IPerspectiveFactory {
-
- /**
- * The ID of the perspective as specified in the extension.
- */
- public static final String ID = "org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.perspective";
-
- public void createInitialLayout(IPageLayout layout) {
- String editorArea = layout.getEditorArea();
- layout.setEditorAreaVisible(false);
-
- layout.addStandaloneView(NavigationView.ID, false, IPageLayout.LEFT, 0.25f, editorArea);
- IFolderLayout folder = layout.createFolder("messages", IPageLayout.TOP, 0.5f, editorArea);
- folder.addPlaceholder(View.ID + ":*");
- folder.addView(View.ID);
-
- layout.getViewLayout(NavigationView.ID).setCloseable(false);
- }
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/View.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/View.java
deleted file mode 100644
index ec39948..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/View.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.part.ViewPart;
-
-public class View extends ViewPart {
-
- public static final String ID = "org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.view";
-
- public void createPartControl(Composite parent) {
- Composite top = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- top.setLayout(layout);
- // top banner
- Composite banner = new Composite(top, SWT.NONE);
- banner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
- layout = new GridLayout();
- layout.marginHeight = 5;
- layout.marginWidth = 10;
- layout.numColumns = 2;
- banner.setLayout(layout);
-
- // setup bold font
- Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
-
- Label l = new Label(banner, SWT.WRAP);
- l.setText("Subject:");
- l.setFont(boldFont);
- l = new Label(banner, SWT.WRAP);
- l.setText("This is a message about the cool Eclipse RCP!");
-
- l = new Label(banner, SWT.WRAP);
- l.setText("From:");
- l.setFont(boldFont);
-
- final Link link = new Link(banner, SWT.NONE);
- link.setText("<a>nicole@mail.org</a>");
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MessageDialog.openInformation(getSite().getShell(), "Not Implemented", "Imagine the address book or a new message being created now.");
- }
- });
-
- l = new Label(banner, SWT.WRAP);
- l.setText("Date:");
- l.setFont(boldFont);
- l = new Label(banner, SWT.WRAP);
- l.setText("10:34 am");
- // message contents
- Text text = new Text(top, SWT.MULTI | SWT.WRAP);
- text.setText("This RCP Application was generated from the PDE Plug-in Project wizard. This sample shows how to:\n"+
- "- add a top-level menu and toolbar with actions\n"+
- "- add keybindings to actions\n" +
- "- create views that can't be closed and\n"+
- " multiple instances of the same view\n"+
- "- perspectives with placeholders for new views\n"+
- "- use the default about dialog\n"+
- "- create a product definition\n");
- text.setLayoutData(new GridData(GridData.FILL_BOTH));
- }
-
- public void setFocus() {
- }
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/.classpath b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/.classpath
deleted file mode 100644
index 64c5e31..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/.project b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/.project
deleted file mode 100644
index bdfbea8..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.equinox.p2.examples.rcp.sdkui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 0168ffa..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Mon Mar 16 11:26:17 PDT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/META-INF/MANIFEST.MF b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/META-INF/MANIFEST.MF
deleted file mode 100644
index 58bab24..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,29 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: RCP Mail (SDK UI)
-Bundle-SymbolicName: org.eclipse.equinox.p2.examples.rcp.sdkui; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.equinox.p2.examples.rcp.sdkui.Activator
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.equinox.p2.ui;bundle-version="1.0.100",
- org.eclipse.equinox.p2.metadata;bundle-version="1.0.0",
- org.eclipse.equinox.p2.metadata.repository;bundle-version="1.0.0",
- org.eclipse.equinox.p2.artifact.repository;bundle-version="1.0.0",
- org.eclipse.equinox.p2.extensionlocation;bundle-version="1.0.100",
- org.eclipse.equinox.p2.updatesite;bundle-version="1.0.0",
- org.eclipse.equinox.p2.director;bundle-version="1.0.100",
- org.eclipse.equinox.p2.engine;bundle-version="1.0.100",
- org.eclipse.equinox.p2.core;bundle-version="1.0.100",
- org.eclipse.ecf;bundle-version="3.0.0",
- org.eclipse.ecf.filetransfer;bundle-version="3.0.0",
- org.eclipse.ecf.identity;bundle-version="3.0.0",
- org.eclipse.ecf.provider.filetransfer;bundle-version="3.0.0",
- org.eclipse.ecf.provider.filetransfer.httpclient;bundle-version="3.0.0",
- org.apache.commons.codec;bundle-version="1.2.0",
- org.apache.commons.httpclient;bundle-version="3.0.1",
- org.eclipse.equinox.p2.ui.sdk;bundle-version="1.0.0",
- org.eclipse.equinox.p2.ui.sdk.scheduler;bundle-version="1.0.0"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/build.properties b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/build.properties
deleted file mode 100644
index 4b6aaf2..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = plugin.xml,\
- META-INF/,\
- .,\
- icons/,\
- product_lg.gif,\
- splash.bmp
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/mail.ico b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/mail.ico
deleted file mode 100644
index b000061..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/mail.ico
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample.gif b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample.gif
deleted file mode 100644
index 34fb3c9..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample.icns b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample.icns
deleted file mode 100644
index 1e92ccc..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample.icns
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample2.gif b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample2.gif
deleted file mode 100644
index 252d7eb..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample2.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample3.gif b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample3.gif
deleted file mode 100644
index b949ac9..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/icons/sample3.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/p2.inf b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/p2.inf
deleted file mode 100644
index 48f31a3..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/p2.inf
+++ /dev/null
@@ -1,3 +0,0 @@
-instructions.configure=\
- addRepository(type:0,location:http${#58}//www.eclipse.org/equinox/p2/testing/updateSite);\
- addRepository(type:1,location:http${#58}//www.eclipse.org/equinox/p2/testing/updateSite);
\ No newline at end of file
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/plugin.xml b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/plugin.xml
deleted file mode 100644
index 7dd5511..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/plugin.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-
- <extension
- id="application"
- point="org.eclipse.core.runtime.applications">
- <application>
- <run
- class="org.eclipse.equinox.p2.examples.rcp.sdkui.Application">
- </run>
- </application>
- </extension>
- <extension
- point="org.eclipse.ui.perspectives">
- <perspective
- name="RCP Perspective"
- class="org.eclipse.equinox.p2.examples.rcp.sdkui.Perspective"
- id="org.eclipse.equinox.p2.examples.rcp.sdkui.perspective">
- </perspective>
- </extension>
- <extension
- point="org.eclipse.ui.views">
- <view
- name="Message"
- allowMultiple="true"
- icon="icons/sample2.gif"
- class="org.eclipse.equinox.p2.examples.rcp.sdkui.View"
- id="org.eclipse.equinox.p2.examples.rcp.sdkui.view">
- </view>
- <view
- name="Mailboxes"
- allowMultiple="true"
- icon="icons/sample3.gif"
- class="org.eclipse.equinox.p2.examples.rcp.sdkui.NavigationView"
- id="org.eclipse.equinox.p2.examples.rcp.sdkui.navigationView">
- </view>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <category
- name="Mail"
- id="org.eclipse.equinox.p2.examples.rcp.sdkui.category">
- </category>
- <command
- name="Open Mailbox"
- description="Opens a mailbox"
- categoryId="org.eclipse.equinox.p2.examples.rcp.sdkui.category"
- id="org.eclipse.equinox.p2.examples.rcp.sdkui.open">
- </command>
- <command
- name="Open Message Dialog"
- description="Open a message dialog"
- categoryId="org.eclipse.equinox.p2.examples.rcp.sdkui.category"
- id="org.eclipse.equinox.p2.examples.rcp.sdkui.openMessage">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.bindings">
- <key
- commandId="org.eclipse.equinox.p2.examples.rcp.sdkui.open"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+2">
- </key>
- <key
- commandId="org.eclipse.equinox.p2.examples.rcp.sdkui.openMessage"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+3">
- </key>
- <key
- commandId="org.eclipse.ui.file.exit"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+X">
- </key>
- </extension>
- <extension
- id="product"
- point="org.eclipse.core.runtime.products">
- <product
- application="org.eclipse.equinox.p2.examples.rcp.sdkui.application"
- name="RCP Product">
- <property
- name="aboutText"
- value="RCP Mail template created by PDE">
- </property>
- <property
- name="windowImages"
- value="icons/sample2.gif">
- </property>
- <property
- name="aboutImage"
- value="product_lg.gif">
- </property>
- </product>
- </extension>
-
-</plugin>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/product_lg.gif b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/product_lg.gif
deleted file mode 100644
index bd95e28..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/product_lg.gif
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/sdkui.product b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/sdkui.product
deleted file mode 100644
index 4ce26a1..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/sdkui.product
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?pde version="3.5"?>
-
-<product name="RCP Mail Example (with p2 SDK UI)" id="org.eclipse.equinox.p2.examples.rcp.sdkui.product" application="org.eclipse.equinox.p2.examples.rcp.sdkui.application" version="1.0.0.qualifier" useFeatures="false">
-
- <aboutInfo>
- <image path="product_lg.gif"/>
- <text>
- RCP Mail Example (with p2 SDK UI)
- </text>
- </aboutInfo>
-
- <configIni use="default">
- </configIni>
-
- <launcherArgs>
- <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
- </launcherArgs>
-
- <windowImages i16="icons/sample2.gif"/>
-
- <splash
- location="org.eclipse.equinox.p2.examples.rcp.sdkui" />
- <launcher name="sdkui">
- <solaris/>
- <win useIco="false">
- <bmp/>
- </win>
- </launcher>
-
- <vm>
- </vm>
-
- <plugins>
- <plugin id="com.ibm.icu"/>
- <plugin id="org.apache.commons.codec"/>
- <plugin id="org.apache.commons.httpclient"/>
- <plugin id="org.apache.commons.logging"/>
- <plugin id="org.eclipse.core.commands"/>
- <plugin id="org.eclipse.core.contenttype"/>
- <plugin id="org.eclipse.core.databinding"/>
- <plugin id="org.eclipse.core.databinding.observable"/>
- <plugin id="org.eclipse.core.databinding.property"/>
- <plugin id="org.eclipse.core.expressions"/>
- <plugin id="org.eclipse.core.jobs"/>
- <plugin id="org.eclipse.core.runtime"/>
- <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
- <plugin id="org.eclipse.ecf"/>
- <plugin id="org.eclipse.ecf.filetransfer"/>
- <plugin id="org.eclipse.ecf.identity"/>
- <plugin id="org.eclipse.ecf.provider.filetransfer"/>
- <plugin id="org.eclipse.ecf.provider.filetransfer.httpclient"/>
- <plugin id="org.eclipse.ecf.provider.filetransfer.httpclient.ssl" fragment="true"/>
- <plugin id="org.eclipse.ecf.provider.filetransfer.ssl" fragment="true"/>
- <plugin id="org.eclipse.ecf.ssl" fragment="true"/>
- <plugin id="org.eclipse.equinox.app"/>
- <plugin id="org.eclipse.equinox.common"/>
- <plugin id="org.eclipse.equinox.frameworkadmin"/>
- <plugin id="org.eclipse.equinox.frameworkadmin.equinox"/>
- <plugin id="org.eclipse.equinox.p2.artifact.repository"/>
- <plugin id="org.eclipse.equinox.p2.core"/>
- <plugin id="org.eclipse.equinox.p2.director"/>
- <plugin id="org.eclipse.equinox.p2.directorywatcher"/>
- <plugin id="org.eclipse.equinox.p2.engine"/>
- <plugin id="org.eclipse.equinox.p2.examples.rcp.sdkui"/>
- <plugin id="org.eclipse.equinox.p2.exemplarysetup"/>
- <plugin id="org.eclipse.equinox.p2.extensionlocation"/>
- <plugin id="org.eclipse.equinox.p2.garbagecollector"/>
- <plugin id="org.eclipse.equinox.p2.jarprocessor"/>
- <plugin id="org.eclipse.equinox.p2.metadata"/>
- <plugin id="org.eclipse.equinox.p2.metadata.repository"/>
- <plugin id="org.eclipse.equinox.p2.publisher"/>
- <plugin id="org.eclipse.equinox.p2.touchpoint.eclipse"/>
- <plugin id="org.eclipse.equinox.p2.ui"/>
- <plugin id="org.eclipse.equinox.p2.ui.sdk"/>
- <plugin id="org.eclipse.equinox.p2.ui.sdk.scheduler"/>
- <plugin id="org.eclipse.equinox.p2.updatechecker"/>
- <plugin id="org.eclipse.equinox.p2.updatesite"/>
- <plugin id="org.eclipse.equinox.preferences"/>
- <plugin id="org.eclipse.equinox.registry"/>
- <plugin id="org.eclipse.equinox.security"/>
- <plugin id="org.eclipse.equinox.security.ui"/>
- <plugin id="org.eclipse.equinox.security.win32.x86" fragment="true"/>
- <plugin id="org.eclipse.equinox.simpleconfigurator"/>
- <plugin id="org.eclipse.equinox.simpleconfigurator.manipulator"/>
- <plugin id="org.eclipse.help"/>
- <plugin id="org.eclipse.jface"/>
- <plugin id="org.eclipse.jface.databinding"/>
- <plugin id="org.eclipse.osgi"/>
- <plugin id="org.eclipse.osgi.services"/>
- <plugin id="org.eclipse.swt"/>
- <plugin id="org.eclipse.swt.win32.win32.x86" fragment="true"/>
- <plugin id="org.eclipse.ui"/>
- <plugin id="org.eclipse.ui.workbench"/>
- <plugin id="org.sat4j.core"/>
- <plugin id="org.sat4j.pb"/>
- </plugins>
-
-
-</product>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/splash.bmp b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/splash.bmp
deleted file mode 100644
index d7d2e30..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/splash.bmp
+++ /dev/null
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Activator.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Activator.java
deleted file mode 100644
index be08d5a..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Activator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdkui;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.equinox.p2.examples.rcp.sdkui";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Application.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Application.java
deleted file mode 100644
index 333f4c6..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Application.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdkui;
-
-import org.eclipse.equinox.app.IApplication;
-import org.eclipse.equinox.app.IApplicationContext;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * This class controls all aspects of the application's execution
- */
-public class Application implements IApplication {
-
- /* (non-Javadoc)
- * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
- */
- public Object start(IApplicationContext context) {
- Display display = PlatformUI.createDisplay();
- try {
- int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
- if (returnCode == PlatformUI.RETURN_RESTART) {
- return IApplication.EXIT_RESTART;
- }
- return IApplication.EXIT_OK;
- } finally {
- display.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.equinox.app.IApplication#stop()
- */
- public void stop() {
- final IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench == null)
- return;
- final Display display = workbench.getDisplay();
- display.syncExec(new Runnable() {
- public void run() {
- if (!display.isDisposed())
- workbench.close();
- }
- });
- }
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationActionBarAdvisor.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationActionBarAdvisor.java
deleted file mode 100644
index 588f010..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationActionBarAdvisor.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdkui;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.ICoolBarManager;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarContributionItem;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-
-/**
- * An action bar advisor is responsible for creating, adding, and disposing of the
- * actions added to a workbench window. Each window will be populated with
- * new actions.
- */
-public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
-
- // Actions - important to allocate these only in makeActions, and then use them
- // in the fill methods. This ensures that the actions aren't recreated
- // when fillActionBars is called with FILL_PROXY.
- private IWorkbenchAction exitAction;
- private IWorkbenchAction aboutAction;
- private IWorkbenchAction newWindowAction;
- // XXX we want to show all update preferences
- private IWorkbenchAction preferencesAction;
- private OpenViewAction openViewAction;
- private Action messagePopupAction;
-
-
- public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
- super(configurer);
- }
-
- protected void makeActions(final IWorkbenchWindow window) {
- // Creates the actions and registers them.
- // Registering is needed to ensure that key bindings work.
- // The corresponding commands keybindings are defined in the plugin.xml file.
- // Registering also provides automatic disposal of the actions when
- // the window is closed.
-
- exitAction = ActionFactory.QUIT.create(window);
- register(exitAction);
-
- aboutAction = ActionFactory.ABOUT.create(window);
- register(aboutAction);
-
- newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create(window);
- register(newWindowAction);
-
- //XXX preferences action
- preferencesAction = ActionFactory.PREFERENCES.create(window);
- register(preferencesAction);
-
- openViewAction = new OpenViewAction(window, "Open Another Message View", View.ID);
- register(openViewAction);
-
- messagePopupAction = new MessagePopupAction("Open Message", window);
- register(messagePopupAction);
- }
-
- protected void fillMenuBar(IMenuManager menuBar) {
- MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
- // XXX Window menu
- MenuManager windowMenu = new MenuManager("&Window", IWorkbenchActionConstants.M_WINDOW);
- MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);
-
- menuBar.add(fileMenu);
- // XXX Window menu
- menuBar.add(windowMenu);
- // Add a group marker indicating where action set menus will appear.
- menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- menuBar.add(helpMenu);
-
- // File
- fileMenu.add(newWindowAction);
- fileMenu.add(new Separator());
- fileMenu.add(messagePopupAction);
- fileMenu.add(openViewAction);
- fileMenu.add(new Separator());
- fileMenu.add(exitAction);
-
- // XXX Window menu
- windowMenu.add(preferencesAction);
-
- // Help
- // XXX add an additions group because this is what SDK UI expects
- helpMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- helpMenu.add(new Separator());
- helpMenu.add(aboutAction);
-
- }
-
- protected void fillCoolBar(ICoolBarManager coolBar) {
- IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
- coolBar.add(new ToolBarContributionItem(toolbar, "main"));
- toolbar.add(openViewAction);
- toolbar.add(messagePopupAction);
- }
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchAdvisor.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchAdvisor.java
deleted file mode 100644
index effefa1..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchAdvisor.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdkui;
-
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchAdvisor;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-/**
- * This workbench advisor creates the window advisor, and specifies
- * the perspective id for the initial window.
- */
-public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
-
- public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
- return new ApplicationWorkbenchWindowAdvisor(configurer);
- }
-
- public String getInitialWindowPerspectiveId() {
- return Perspective.ID;
- }
-
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchWindowAdvisor.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchWindowAdvisor.java
deleted file mode 100644
index 0391fe0..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchWindowAdvisor.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdkui;
-
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
-
- public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
- super(configurer);
- }
-
- public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
- return new ApplicationActionBarAdvisor(configurer);
- }
-
- public void preWindowOpen() {
- IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
- configurer.setInitialSize(new Point(600, 400));
- configurer.setShowCoolBar(true);
- // XXX We set the status line and progress indicator so that update
- // information can be shown there
- configurer.setShowStatusLine(true);
- configurer.setShowProgressIndicator(true);
- }
-
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ICommandIds.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ICommandIds.java
deleted file mode 100644
index 1f4928f..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ICommandIds.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdkui;
-
-/**
- * Interface defining the application's command IDs.
- * Key bindings can be defined for specific commands.
- * To associate an action with a command, use IAction.setActionDefinitionId(commandId).
- *
- * @see org.eclipse.jface.action.IAction#setActionDefinitionId(String)
- */
-public interface ICommandIds {
-
- public static final String CMD_OPEN = "org.eclipse.equinox.p2.examples.rcp.sdkui.open";
- public static final String CMD_OPEN_MESSAGE = "org.eclipse.equinox.p2.examples.rcp.sdkui.openMessage";
-
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/MessagePopupAction.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/MessagePopupAction.java
deleted file mode 100644
index 2237493..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/MessagePopupAction.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdkui;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchWindow;
-
-
-public class MessagePopupAction extends Action {
-
- private final IWorkbenchWindow window;
-
- MessagePopupAction(String text, IWorkbenchWindow window) {
- super(text);
- this.window = window;
- // The id is used to refer to the action in a menu or toolbar
- setId(ICommandIds.CMD_OPEN_MESSAGE);
- // Associate the action with a pre-defined command, to allow key bindings.
- setActionDefinitionId(ICommandIds.CMD_OPEN_MESSAGE);
- setImageDescriptor(org.eclipse.equinox.p2.examples.rcp.sdkui.Activator.getImageDescriptor("/icons/sample3.gif"));
- }
-
- public void run() {
- MessageDialog.openInformation(window.getShell(), "Open", "Open Message Dialog!");
- }
-}
\ No newline at end of file
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/NavigationView.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/NavigationView.java
deleted file mode 100644
index 5afca7c..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/NavigationView.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdkui;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
-
-public class NavigationView extends ViewPart {
- public static final String ID = "org.eclipse.equinox.p2.examples.rcp.sdkui.navigationView";
- private TreeViewer viewer;
-
- class TreeObject {
- private String name;
- private TreeParent parent;
-
- public TreeObject(String name) {
- this.name = name;
- }
- public String getName() {
- return name;
- }
- public void setParent(TreeParent parent) {
- this.parent = parent;
- }
- public TreeParent getParent() {
- return parent;
- }
- public String toString() {
- return getName();
- }
- }
-
- class TreeParent extends TreeObject {
- private ArrayList children;
- public TreeParent(String name) {
- super(name);
- children = new ArrayList();
- }
- public void addChild(TreeObject child) {
- children.add(child);
- child.setParent(this);
- }
- public void removeChild(TreeObject child) {
- children.remove(child);
- child.setParent(null);
- }
- public TreeObject[] getChildren() {
- return (TreeObject[]) children.toArray(new TreeObject[children.size()]);
- }
- public boolean hasChildren() {
- return children.size()>0;
- }
- }
-
- class ViewContentProvider implements IStructuredContentProvider,
- ITreeContentProvider {
-
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- }
-
- public void dispose() {
- }
-
- public Object[] getElements(Object parent) {
- return getChildren(parent);
- }
-
- public Object getParent(Object child) {
- if (child instanceof TreeObject) {
- return ((TreeObject)child).getParent();
- }
- return null;
- }
-
- public Object[] getChildren(Object parent) {
- if (parent instanceof TreeParent) {
- return ((TreeParent)parent).getChildren();
- }
- return new Object[0];
- }
-
- public boolean hasChildren(Object parent) {
- if (parent instanceof TreeParent)
- return ((TreeParent)parent).hasChildren();
- return false;
- }
- }
-
- class ViewLabelProvider extends LabelProvider {
-
- public String getText(Object obj) {
- return obj.toString();
- }
- public Image getImage(Object obj) {
- String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
- if (obj instanceof TreeParent)
- imageKey = ISharedImages.IMG_OBJ_FOLDER;
- return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
- }
- }
-
- /**
- * We will set up a dummy model to initialize tree heararchy. In real
- * code, you will connect to a real model and expose its hierarchy.
- */
- private TreeObject createDummyModel() {
- TreeObject to1 = new TreeObject("Inbox");
- TreeObject to2 = new TreeObject("Drafts");
- TreeObject to3 = new TreeObject("Sent");
- TreeParent p1 = new TreeParent("me@this.com");
- p1.addChild(to1);
- p1.addChild(to2);
- p1.addChild(to3);
-
- TreeObject to4 = new TreeObject("Inbox");
- TreeParent p2 = new TreeParent("other@aol.com");
- p2.addChild(to4);
-
- TreeParent root = new TreeParent("");
- root.addChild(p1);
- root.addChild(p2);
- return root;
- }
-
- /**
- * This is a callback that will allow us to create the viewer and initialize
- * it.
- */
- public void createPartControl(Composite parent) {
- viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- viewer.setContentProvider(new ViewContentProvider());
- viewer.setLabelProvider(new ViewLabelProvider());
- viewer.setInput(createDummyModel());
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- public void setFocus() {
- viewer.getControl().setFocus();
- }
-}
\ No newline at end of file
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/OpenViewAction.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/OpenViewAction.java
deleted file mode 100644
index ea54ddf..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/OpenViewAction.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdkui;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-
-
-public class OpenViewAction extends Action {
-
- private final IWorkbenchWindow window;
- private int instanceNum = 0;
- private final String viewId;
-
- public OpenViewAction(IWorkbenchWindow window, String label, String viewId) {
- this.window = window;
- this.viewId = viewId;
- setText(label);
- // The id is used to refer to the action in a menu or toolbar
- setId(ICommandIds.CMD_OPEN);
- // Associate the action with a pre-defined command, to allow key bindings.
- setActionDefinitionId(ICommandIds.CMD_OPEN);
- setImageDescriptor(org.eclipse.equinox.p2.examples.rcp.sdkui.Activator.getImageDescriptor("/icons/sample2.gif"));
- }
-
- public void run() {
- if(window != null) {
- try {
- window.getActivePage().showView(viewId, Integer.toString(instanceNum++), IWorkbenchPage.VIEW_ACTIVATE);
- } catch (PartInitException e) {
- MessageDialog.openError(window.getShell(), "Error", "Error opening view:" + e.getMessage());
- }
- }
- }
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Perspective.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Perspective.java
deleted file mode 100644
index d25e023..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Perspective.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdkui;
-
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-
-public class Perspective implements IPerspectiveFactory {
-
- /**
- * The ID of the perspective as specified in the extension.
- */
- public static final String ID = "org.eclipse.equinox.p2.examples.rcp.sdkui.perspective";
-
- public void createInitialLayout(IPageLayout layout) {
- String editorArea = layout.getEditorArea();
- layout.setEditorAreaVisible(false);
-
- layout.addStandaloneView(NavigationView.ID, false, IPageLayout.LEFT, 0.25f, editorArea);
- IFolderLayout folder = layout.createFolder("messages", IPageLayout.TOP, 0.5f, editorArea);
- folder.addPlaceholder(View.ID + ":*");
- folder.addView(View.ID);
-
- layout.getViewLayout(NavigationView.ID).setCloseable(false);
- }
-}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/View.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/View.java
deleted file mode 100644
index 7a3b021..0000000
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/View.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.eclipse.equinox.p2.examples.rcp.sdkui;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.part.ViewPart;
-
-public class View extends ViewPart {
-
- public static final String ID = "org.eclipse.equinox.p2.examples.rcp.sdkui.view";
-
- public void createPartControl(Composite parent) {
- Composite top = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- top.setLayout(layout);
- // top banner
- Composite banner = new Composite(top, SWT.NONE);
- banner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
- layout = new GridLayout();
- layout.marginHeight = 5;
- layout.marginWidth = 10;
- layout.numColumns = 2;
- banner.setLayout(layout);
-
- // setup bold font
- Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
-
- Label l = new Label(banner, SWT.WRAP);
- l.setText("Subject:");
- l.setFont(boldFont);
- l = new Label(banner, SWT.WRAP);
- l.setText("This is a message about the cool Eclipse RCP!");
-
- l = new Label(banner, SWT.WRAP);
- l.setText("From:");
- l.setFont(boldFont);
-
- final Link link = new Link(banner, SWT.NONE);
- link.setText("<a>nicole@mail.org</a>");
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MessageDialog.openInformation(getSite().getShell(), "Not Implemented", "Imagine the address book or a new message being created now.");
- }
- });
-
- l = new Label(banner, SWT.WRAP);
- l.setText("Date:");
- l.setFont(boldFont);
- l = new Label(banner, SWT.WRAP);
- l.setText("10:34 am");
- // message contents
- Text text = new Text(top, SWT.MULTI | SWT.WRAP);
- text.setText("This RCP Application was generated from the PDE Plug-in Project wizard. This sample shows how to:\n"+
- "- add a top-level menu and toolbar with actions\n"+
- "- add keybindings to actions\n" +
- "- create views that can't be closed and\n"+
- " multiple instances of the same view\n"+
- "- perspectives with placeholders for new views\n"+
- "- use the default about dialog\n"+
- "- create a product definition\n");
- text.setLayoutData(new GridData(GridData.FILL_BOTH));
- }
-
- public void setFocus() {
- }
-}
diff --git a/features/org.eclipse.equinox.p2.sdk/.project b/features/org.eclipse.equinox.p2.sdk/.project
deleted file mode 100644
index e03ca7e..0000000
--- a/features/org.eclipse.equinox.p2.sdk/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.equinox.p2.sdk</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/features/org.eclipse.equinox.p2.sdk/build.properties b/features/org.eclipse.equinox.p2.sdk/build.properties
deleted file mode 100644
index 046530f..0000000
--- a/features/org.eclipse.equinox.p2.sdk/build.properties
+++ /dev/null
@@ -1,56 +0,0 @@
-###############################################################################
-# Copyright (c) 2009 EclipseSource 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:
-# EclipseSource - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,license.html,epl-v10.html,license.html,feature.properties
-
-generate.plugin@org.apache.commons.codec.source=org.apache.commons.codec
-generate.plugin@org.apache.commons.httpclient.source=org.apache.commons.httpclient
-generate.plugin@org.apache.commons.logging.source=org.apache.commons.logging
-generate.plugin@org.eclipse.ecf.filetransfer.source=org.eclipse.ecf.filetransfer
-generate.plugin@org.eclipse.ecf.identity.source=org.eclipse.ecf.identity
-generate.plugin@org.eclipse.ecf.provider.filetransfer.httpclient.source=org.eclipse.ecf.provider.filetransfer.httpclient
-generate.plugin@org.eclipse.ecf.provider.filetransfer.httpclient.ssl.source=org.eclipse.ecf.provider.filetransfer.httpclient.ssl
-generate.plugin@org.eclipse.ecf.provider.filetransfer.source=org.eclipse.ecf.provider.filetransfer
-generate.plugin@org.eclipse.ecf.provider.filetransfer.ssl.source=org.eclipse.ecf.provider.filetransfer.ssl
-generate.plugin@org.eclipse.ecf.source=org.eclipse.ecf
-generate.plugin@org.eclipse.ecf.ssl.source=org.eclipse.ecf.ssl
-generate.plugin@org.eclipse.equinox.frameworkadmin.equinox.source=org.eclipse.equinox.frameworkadmin.equinox
-generate.plugin@org.eclipse.equinox.frameworkadmin.source=org.eclipse.equinox.frameworkadmin
-generate.plugin@org.eclipse.equinox.p2.artifact.repository.source=org.eclipse.equinox.p2.artifact.repository
-generate.plugin@org.eclipse.equinox.p2.console.source=org.eclipse.equinox.p2.console
-generate.plugin@org.eclipse.equinox.p2.core.source=org.eclipse.equinox.p2.core
-generate.plugin@org.eclipse.equinox.p2.director.app.source=org.eclipse.equinox.p2.director.app
-generate.plugin@org.eclipse.equinox.p2.director.source=org.eclipse.equinox.p2.director
-generate.plugin@org.eclipse.equinox.p2.directorywatcher.source=org.eclipse.equinox.p2.directorywatcher
-generate.plugin@org.eclipse.equinox.p2.engine.source=org.eclipse.equinox.p2.engine
-generate.plugin@org.eclipse.equinox.p2.exemplarysetup.source=org.eclipse.equinox.p2.exemplarysetup
-generate.plugin@org.eclipse.equinox.p2.extensionlocation.source=org.eclipse.equinox.p2.extensionlocation
-generate.plugin@org.eclipse.equinox.p2.garbagecollector.source=org.eclipse.equinox.p2.garbagecollector
-generate.plugin@org.eclipse.equinox.p2.installer.source=org.eclipse.equinox.p2.installer
-generate.plugin@org.eclipse.equinox.p2.jarprocessor.source=org.eclipse.equinox.p2.jarprocessor
-generate.plugin@org.eclipse.equinox.p2.metadata.generator.source=org.eclipse.equinox.p2.metadata.generator
-generate.plugin@org.eclipse.equinox.p2.metadata.repository.source=org.eclipse.equinox.p2.metadata.repository
-generate.plugin@org.eclipse.equinox.p2.metadata.source=org.eclipse.equinox.p2.metadata
-generate.plugin@org.eclipse.equinox.p2.publisher.source=org.eclipse.equinox.p2.publisher
-generate.plugin@org.eclipse.equinox.p2.ql.source=org.eclipse.equinox.p2.ql
-generate.plugin@org.eclipse.equinox.p2.reconciler.dropins.source=org.eclipse.equinox.p2.reconciler.dropins
-generate.plugin@org.eclipse.equinox.p2.repository.source=org.eclipse.equinox.p2.repository
-generate.plugin@org.eclipse.equinox.p2.repository.tools.source=org.eclipse.equinox.p2.repository.tools
-generate.plugin@org.eclipse.equinox.p2.touchpoint.eclipse.source=org.eclipse.equinox.p2.touchpoint.eclipse
-generate.plugin@org.eclipse.equinox.p2.touchpoint.natives.source=org.eclipse.equinox.p2.touchpoint.natives
-generate.plugin@org.eclipse.equinox.p2.ui.admin.rcp.source=org.eclipse.equinox.p2.ui.admin.rcp
-generate.plugin@org.eclipse.equinox.p2.ui.admin.source=org.eclipse.equinox.p2.ui.admin
-generate.plugin@org.eclipse.equinox.p2.ui.sdk.scheduler.source=org.eclipse.equinox.p2.ui.sdk.scheduler
-generate.plugin@org.eclipse.equinox.p2.ui.sdk.source=org.eclipse.equinox.p2.ui.sdk
-generate.plugin@org.eclipse.equinox.p2.ui.source=org.eclipse.equinox.p2.ui
-generate.plugin@org.eclipse.equinox.p2.updatechecker.source=org.eclipse.equinox.p2.updatechecker
-generate.plugin@org.eclipse.equinox.p2.updatesite.source=org.eclipse.equinox.p2.updatesite
-generate.plugin@org.eclipse.equinox.simpleconfigurator.manipulator.source=org.eclipse.equinox.simpleconfigurator.manipulator
-generate.plugin@org.eclipse.equinox.simpleconfigurator.source=org.eclipse.equinox.simpleconfigurator
diff --git a/features/org.eclipse.equinox.p2.sdk/epl-v10.html b/features/org.eclipse.equinox.p2.sdk/epl-v10.html
deleted file mode 100755
index ed4b196..0000000
--- a/features/org.eclipse.equinox.p2.sdk/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>"Contribution" means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>"Contributor" means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>"Licensed Patents " mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>"Program" means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>"Recipient" means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor ("Commercial
-Contributor") hereby agrees to defend and indemnify every other
-Contributor ("Indemnified Contributor") against any losses, damages and
-costs (collectively "Losses") arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/features/org.eclipse.equinox.p2.sdk/feature.properties b/features/org.eclipse.equinox.p2.sdk/feature.properties
deleted file mode 100755
index 9ab876c..0000000
--- a/features/org.eclipse.equinox.p2.sdk/feature.properties
+++ /dev/null
@@ -1,147 +0,0 @@
-###############################################################################
-# Copyright (c) 2009 EclipseSource 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:
-# EclipseSource - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Equinox p2 SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Equinox Project
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Equinox Project Repository
-
-# "description" property - description of the feature
-description=All of the bundles and source that comprise the Equinox p2 provisioning platform. \n\
-This feature includes the corresponding source and is intended \
-to be added to target platforms at development time rather than \
-deployed with end-user systems.
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2009 EclipseSource and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- EclipseSource - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-March 17, 2005\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/features/org.eclipse.equinox.p2.sdk/feature.xml b/features/org.eclipse.equinox.p2.sdk/feature.xml
deleted file mode 100644
index cecb807..0000000
--- a/features/org.eclipse.equinox.p2.sdk/feature.xml
+++ /dev/null
@@ -1,660 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.equinox.p2.sdk"
- label="%featureName"
- version="3.5.0.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <plugin
- id="org.apache.commons.codec"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.apache.commons.codec.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.apache.commons.httpclient"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.apache.commons.httpclient.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.apache.commons.logging"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.apache.commons.logging.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.artifact.repository"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.artifact.repository.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.console"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.console.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.core.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.director"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.director.app"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.director.app.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.director.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.directorywatcher"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.directorywatcher.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.engine"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.engine.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.exemplarysetup"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.exemplarysetup.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.extensionlocation"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.extensionlocation.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.garbagecollector"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.garbagecollector.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.jarprocessor"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.installer"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.installer.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.jarprocessor.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.metadata"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.metadata.generator"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.metadata.generator.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.metadata.repository"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.metadata.repository.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.metadata.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.publisher"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.publisher.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.reconciler.dropins"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.reconciler.dropins.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.repository"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.repository.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.repository.tools"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.repository.tools.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.touchpoint.eclipse"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.touchpoint.eclipse.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.touchpoint.natives"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.touchpoint.natives.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.ui.admin.rcp"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.ui.admin.rcp.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.ui.admin"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.ui.admin.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.ui.sdk"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.ui.sdk.scheduler"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.ui.sdk.scheduler.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.ui.sdk.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.ui.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.updatechecker"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.updatechecker.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.updatesite"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.updatesite.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.filetransfer"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.filetransfer.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.identity"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.identity.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.provider.filetransfer"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.provider.filetransfer.httpclient"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.provider.filetransfer.httpclient.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.provider.filetransfer.httpclient.ssl"
- download-size="0"
- install-size="0"
- version="0.0.0"
- fragment="true"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.provider.filetransfer.httpclient.ssl.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.provider.filetransfer.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.provider.filetransfer.ssl"
- download-size="0"
- install-size="0"
- version="0.0.0"
- fragment="true"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.provider.filetransfer.ssl.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.ssl"
- download-size="0"
- install-size="0"
- version="0.0.0"
- fragment="true"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.ssl.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.simpleconfigurator"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.simpleconfigurator.manipulator"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.simpleconfigurator.manipulator.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.simpleconfigurator.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.frameworkadmin"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.frameworkadmin.equinox"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.frameworkadmin.equinox.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.frameworkadmin.source"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.sat4j.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.sat4j.pb"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.common"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.operations"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.equinox.p2.ql"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.equinox.p2.sdk/license.html b/features/org.eclipse.equinox.p2.sdk/license.html
deleted file mode 100755
index c6af966..0000000
--- a/features/org.eclipse.equinox.p2.sdk/license.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS
- modules ("Modules") and made available as downloadable archives ("Downloads").</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
-Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-</body>
-</html>