Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2007-09-30 14:11:02 -0400
committerJohn Arthorne2007-09-30 14:11:02 -0400
commit2ccb446cc885495686cc9eb430c4a98031b3cfc5 (patch)
tree207e30d5f61856ece926ed3548297aa3958132c9
parentc4f6662ccd02bb75cba95a6ae56a2da38c6cadde (diff)
downloadrt.equinox.p2-2ccb446cc885495686cc9eb430c4a98031b3cfc5.tar.gz
rt.equinox.p2-2ccb446cc885495686cc9eb430c4a98031b3cfc5.tar.xz
rt.equinox.p2-2ccb446cc885495686cc9eb430c4a98031b3cfc5.zip
Renamed prov bundles to p2
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.jdt.core.prefs343
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF29
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/build.properties16
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/plugin.xml21
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/schema/artifactRepositories.exsd124
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/schema/processingSteps.exsd110
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/Activator.java39
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ArtifactRepositoryIO.java74
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ArtifactRepositoryManager.java296
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ArtifactRequest.java90
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ECFTransport.java128
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/FileDownloadRequest.java41
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/MirrorRequest.java73
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/SignatureVerifier.java81
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/SimpleArtifactRepository.java333
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/SimpleArtifactRepositoryFactory.java46
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/Unpack200Step.java103
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/ArtifactDescriptor.java98
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactDescriptor.java29
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRepository.java73
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRepositoryFactory.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRepositoryManager.java85
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRequest.java33
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IWritableArtifactRepository.java56
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/Mapper.java130
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/RepositoryDescriptor.java39
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/Transport.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/processing/ProcessingStep.java116
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/processing/ProcessingStepDescriptor.java86
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/processing/ProcessingStepHandler.java74
-rw-r--r--bundles/org.eclipse.equinox.p2.console/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.console/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.console/.settings/org.eclipse.jdt.core.prefs340
-rw-r--r--bundles/org.eclipse.equinox.p2.console/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF29
-rw-r--r--bundles/org.eclipse.equinox.p2.console/Provisioning console.launch19
-rw-r--r--bundles/org.eclipse.equinox.p2.console/build.properties14
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/prov/console/Activator.java77
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/prov/console/ProvCommandProvider.java345
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/prov/console/ProvisioningHelper.java288
-rw-r--r--bundles/org.eclipse.equinox.p2.core/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.core/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.core.prefs331
-rw-r--r--bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF27
-rw-r--r--bundles/org.eclipse.equinox.p2.core/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.core/build.properties15
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Activator.java176
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/BasicLocation.java226
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Locker.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Locker_JavaIo.java53
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Locker_JavaNio.java66
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Messages.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/messages.properties10
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/ProvisionException.java23
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/eventbus/ProvisioningEventBus.java81
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/eventbus/ProvisioningListener.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/eventbus/SynchronousProvisioningListener.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/ArrayUtils.java58
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/FileUtils.java212
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/Headers.java300
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/LogHelper.java60
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/Messages.java27
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/MultiStatus.java258
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/MultiStatusUtil.java244
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/OrderedProperties.java163
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/ServiceHelper.java46
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/TwoTierMap.java354
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/UnmodifiableProperties.java44
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/Utils.java56
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/messages.properties15
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/location/AgentLocation.java27
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/AbstractRepository.java110
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/IRepositoryInfo.java82
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/IWritableRepositoryInfo.java56
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/RepositoryCreationException.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/.cvsignore1
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/.settings/org.eclipse.jdt.core.prefs331
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF23
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/build.properties15
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/config.ini87
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/director app.launch23
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/director.product30
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/plugin.xml18
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/prov/internal/director/app/Activator.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/prov/internal/director/app/Application.java201
-rw-r--r--bundles/org.eclipse.equinox.p2.director/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.director/.cvsignore1
-rw-r--r--bundles/org.eclipse.equinox.p2.director/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.jdt.core.prefs331
-rw-r--r--bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF25
-rw-r--r--bundles/org.eclipse.equinox.p2.director/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.director/build.properties15
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/BasicIUFilter.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/DirectorActivator.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/IUFilter.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/IUTransformationHelper.java35
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/Messages.java44
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/OperationGenerator.java126
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/Picker.java129
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/RequirementBasedFilter.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/messages.properties28
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/rollback/FormerState.java75
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/prov/director/IDirector.java54
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/prov/director/NewDependencyExpander.java573
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/prov/director/NewSimpleDirector.java329
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/prov/director/Oracle.java164
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/prov/director/TrackedHashSet.java44
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/prov/director/director.txt30
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/.settings/org.eclipse.jdt.core.prefs334
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF28
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/build.properties16
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/plugin.xml13
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/schema/touchpoints.exsd158
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/prov/engine/CommonDef.java63
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/prov/engine/EngineActivator.java64
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/prov/engine/Messages.java44
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/prov/engine/NullTouchpoint.java43
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/prov/engine/TouchpointManager.java223
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/prov/engine/messages.properties29
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/AbstractProvisioningTransaction.java135
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/BeginOperationEvent.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/CommitOperationEvent.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/DefaultPhaseSet.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/Engine.java83
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/EngineSession.java33
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/IProfileRegistry.java53
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/IProvisioningAction.java36
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/ITouchpoint.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/ITouchpointAction.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/IUPhase.java100
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/InstallableUnitEvent.java68
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/Operand.java35
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/Phase.java61
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/PhaseSet.java64
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/Profile.java142
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/ProfileEvent.java36
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/ProvisioningConfigurationException.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/RollbackOperationEvent.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/SimpleProfileRegistry.java184
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/TransactionEvent.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/Utils.java25
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/phases/Collect.java76
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/phases/Install.java60
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/phases/Messages.java33
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/phases/Uninstall.java58
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/engine/phases/messages.properties17
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/installregistry/IInstallRegistry.java171
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/installregistry/IProfileInstallRegistry.java27
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/prov/installregistry/InstallRegistry.java181
-rw-r--r--bundles/org.eclipse.equinox.p2.exemplarysetup/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.exemplarysetup/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.exemplarysetup/.settings/org.eclipse.jdt.core.prefs339
-rw-r--r--bundles/org.eclipse.equinox.p2.exemplarysetup/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.exemplarysetup/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.exemplarysetup/META-INF/MANIFEST.MF20
-rw-r--r--bundles/org.eclipse.equinox.p2.exemplarysetup/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.exemplarysetup/build.properties15
-rw-r--r--bundles/org.eclipse.equinox.p2.exemplarysetup/src/org/eclipse/equinox/internal/prov/examplarysetup/Activator.java137
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/.cvsignore2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/.settings/org.eclipse.jdt.core.prefs331
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/CDC-1.0_Foundation-1.0.profile19
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/CDC-1.1_Foundation-1.1.profile24
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/J2SE-1.2.profile42
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/J2SE-1.3.profile63
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/J2SE-1.4.profile118
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/J2SE-1.5.profile146
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/JRE-1.1.profile17
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/JavaSE-1.6.profile145
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/META-INF/MANIFEST.MF26
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/Metadata Generator CDT.launch21
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/Metadata Generator SDK.launch22
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/OSGi_Minimum-1.0.profile17
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/OSGi_Minimum-1.1.profile18
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/build.properties26
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/config.ini57
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/generator.product30
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/plugin.xml22
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/prov/metadata/generator/Activator.java32
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/prov/metadata/generator/EclipseGeneratorApplication.java295
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/prov/metadata/generator/features/FeatureParser.java238
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/prov/metadata/generator/BundleDescriptionFactory.java121
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/prov/metadata/generator/EclipseInstallGeneratorInfoProvider.java358
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/prov/metadata/generator/Feature.java271
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/prov/metadata/generator/FeatureEntry.java175
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/prov/metadata/generator/Generator.java338
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/prov/metadata/generator/GeneratorBundleInfo.java150
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/prov/metadata/generator/IGeneratorInfo.java65
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/prov/metadata/generator/IPlatformEntry.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/prov/metadata/generator/MetadataGeneratorHelper.java504
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/prov/metadata/generator/URLEntry.java39
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/.settings/org.eclipse.jdt.core.prefs331
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF27
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/build.properties16
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/plugin.xml9
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/schema/metadataRepositories.exsd124
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/prov/metadata/repository/AbstractMetadataRepository.java69
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/prov/metadata/repository/Activator.java35
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/prov/metadata/repository/LocalMetadataRepository.java150
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/prov/metadata/repository/Messages.java27
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/prov/metadata/repository/MetadataCache.java80
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/prov/metadata/repository/MetadataRepositoryIO.java65
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/prov/metadata/repository/MetadataRepositoryManager.java294
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/prov/metadata/repository/SimpleMetadataRepositoryFactory.java67
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/prov/metadata/repository/URLMetadataRepository.java103
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/prov/metadata/repository/messages.properties13
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/prov/metadata/repository/IMetadataRepository.java43
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/prov/metadata/repository/IMetadataRepositoryFactory.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/prov/metadata/repository/IMetadataRepositoryManager.java45
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/prov/metadata/repository/IWritableMetadataRepository.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/.settings/org.eclipse.jdt.core.prefs331
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF19
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/build.properties15
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/prov/metadata/ArtifactKey.java84
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/prov/metadata/InternalInstallableUnit.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/prov/metadata/Messages.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/prov/metadata/MetadataActivator.java32
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/prov/metadata/messages.properties14
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/ConstrainableElement.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/IArtifactKey.java54
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/IInstallableUnit.java72
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/IInstallableUnitConstants.java36
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/IInstallableUnitFragment.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/IMetadataVisitor.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/IResolvedInstallableUnit.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/IResolvedInstallableUnitFragment.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/Inclusion.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/InstallableUnit.java217
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/InstallableUnitFragment.java67
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/ProvidedCapability.java73
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/Recommendation.java125
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/RecommendationDescriptor.java116
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/RequiredCapability.java158
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/ResolvedInstallableUnit.java148
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/ResolvedInstallableUnitFragment.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/Selector.java44
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/TouchpointData.java55
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/metadata/TouchpointType.java78
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/query/CompoundIterator.java98
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/query/IQueryable.java25
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/query/Query.java73
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/query/QueryableArray.java47
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/resolution/ResolutionHelper.java171
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/resolution/StateMetadataMap.java34
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/resolution/Transformer.java141
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/prov/resolution/UnsatisfiedCapability.java56
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.jdt.core.prefs340
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF41
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/Test Director CDT.launch40
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/Test Director SDK.launch43
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/Test Director Uninstall CDT.launch40
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/Test Director Uninstall SDK.launch21
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/build.properties18
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/plugin.xml34
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/AbstractProvisioningTest.java181
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/AutomatedTests.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/TestActivator.java56
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/TestArtifactRepository.java157
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/TestMetadataRepository.java95
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/artifact/repository/AllTests.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/artifact/repository/JarURLRepositoryTest.java47
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/artifact/repository/processing/Adder.java54
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/artifact/repository/processing/ByteShifter.java73
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/artifact/repository/processing/Counter.java86
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/artifact/repository/processing/MD5Verifier.java90
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/artifact/repository/processing/Multiplier.java54
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/artifact/repository/processing/Pack200Unpacker.java107
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/artifact/repository/processing/ProcessingStepHandlerTest.java207
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/director/AllTests.java36
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/director/AutomatedDirectorTest.java256
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/director/Bug203637.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/director/OperationGenerationTest.java196
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/director/OracleTest.java74
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/director/OracleTest2.java89
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/director/PickerTest.java104
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/director/RollbackTest.java55
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/director/SingletonTest.java81
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/director/UninstallTest.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/director/UpdateTestWithEntryPoint.java77
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/director/UpdateTestWithoutEntryPoint.java77
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/download/AllTests.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/download/DownloadManagerTest.java32
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/engine/AllTests.java29
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/engine/EngineTest.java235
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/engine/PhaseSetTest.java54
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/engine/PhaseTest.java94
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/engine/ProfileTest.java45
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/full/DirectorTest.java145
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/full/End2EndTest.java248
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/metadata/AllTests.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/metadata/FragmentMethodTest.java178
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/metadata/FragmentTest.java147
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/metadata/MultipleIUAndFragmentTest.java92
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/metadata/OldTest.java107
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/metadata/RecommendationTest.java178
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/metadata/ResolutionHelperTest.java302
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/metadata/repository/AllTests.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/metadata/repository/JarURLRepositoryTest.java45
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/enginerepo.jarbin0 -> 47329 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/jarprocessor.jar.pack.gzbin0 -> 13587 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tools/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.tools/.cvsignore1
-rw-r--r--bundles/org.eclipse.equinox.p2.tools/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.tools/.settings/org.eclipse.jdt.core.prefs331
-rw-r--r--bundles/org.eclipse.equinox.p2.tools/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.tools/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.tools/META-INF/MANIFEST.MF16
-rw-r--r--bundles/org.eclipse.equinox.p2.tools/ProvTools - compare repos.launch21
-rw-r--r--bundles/org.eclipse.equinox.p2.tools/ProvTools - list profile.launch22
-rw-r--r--bundles/org.eclipse.equinox.p2.tools/build.properties14
-rw-r--r--bundles/org.eclipse.equinox.p2.tools/plugin.xml14
-rw-r--r--bundles/org.eclipse.equinox.p2.tools/src/org/eclipse/equinox/prov/tools/MetadataCompareApplication.java230
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.settings/org.eclipse.jdt.core.prefs334
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF26
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/build.properties16
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/plugin.xml8
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/prov/touchpoint/eclipse/Activator.java32
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/prov/touchpoint/eclipse/EclipseTouchpoint.java490
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/.settings/org.eclipse.jdt.core.prefs331
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF22
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/build.properties16
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/plugin.xml8
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/prov/touchpoint/natives/Activator.java40
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/prov/touchpoint/natives/BackupFiles.java319
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/prov/touchpoint/natives/Messages.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/prov/touchpoint/natives/NativeTouchpoint.java178
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/prov/touchpoint/natives/Permissions.java29
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/prov/touchpoint/natives/Util.java62
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/prov/touchpoint/natives/Zip.java75
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/prov/touchpoint/natives/messages.properties18
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/.cvsignore1
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/.settings/org.eclipse.jdt.core.prefs331
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/.settings/org.eclipse.pde.core.prefs3
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/META-INF/MANIFEST.MF16
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/ProvAdminUI.launch22
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/build.properties21
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/config.ini49
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/icons/provision.gifbin0 -> 368 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/plugin.properties20
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/plugin.xml42
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/plugin_customization.ini2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/rcp.product79
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/Activator.java69
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/Application.java55
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationActionBarAdvisor.java48
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationWorkbenchAdvisor.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ApplicationWorkbenchWindowAdvisor.java34
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/ProvisioningRCPPerspective.java48
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/internal/ProvAdminUIMessages.java31
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin.rcp/src/org/eclipse/equinox/prov/ui/admin/rcp/internal/messages.properties15
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/.cvsignore1
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/.settings/org.eclipse.jdt.core.prefs331
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/META-INF/MANIFEST.MF33
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/build.properties21
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/icons/obj/artifact_repo_obj.gifbin0 -> 545 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/icons/obj/iu_obj.gifbin0 -> 585 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/icons/obj/metadata_repo_obj.gifbin0 -> 353 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/icons/obj/profile_obj.gifbin0 -> 368 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/icons/obj/uninstalled_iu.gifbin0 -> 237 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/icons/provision.gifbin0 -> 368 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/plugin.properties25
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/plugin.xml110
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/ProvAdminUIActivator.java72
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/ArtifactRepositoriesView.java79
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/MetadataRepositoriesView.java175
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/ProfilesView.java310
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/ProvAdminUIMessages.java74
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/ProvView.java220
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/ProvisioningPerspective.java71
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/RepositoriesView.java167
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/dialogs/AddArtifactRepositoryDialog.java56
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/dialogs/AddMetadataRepositoryDialog.java56
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/dialogs/AddProfileDialog.java144
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/dialogs/UpdateAndInstallDialog.java77
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/messages.properties54
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/preferences/PreferenceConstants.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/preferences/ProvUIPreferenceInitializer.java36
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/prov/ui/admin/internal/preferences/ProvisioningPrefPage.java53
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/.cvsignore1
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/.settings/org.eclipse.jdt.core.prefs330
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/META-INF/MANIFEST.MF34
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/build.properties18
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/plugin.properties19
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/plugin.xml72
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/prov/ui/internal/sdk/ProvSDKMessages.java35
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/prov/ui/internal/sdk/ProvSDKUIActivator.java71
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/prov/ui/internal/sdk/RepositoryManipulationDialog.java66
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/prov/ui/internal/sdk/UpdateAndInstallDialog.java87
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/prov/ui/internal/sdk/UpdateHandler.java76
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/prov/ui/internal/sdk/messages.properties18
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/.cvsignore1
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/.settings/org.eclipse.jdt.core.prefs330
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF35
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/about.html28
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/build.properties17
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/icons/obj/artifact_repo_obj.gifbin0 -> 545 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/icons/obj/iu_obj.gifbin0 -> 585 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/icons/obj/metadata_repo_obj.gifbin0 -> 353 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/icons/obj/profile_obj.gifbin0 -> 368 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/icons/obj/uninstalled_iu.gifbin0 -> 237 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/icons/wizban/config_wiz.gifbin0 -> 3388 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/icons/wizban/def_wizban.jpgbin0 -> 33456 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/icons/wizban/install_wiz.gifbin0 -> 3550 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/icons/wizban/uninstall_wiz.gifbin0 -> 3719 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/icons/wizban/update_wiz.gifbin0 -> 3744 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/plugin.properties15
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/ColocatedRepositoryInfo.java63
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/ColocatedRepositoryUtil.java67
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/IProfileChooser.java37
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/IProvisioningProperties.java27
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/IRepositoryManipulator.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/ProvUI.java81
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/ProvUIActivator.java147
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/ProvUIImages.java65
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/ProvisioningUndoSupport.java119
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/ProvisioningUtil.java362
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/actions/BecomeAction.java37
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/actions/InstallAction.java88
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/actions/ProfileModificationAction.java132
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/actions/ProvisioningAction.java37
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/actions/UninstallAction.java32
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/actions/UpdateAction.java112
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/AddColocatedRepositoryDialog.java67
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/AddRepositoryDialog.java160
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/ColocatedRepositoryManipulatorGroup.java218
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/ColocatedRepositoryPropertyPage.java29
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/IUGroup.java46
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/IUImplementationGroup.java202
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/IUImplementationPropertyPage.java59
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/IUPropertiesGroup.java74
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/IUPropertyPage.java56
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/ProfileGroup.java265
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/ProfilePropertyPage.java60
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/RepositoryGroup.java156
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/RepositoryImplementationGroup.java74
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/RepositoryImplementationPropertyPage.java31
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/RepositoryPropertyPage.java79
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/dialogs/UpdateAndInstallGroup.java354
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/internal/ApplyProfileChangesDialog.java75
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/internal/ProvUIMessages.java128
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/internal/ProvisioningPropertyManager.java52
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/internal/messages.properties109
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/model/AllArtifactRepositories.java58
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/model/AllMetadataRepositories.java60
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/model/AllProfiles.java61
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/model/ArtifactRepositoryContentProvider.java64
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/model/AvailableIUContentProvider.java65
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/model/InstalledIUElement.java73
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/model/MetadataRepositoryContentProvider.java66
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/model/ProfileContentProvider.java78
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/model/ProfileFactory.java78
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/model/ProvElement.java105
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/AddArtifactRepositoryOperation.java72
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/AddColocatedRepositoryOperation.java81
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/AddMetadataRepositoryOperation.java71
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/AddProfileOperation.java59
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/BecomeOperation.java71
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/IOperationConfirmer.java32
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/InstallOperation.java82
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/ProfileModificationOperation.java66
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/ProfileOperation.java59
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/ProvisioningOperation.java194
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/RemoveArtifactRepositoryOperation.java76
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/RemoveColocatedRepositoryOperation.java87
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/RemoveMetadataRepositoryOperation.java75
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/RemoveProfilesOperation.java64
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/RepositoryOperation.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/UninstallOperation.java76
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/operations/UpdateOperation.java80
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/viewers/ColocatedRepositoryLabelProvider.java62
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/viewers/IUCapabilityFilter.java59
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/viewers/IUDetailsLabelProvider.java71
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/viewers/IUDragAdapter.java138
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/viewers/IUGroupFilter.java29
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/viewers/IUPropertyFilter.java49
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/viewers/InstallIUDropAdapter.java242
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/viewers/InternalRepositoryFilter.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/viewers/ProvElementLabelProvider.java126
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/prov/ui/viewers/StructuredViewerProvisioningListener.java94
540 files changed, 41983 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/.classpath b/bundles/org.eclipse.equinox.p2.artifact.repository/.classpath
new file mode 100644
index 000000000..7cdeb7319
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/.project b/bundles/org.eclipse.equinox.p2.artifact.repository/.project
new file mode 100644
index 000000000..c94254214
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.equinox.prov.artifact.repository</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.p2.artifact.repository/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..3f53e5adb
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,343 @@
+#Mon Sep 17 23:16:48 EDT 2007
+eclipse.preferences.version=1
+instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
+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.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.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=ignore
+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.unsafeTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+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=false
+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_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.p2.artifact.repository/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..e71c32e23
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+#Sun Sep 23 11:57:38 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.p2.artifact.repository/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..979e4e8b4
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+
+eclipse.preferences.version=1
+pluginProject.extensions=true
+resolve.requirebundle=false
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..ffbacbb41
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Artifact Repository Bundle (Incubation)
+Bundle-SymbolicName: org.eclipse.equinox.prov.artifact.repository;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Export-Package: org.eclipse.equinox.internal.prov.artifact.repository;x-friends:="org.eclipse.equinox.prov.metadata.generator,org.eclipse.equinox.prov.test,org.eclipse.equinox.prov.selfhosting",
+ org.eclipse.equinox.prov.artifact.repository,
+ org.eclipse.equinox.prov.artifact.repository.processing
+Import-Package: com.thoughtworks.xstream,
+ org.eclipse.core.runtime.preferences,
+ org.eclipse.equinox.internal.p2.jarprocessor;resolution:=optional,
+ org.eclipse.equinox.p2.jarprocessor;resolution:=optional,
+ org.eclipse.equinox.prov.core.helpers,
+ org.eclipse.equinox.prov.core.location,
+ org.eclipse.equinox.prov.core.repository,
+ org.eclipse.equinox.prov.metadata,
+ org.eclipse.osgi.internal.provisional.verifier,
+ org.osgi.framework;version="1.3.0",
+ org.osgi.service.prefs;version="1.1.0",
+ org.osgi.util.tracker;version="1.3.0"
+Bundle-Activator: org.eclipse.equinox.internal.prov.artifact.repository.Activator
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
+ J2SE-1.4
+Require-Bundle: org.eclipse.ecf.filetransfer,
+ org.eclipse.ecf,
+ org.eclipse.equinox.common,
+ org.eclipse.equinox.registry
+Eclipse-BuddyPolicy: registered
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/about.html b/bundles/org.eclipse.equinox.p2.artifact.repository/about.html
new file mode 100644
index 000000000..460233046
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/about.html
@@ -0,0 +1,28 @@
+<!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 (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). 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, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.p2.artifact.repository/build.properties b/bundles/org.eclipse.equinox.p2.artifact.repository/build.properties
new file mode 100644
index 000000000..8917af773
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/build.properties
@@ -0,0 +1,16 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ about.html
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/plugin.xml b/bundles/org.eclipse.equinox.p2.artifact.repository/plugin.xml
new file mode 100644
index 000000000..be934eedd
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/plugin.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="artifactRepositories" name="Artifact Repositories" schema="schema/artifactRepositories.exsd"/>
+ <extension-point id="processingSteps" name="Processing Steps" schema="schema/processingSteps.exsd"/>
+ <extension id="simpleRepository" point="org.eclipse.equinox.prov.artifact.repository.artifactRepositories">
+ <filter suffix="artifacts.xml"/>
+ <factory class="org.eclipse.equinox.internal.prov.artifact.repository.SimpleArtifactRepositoryFactory"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.equinox.prov.artifact.repository.processingSteps"
+ id="org.eclipse.equinox.p2.processing.Pack200Unpacker">
+ <step class="org.eclipse.equinox.internal.prov.artifact.repository.Unpack200Step"/>
+ </extension>
+ <extension
+ point="org.eclipse.equinox.prov.artifact.repository.processingSteps"
+ id="org.eclipse.equinox.p2.processing.SignatureVerifier">
+ <step class="org.eclipse.equinox.internal.prov.artifact.repository.SignatureVerifier"/>
+ </extension>
+</plugin>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/schema/artifactRepositories.exsd b/bundles/org.eclipse.equinox.p2.artifact.repository/schema/artifactRepositories.exsd
new file mode 100644
index 000000000..18db7af66
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/schema/artifactRepositories.exsd
@@ -0,0 +1,124 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.equinox.prov.artifact.repository">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.equinox.prov.artifact.repository" id="artifactRepositories" name="Artifact Repositories"/>
+ </appInfo>
+ <documentation>
+ This extension point is used to provide artifact repository implementations
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="factory"/>
+ <element ref="filter" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="factory">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ the fully-qualified name of a class which implements
+&lt;samp&gt;org.eclipse.equinox.prov.artifact.repository.IArtifactRepository&lt;/samp&gt;.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.equinox.prov.artifact.repository.IArtifactRepository"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="filter">
+ <complexType>
+ <attribute name="suffix" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ org.eclipse.equinox.prov.artifact.repository 0.1.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ The value of the class attribute must represent an
+implementor of &lt;tt&gt;org.eclipse.equinox.prov.artifact.repository.IArtifactRepository&lt;/tt&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2007 IBM Corporation and others.&lt;br&gt;
+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 &lt;a
+href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/schema/processingSteps.exsd b/bundles/org.eclipse.equinox.p2.artifact.repository/schema/processingSteps.exsd
new file mode 100644
index 000000000..2d3eaa7ab
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/schema/processingSteps.exsd
@@ -0,0 +1,110 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.equinox.prov.artifact.repository">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.equinox.prov.artifact.repository" id="processingSteps" name="Processing Steps"/>
+ </appInfo>
+ <documentation>
+ This extension point is used to provide processing step implementations
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="step"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="step">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.equinox.prov.artifact.repository.processing.IProcessingStep"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ org.eclipse.equinox.prov.artifact.repository ?.?.?
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ The value of the class attribute must represent an
+implementor of &lt;tt&gt;org.eclipse.equinox.prov.artifact.processing.IProcessingStep&lt;/tt&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2007 compeople AG and others.&lt;br&gt;
+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 &lt;a
+href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/Activator.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/Activator.java
new file mode 100644
index 000000000..e21be5826
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/Activator.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.artifact.repository;
+
+import org.eclipse.equinox.prov.artifact.repository.IArtifactRepositoryManager;
+import org.osgi.framework.*;
+
+public class Activator implements BundleActivator {
+ private static BundleContext context;
+ public static final String ID = "org.eclipse.equinox.prov.artifact.repository";
+ public static final String REPO_PROVIDER_XPT = ID + '.' + "artifactRepositories";
+ public IArtifactRepositoryManager repoManager;
+ public ServiceRegistration repoManagerRegistration;
+
+ public void start(BundleContext context) throws Exception {
+ Activator.context = context;
+ // repoManager = new ArtifactRepoManager();
+ // repoManagerRegistration = context.registerService(IArtifactRepoManager.class.getName(), repoManager, null);
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ Activator.context = null;
+ // repoManager = null;
+ // repoManagerRegistration = null;
+ }
+
+ public static BundleContext getContext() {
+ return Activator.context;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ArtifactRepositoryIO.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ArtifactRepositoryIO.java
new file mode 100644
index 000000000..3457ae896
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ArtifactRepositoryIO.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.artifact.repository;
+
+import com.thoughtworks.xstream.XStream;
+import java.io.*;
+import org.eclipse.equinox.prov.artifact.repository.IArtifactRepository;
+import org.eclipse.equinox.prov.core.repository.RepositoryCreationException;
+
+/**
+ * This class reads and writes artifact repository
+ * (eg. table of contents files);
+ *
+ * This class is not used for reading or writing the actual artifacts.
+ *
+ * The implementation currently uses XStream.
+ */
+class ArtifactRepositoryIO {
+
+ /**
+ * Reads the artifact repository from the given stream,
+ * and returns the contained array of abstract artifact repositories.
+ *
+ * This method performs buffering, and closes the stream when finished.
+ */
+ public static IArtifactRepository read(InputStream input) throws RepositoryCreationException {
+ XStream stream = new XStream();
+ BufferedInputStream bufferedInput = null;
+ try {
+ try {
+ bufferedInput = new BufferedInputStream(input);
+ return (IArtifactRepository) stream.fromXML(bufferedInput);
+ } finally {
+ if (bufferedInput != null)
+ bufferedInput.close();
+ }
+ } catch (IOException e) {
+ throw new RepositoryCreationException(e);
+ }
+ }
+
+ /**
+ * Writes the given artifact repository to the stream.
+ * This method performs buffering, and closes the stream when finished.
+ */
+ public static void write(IArtifactRepository repository, OutputStream output) {
+ XStream stream = new XStream();
+ OutputStream bufferedOutput = null;
+ try {
+ try {
+ bufferedOutput = new BufferedOutputStream(output);
+ stream.toXML(repository, bufferedOutput);
+ } finally {
+ if (bufferedOutput != null) {
+ bufferedOutput.close();
+ }
+ }
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ArtifactRepositoryManager.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ArtifactRepositoryManager.java
new file mode 100644
index 000000000..cd7c8854f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ArtifactRepositoryManager.java
@@ -0,0 +1,296 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.prov.artifact.repository;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.preferences.ConfigurationScope;
+import org.eclipse.equinox.prov.artifact.repository.*;
+import org.eclipse.equinox.prov.core.helpers.*;
+import org.eclipse.equinox.prov.core.location.AgentLocation;
+import org.eclipse.equinox.prov.metadata.IArtifactKey;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
+
+// TODO Need to react to repository going away
+// TODO the current assumption that the "location" is the dir/root limits us to
+// having just one repo in a given URL..
+public class ArtifactRepositoryManager implements IArtifactRepositoryManager {
+ private static final String ATTR_FILTER = "filter"; //$NON-NLS-1$
+ private static final String ATTR_SUFFIX = "suffix"; //$NON-NLS-1$
+ private static final String EL_FACTORY = "factory"; //$NON-NLS-1$
+
+ private static final String KEY_DESCRIPTION = "description"; //$NON-NLS-1$
+ private static final String KEY_NAME = "name"; //$NON-NLS-1$
+ private static final String KEY_PROVIDER = "provider"; //$NON-NLS-1$
+ private static final String KEY_TYPE = "type"; //$NON-NLS-1$
+ private static final String KEY_URL = "url"; //$NON-NLS-1$
+ private static final String KEY_VERSION = "version"; //$NON-NLS-1$
+ private static final String NODE_REPOSITORIES = "repositories"; //$NON-NLS-1$
+
+ private List repositories = Collections.synchronizedList(new ArrayList());
+
+ public ArtifactRepositoryManager() {
+ restoreRepositories();
+ }
+
+ public void addRepository(IArtifactRepository repository) {
+ repositories.add(repository);
+ // save the given repository in the preferences.
+ remember(repository);
+ }
+
+ public IArtifactRequest createDownloadRequest(IArtifactKey key, IPath destination) {
+ return new FileDownloadRequest(key, destination);
+ }
+
+ private Object createExecutableExtension(IExtension extension, String element) throws CoreException {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for (int i = 0; i < elements.length; i++) {
+ if (elements[i].getName().equals(element))
+ return elements[i].createExecutableExtension("class"); //$NON-NLS-1$
+ }
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, "Malformed extension"));
+ }
+
+ public IArtifactRequest createMirrorRequest(IArtifactKey key, IWritableArtifactRepository destination) {
+ return new MirrorRequest(key, destination);
+ }
+
+ public IArtifactRepository createRepository(URL location, String name, String type) {
+ IArtifactRepository result = loadRepository(location, (IProgressMonitor) null);
+ if (result != null)
+ return result;
+ IExtension extension = RegistryFactory.getRegistry().getExtension(Activator.REPO_PROVIDER_XPT, type);
+ if (extension == null)
+ return null;
+ try {
+ IArtifactRepositoryFactory factory = (IArtifactRepositoryFactory) createExecutableExtension(extension, EL_FACTORY);
+ if (factory == null)
+ return null;
+ result = factory.create(location, name, type);
+ if (result != null)
+ addRepository(result);
+ return result;
+ } catch (CoreException e) {
+ log("Failed to load artifact repository extension: " + location, e); //$NON-NLS-1$
+ return null;
+ }
+ }
+
+ private IExtension[] findMatchingRepositoryExtensions(String suffix) {
+ IConfigurationElement[] elt = RegistryFactory.getRegistry().getConfigurationElementsFor(Activator.REPO_PROVIDER_XPT);
+ int count = 0;
+ for (int i = 0; i < elt.length; i++) {
+ if (ATTR_FILTER.equals(elt[i].getName())) {
+ if (!suffix.equals(elt[i].getAttribute(ATTR_SUFFIX))) {
+ elt[i] = null;
+ } else {
+ count++;
+ }
+ } else {
+ elt[i] = null;
+ }
+ }
+ IExtension[] results = new IExtension[count];
+ for (int i = 0; i < elt.length; i++) {
+ if (elt[i] != null)
+ results[--count] = elt[i].getDeclaringExtension();
+ }
+ return results;
+ }
+
+ private void forget(IArtifactRepository toRemove) throws BackingStoreException {
+ getPreferences().node(getKey(toRemove)).removeNode();
+ }
+
+ private String[] getAllSuffixes() {
+ IConfigurationElement[] elements = RegistryFactory.getRegistry().getConfigurationElementsFor(Activator.REPO_PROVIDER_XPT);
+ ArrayList result = new ArrayList(elements.length);
+ for (int i = 0; i < elements.length; i++)
+ if (elements[i].getName().equals(ATTR_FILTER))
+ result.add(elements[i].getAttribute(ATTR_SUFFIX));
+ return (String[]) result.toArray(new String[result.size()]);
+ }
+
+ /*
+ * Return an encoded repository key that is suitable for using
+ * as the name of a preference node.
+ */
+ private String getKey(IArtifactRepository repository) {
+ return repository.getLocation().toExternalForm().replace('/', '_');
+ }
+
+ public IArtifactRepository[] getKnownRepositories() {
+ if (repositories == null)
+ restoreRepositories();
+ return (IArtifactRepository[]) repositories.toArray(new IArtifactRepository[repositories.size()]);
+ }
+
+ /*
+ * Return the root preference node where we store the repository information.
+ */
+ private Preferences getPreferences() {
+ return new ConfigurationScope().getNode(Activator.ID).node(NODE_REPOSITORIES);
+ }
+
+ public IArtifactRepository getRepository(URL location) {
+ if (repositories == null)
+ restoreRepositories();
+ for (Iterator iterator = repositories.iterator(); iterator.hasNext();) {
+ IArtifactRepository match = (IArtifactRepository) iterator.next();
+ if (Utils.sameURL(match.getLocation(), location))
+ return match;
+ }
+ return null;
+ }
+
+ public IArtifactRepository loadRepository(URL location, IProgressMonitor monitor) {
+ // TODO do some thing with the monitor
+ IArtifactRepository result = getRepository(location);
+ if (result != null)
+ return result;
+ String[] suffixes = getAllSuffixes();
+ for (int i = 0; i < suffixes.length; i++) {
+ result = loadRepository(location, suffixes[i]);
+ if (result != null) {
+ addRepository(result);
+ return result;
+ }
+ }
+ return null;
+ }
+
+ private IArtifactRepository loadRepository(URL location, String suffix) {
+ IExtension[] providers = findMatchingRepositoryExtensions(suffix);
+ // Loop over the candidates and return the first one that successfully loads
+ for (int i = 0; i < providers.length; i++)
+ try {
+ IArtifactRepositoryFactory factory = (IArtifactRepositoryFactory) createExecutableExtension(providers[i], EL_FACTORY);
+ if (factory != null)
+ return factory.load(location);
+ } catch (CoreException e) {
+ log("Unable to load repository: " + location, e); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+ protected void log(String message, Throwable t) {
+ LogHelper.log(new Status(IStatus.ERROR, Activator.ID, message, t));
+ }
+
+ /*
+ * Add the given repository object to the preferences and save.
+ */
+ private void remember(IArtifactRepository repository) {
+ Preferences node = getPreferences().node(getKey(repository));
+ String value = repository.getDescription();
+ if (value != null)
+ node.put(KEY_DESCRIPTION, value);
+ value = repository.getName();
+ if (value != null)
+ node.put(KEY_NAME, value);
+ value = repository.getProvider();
+ if (value != null)
+ node.put(KEY_PROVIDER, value);
+ value = repository.getType();
+ if (value != null)
+ node.put(KEY_TYPE, value);
+ value = repository.getVersion();
+ if (value != null)
+ node.put(KEY_VERSION, value);
+ value = repository.getLocation().toExternalForm();
+ node.put(KEY_URL, value);
+ saveRepositoryList();
+ }
+
+ public void removeRepository(IArtifactRepository toRemove) {
+ if (toRemove != null)
+ repositories.remove(toRemove);
+ // remove the repository from the preferences
+ try {
+ forget(toRemove);
+ saveRepositoryList();
+ } catch (BackingStoreException e) {
+ log("Error saving preferences", e); //$NON-NLS-1$
+ }
+ }
+
+ /*
+ * Load the list of repositories from the preferences.
+ */
+ private void restoreFromPreferences() {
+ // restore the list of repositories from the preference store
+ Preferences node = getPreferences();
+ String[] children;
+ try {
+ children = node.childrenNames();
+ } catch (BackingStoreException e) {
+ log("Error restoring repositories from preferences", e); //$NON-NLS-1$
+ return;
+ }
+ for (int i = 0; i < children.length; i++) {
+ Preferences child = node.node(children[i]);
+ String url = child.get(KEY_URL, null);
+ if (url == null)
+ continue;
+ try {
+ IArtifactRepository repository = loadRepository(new URL(url), (IProgressMonitor) null);
+ // If we could not restore the repo then remove it from the preferences.
+ if (repository == null)
+ child.removeNode();
+ } catch (MalformedURLException e) {
+ log("Error while restoring repository: " + url, e); //$NON-NLS-1$
+ } catch (BackingStoreException e) {
+ log("Error restoring repositories from preferences", e); //$NON-NLS-1$
+ }
+ }
+ // now that we have loaded everything, remember them
+ saveRepositoryList();
+ }
+
+ private void restoreRepositories() {
+ repositories = new ArrayList();
+ // TODO while recreating, we may want to have proxies on repo instead of the real repo object to limit what is activated.
+ AgentLocation location = (AgentLocation) ServiceHelper.getService(Activator.getContext(), AgentLocation.class.getName());
+ if (location == null)
+ // TODO should do something here since we are failing to restore.
+ return;
+ SimpleArtifactRepository cache = (SimpleArtifactRepository) createRepository(location.getArtifactRepositoryURL(), "download cache", "org.eclipse.equinox.prov.artifact.repository.simpleRepository"); //$NON-NLS-1$ //$NON-NLS-2$
+ cache.tagAsImplementation();
+
+ String locationString = Activator.getContext().getProperty("eclipse.prov.artifactRepository"); //$NON-NLS-1$
+ if (locationString != null) {
+ StringTokenizer tokenizer = new StringTokenizer(locationString, ","); //$NON-NLS-1$
+ while (tokenizer.hasMoreTokens()) {
+ try {
+ loadRepository(new URL(tokenizer.nextToken()), (IProgressMonitor) null);
+ } catch (MalformedURLException e) {
+ log("Error while restoring repository " + locationString, e); //$NON-NLS-1$
+ }
+ }
+ }
+ // restore the persisted list of repositories
+ restoreFromPreferences();
+ }
+
+ /*
+ * Save the list of repositories to the file-system.
+ */
+ private void saveRepositoryList() {
+ try {
+ getPreferences().flush();
+ } catch (BackingStoreException e) {
+ log("Error while saving repositories in preferences", e); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ArtifactRequest.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ArtifactRequest.java
new file mode 100644
index 000000000..e13519131
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ArtifactRequest.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.artifact.repository;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.prov.artifact.repository.*;
+import org.eclipse.equinox.prov.metadata.IArtifactKey;
+
+/**
+ * Base class for all requests on an {@link IArtifactRepository}.
+ */
+public abstract class ArtifactRequest implements IArtifactRequest {
+ protected IArtifactKey artifact;
+ protected String resolvedKey;
+ protected IArtifactRepository source;
+ protected IStatus result;
+ protected IArtifactDescriptor descriptor;
+
+ public ArtifactRequest(IArtifactKey key) {
+ artifact = key;
+ // TODO do we need to make this configurable? for now set default request handler to ECF
+ }
+
+ public IArtifactKey getArtifactKey() {
+ return artifact;
+ }
+
+ public IArtifactDescriptor getArtifactDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Returns the result of the previous call to {@link #perform(IProgressMonitor)},
+ * or <code>null</code> if perform has never been called.
+ *
+ * @return The result of the previous perform call.
+ */
+ public IStatus getResult() {
+ return result;
+ }
+
+ protected IArtifactRepository getSourceRepository() {
+ return source;
+ }
+
+ /**
+ * Performs the artifact request, and sets the result status.
+ *
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting is not desired
+ */
+ abstract public void perform(IProgressMonitor monitor);
+
+ /**
+ * Sets the descriptor to use when processing this request.
+ *
+ * @param value The descriptor to use when processing this request
+ */
+ public void setDescriptor(IArtifactDescriptor value) {
+ if (!value.getArtifactKey().equals(artifact))
+ throw new IllegalArgumentException("Descriptor's key must match the request's key"); //$NON-NLS-1$
+ descriptor = value;
+ if (artifact == null)
+ artifact = value.getArtifactKey();
+ }
+
+ /**
+ * Sets the result of an invocation of {@link #perform(IProgressMonitor)}.
+ * This method is called by subclasses to set the result status for
+ * this request.
+ *
+ * @param value The result status
+ */
+ protected void setResult(IStatus value) {
+ result = value;
+ }
+
+ public void setSourceRepository(IArtifactRepository value) {
+ source = value;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ECFTransport.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ECFTransport.java
new file mode 100644
index 000000000..f5c9f7674
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/ECFTransport.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation Stefan Liebig -
+ * random tweaks
+ ******************************************************************************/
+package org.eclipse.equinox.internal.prov.artifact.repository;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import org.eclipse.core.runtime.*;
+import org.eclipse.ecf.filetransfer.*;
+import org.eclipse.ecf.filetransfer.events.*;
+import org.eclipse.ecf.filetransfer.identity.FileCreateException;
+import org.eclipse.ecf.filetransfer.identity.FileIDFactory;
+import org.eclipse.ecf.filetransfer.service.IRetrieveFileTransferFactory;
+import org.eclipse.equinox.prov.artifact.repository.Transport;
+import org.eclipse.equinox.prov.artifact.repository.processing.ProcessingStep;
+import org.eclipse.equinox.prov.core.helpers.LogHelper;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * A request handler that implements file transfer using ECF API.
+ */
+public class ECFTransport extends Transport {
+
+ /**
+ * The singleton handler instance.
+ */
+ private static ECFTransport instance;
+
+ private final ServiceTracker retrievalFactoryTracker;
+
+ /**
+ * Returns an initialized instance of ECFHandler
+ */
+ public static synchronized ECFTransport getInstance() {
+ if (instance == null) {
+ instance = new ECFTransport();
+ }
+ return instance;
+ }
+
+ /**
+ * Private to avoid client instantiation.
+ */
+ private ECFTransport() {
+ retrievalFactoryTracker = new ServiceTracker(Activator.getContext(), IRetrieveFileTransferFactory.class.getName(), null);
+ retrievalFactoryTracker.open();
+ }
+
+ protected IStatus convertToStatus(Exception failure) {
+ if (failure == null)
+ return Status.OK_STATUS;
+ if (failure instanceof UserCancelledException)
+ return new Status(IStatus.CANCEL, Activator.ID, failure.getMessage(), failure);
+ return new Status(IStatus.ERROR, Activator.ID, "error during transfer", failure);
+ }
+
+ public IStatus download(String toDownload, OutputStream target, IProgressMonitor monitor) {
+ IRetrieveFileTransferFactory factory = (IRetrieveFileTransferFactory) retrievalFactoryTracker.getService();
+ if (factory == null)
+ return new Status(IStatus.ERROR, Activator.ID, "ECF Transfer manager not available");
+ return transfer(factory.newInstance(), toDownload, target, monitor);
+ }
+
+ private IStatus transfer(final IRetrieveFileTransferContainerAdapter retrievalContainer, final String toDownload, final OutputStream target, final IProgressMonitor monitor) {
+ final IStatus[] result = new IStatus[1];
+ IFileTransferListener listener = new IFileTransferListener() {
+ public void handleTransferEvent(IFileTransferEvent event) {
+ if (event instanceof IIncomingFileTransferReceiveStartEvent) {
+ IIncomingFileTransferReceiveStartEvent rse = (IIncomingFileTransferReceiveStartEvent) event;
+ try {
+ if (target != null) {
+ rse.receive(target);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ if (event instanceof IIncomingFileTransferReceiveDataEvent) {
+ IIncomingFileTransfer source = ((IIncomingFileTransferReceiveDataEvent) event).getSource();
+ monitor.subTask("Transferring " + source.getID().getName() + " (" + (int) (source.getPercentComplete() * 100) + "% complete)");
+ if (monitor.isCanceled())
+ source.cancel();
+ }
+ if (event instanceof IIncomingFileTransferReceiveDoneEvent) {
+ IStatus status = convertToStatus(((IIncomingFileTransferReceiveDoneEvent) event).getException());
+ synchronized (result) {
+ result[0] = status;;
+ result.notify();
+ }
+ }
+ }
+ };
+
+ try {
+ retrievalContainer.sendRetrieveRequest(FileIDFactory.getDefault().createFileID(retrievalContainer.getRetrieveNamespace(), toDownload), listener, null);
+ } catch (IncomingFileTransferException e) {
+ return new Status(IStatus.ERROR, Activator.ID, "error during transfer", e);
+ } catch (FileCreateException e) {
+ return new Status(IStatus.ERROR, Activator.ID, "error during transfer - could not create file", e);
+ }
+ synchronized (result) {
+ while (result[0] == null) {
+ boolean logged = false;
+ try {
+ result.wait();
+ } catch (InterruptedException e) {
+ if (!logged)
+ LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "Unexpected interrupt while waiting on ECF transfer", e)); //$NON-NLS-1$
+ }
+ }
+ }
+
+ if (!(target instanceof ProcessingStep))
+ return result[0];
+ IStatus stepStatus = ((ProcessingStep) target).getStatus(true);
+ IStatus[] combinedList = new IStatus[stepStatus.getChildren().length + 1];
+ combinedList[0] = result[0];
+ System.arraycopy(stepStatus.getChildren(), 0, combinedList, 1, stepStatus.getChildren().length);
+ int code = result[0].getCode() > stepStatus.getCode() ? result[0].getCode() : stepStatus.getCode();
+ return new MultiStatus(Activator.ID, code, combinedList, "Problems occurred while downloading " + toDownload, null);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/FileDownloadRequest.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/FileDownloadRequest.java
new file mode 100644
index 000000000..104d95879
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/FileDownloadRequest.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.artifact.repository;
+
+import java.io.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.prov.metadata.IArtifactKey;
+
+public class FileDownloadRequest extends ArtifactRequest {
+ public static FileDownloadRequest[] NO_REQUEST = new FileDownloadRequest[0];
+
+ private File destination; //The fully qualified path where the file should be written
+
+ public FileDownloadRequest(IArtifactKey downloadKey, IPath downloadPath) {
+ super(downloadKey);
+ destination = destination;
+ }
+
+ public void perform(IProgressMonitor monitor) {
+ try {
+ OutputStream destinationStream = null;
+ try {
+ destinationStream = new BufferedOutputStream(new FileOutputStream(destination));
+ setResult(source.getArtifact(descriptor, destinationStream, null));
+ } finally {
+ if (destinationStream != null)
+ destinationStream.close();
+ }
+ } catch (IOException e) {
+ setResult(new Status(IStatus.ERROR, Activator.ID, "Error downloading " + descriptor + " to " + destination, e));
+ };
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/MirrorRequest.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/MirrorRequest.java
new file mode 100644
index 000000000..af383462b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/MirrorRequest.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.artifact.repository;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.prov.artifact.repository.IArtifactDescriptor;
+import org.eclipse.equinox.prov.artifact.repository.IWritableArtifactRepository;
+import org.eclipse.equinox.prov.metadata.IArtifactKey;
+
+public class MirrorRequest extends ArtifactRequest {
+ private IWritableArtifactRepository target;
+
+ public MirrorRequest(IArtifactKey key, IWritableArtifactRepository targetRepository) {
+ super(key);
+ target = targetRepository;
+ }
+
+ public void perform(IProgressMonitor monitor) {
+ monitor.subTask("Downloading " + getArtifactKey().getId());
+ // Do we already have the artifact in the target?
+ if (target.contains(getArtifactKey())) {
+ setResult(new Status(IStatus.OK, Activator.ID, "The artifact is already available in the repo."));
+ return;
+ }
+
+ // if the request does not have a descriptor then try to fill one in by getting
+ // the list of all and randomly picking the first one.
+ if (descriptor == null) {
+ IArtifactDescriptor[] descriptors = source.getArtifactDescriptors(getArtifactKey());
+ if (descriptors.length > 0)
+ descriptor = descriptors[0];
+ }
+
+ // if the descriptor is not set now then the repo does not have the requested artifact
+ if (descriptor == null) {
+ setResult(new Status(IStatus.ERROR, Activator.ID, "Artifact requested can't be found:" + getArtifactKey()));
+ return;
+ }
+
+ // Get the output stream to store the artifact
+ OutputStream destination = target.getOutputStream(getArtifactDescriptor());
+ if (destination == null) {
+ setResult(new Status(IStatus.ERROR, Activator.ID, "Can't get an output stream to " + target + " to store " + getArtifactKey()));
+ return;
+ }
+
+ // Do the actual transfer
+ try {
+ setResult(source.getArtifact(descriptor, destination, monitor));
+ return;
+ } finally {
+ try {
+ destination.close();
+ } catch (IOException e) {
+ setResult(new Status(IStatus.ERROR, Activator.ID, "Error closing the output stream for " + getArtifactKey() + "on repo " + target.getLocation(), e));
+ }
+ }
+ }
+
+ public String toString() {
+ return "Mirrroring: " + getArtifactKey() + " into " + target;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/SignatureVerifier.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/SignatureVerifier.java
new file mode 100644
index 000000000..113f388fa
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/SignatureVerifier.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+* Copyright (c) 2007 compeople AG 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:
+* compeople AG (Stefan Liebig) - initial API and implementation
+* IBM - continuing development
+*******************************************************************************/
+package org.eclipse.equinox.internal.prov.artifact.repository;
+
+import java.io.*;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.equinox.prov.artifact.repository.processing.ProcessingStep;
+import org.eclipse.equinox.prov.core.helpers.FileUtils;
+import org.eclipse.equinox.prov.core.helpers.ServiceHelper;
+import org.eclipse.osgi.internal.provisional.verifier.CertificateVerifier;
+import org.eclipse.osgi.internal.provisional.verifier.CertificateVerifierFactory;
+
+/**
+ * The Pack200Unpacker expects an input containing ".jar.pack.gz" data.
+ */
+public class SignatureVerifier extends ProcessingStep {
+ private File inputFile;
+ private OutputStream tempStream;
+
+ public boolean areRequirementsSatisfied() {
+ return true;
+ }
+
+ public void write(int b) throws IOException {
+ getOutputStream().write(b);
+ }
+
+ private OutputStream getOutputStream() throws IOException {
+ if (tempStream != null)
+ return tempStream;
+ // store input stream in temporary file
+ inputFile = File.createTempFile("signatureFile", ".jar");
+ tempStream = new BufferedOutputStream(new FileOutputStream(inputFile));
+ return tempStream;
+ }
+
+ private void verify() throws IOException {
+ BufferedInputStream resultStream = null;
+ try {
+ if (tempStream == null)
+ // hmmm, no one wrote to this stream so there is nothing to pass on
+ return;
+ // Ok, so there is content, close the tempStream
+ tempStream.close();
+
+ CertificateVerifierFactory verifierFactory = (CertificateVerifierFactory) ServiceHelper.getService(Activator.getContext(), CertificateVerifierFactory.class.getName());
+ CertificateVerifier verifier = verifierFactory.getVerifier(inputFile);
+ if (verifier.verifyContent().length > 0)
+ status = new Status(IStatus.ERROR, "plugin id", "signature verification failure");
+ else
+ status = Status.OK_STATUS;
+ // now write the content to the final destination
+ resultStream = new BufferedInputStream(new FileInputStream(inputFile));
+ FileUtils.copyStream(resultStream, true, destination, false);
+ resultStream = null;
+ } finally {
+ if (inputFile != null)
+ inputFile.delete();
+ if (resultStream != null)
+ resultStream.close();
+ }
+ }
+
+ public void close() throws IOException {
+ // When we go to close we must have seen all the content we are going to see
+ // So before closing, verify and write the result to the destination
+ verify();
+ super.close();
+ }
+
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/SimpleArtifactRepository.java
new file mode 100644
index 000000000..556d8d969
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/SimpleArtifactRepository.java
@@ -0,0 +1,333 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.prov.artifact.repository;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.prov.artifact.repository.*;
+import org.eclipse.equinox.prov.artifact.repository.processing.ProcessingStep;
+import org.eclipse.equinox.prov.artifact.repository.processing.ProcessingStepHandler;
+import org.eclipse.equinox.prov.core.helpers.MultiStatus;
+import org.eclipse.equinox.prov.core.repository.AbstractRepository;
+import org.eclipse.equinox.prov.core.repository.IRepositoryInfo;
+import org.eclipse.equinox.prov.metadata.IArtifactKey;
+
+public class SimpleArtifactRepository extends AbstractRepository implements IWritableArtifactRepository {
+
+ static final private String CONTENT_FILENAME = "artifacts.xml"; //$NON-NLS-1$
+ static final private String REPOSITORY_TYPE = SimpleArtifactRepository.class.getName();
+ static final private Integer REPOSITORY_VERSION = new Integer(1);
+ static final public String[][] DEFAULT_MAPPING_RULES = { {"(& (namespace=eclipse) (classifier=plugin))", "${repoUrl}/plugins/${id}_${version}.jar"}, //$NON-NLS-1$//$NON-NLS-2$
+ {"(& (namespace=eclipse) (classifier=native))", "${repoUrl}/native/${id}_${version}"}, //$NON-NLS-1$ //$NON-NLS-2$
+ {"(& (namespace=eclipse) (classifier=feature))", "${repoUrl}/features/${id}_${version}.jar"}}; //$NON-NLS-1$//$NON-NLS-2$
+
+ transient private Mapper mapper = new Mapper();
+ protected String[][] mappingRules = DEFAULT_MAPPING_RULES;
+ protected Set artifactDescriptors = new HashSet();
+ private boolean signatureVerification = false;
+
+ public static URL getActualLocation(URL base) {
+ String spec = base.toExternalForm();
+ if (spec.endsWith(CONTENT_FILENAME))
+ return base;
+ if (spec.endsWith("/")) //$NON-NLS-1$
+ spec += CONTENT_FILENAME;
+ else
+ spec += "/" + CONTENT_FILENAME; //$NON-NLS-1$
+ try {
+ return new URL(spec);
+ } catch (MalformedURLException e) {
+ return null;
+ }
+ }
+
+ public SimpleArtifactRepository(String repositoryName, URL location) {
+ super(repositoryName, REPOSITORY_TYPE, REPOSITORY_VERSION.toString(), location);
+ mapper.initialize(Activator.getContext(), mappingRules);
+ }
+
+ private IStatus getArtifact(ArtifactRequest request, IProgressMonitor monitor) {
+ request.setSourceRepository(this);
+ request.perform(monitor);
+ return request.getResult();
+ }
+
+ public IStatus getArtifacts(IArtifactRequest[] requests, IProgressMonitor monitor) {
+ SubMonitor subMonitor = SubMonitor.convert(monitor, requests.length);
+ try {
+ MultiStatus overallStatus = new MultiStatus();
+ for (int i = 0; i < requests.length; i++) {
+ if (monitor.isCanceled())
+ return Status.CANCEL_STATUS;
+ overallStatus.add(getArtifact((ArtifactRequest) requests[i], subMonitor.newChild(1)));
+ }
+ return (monitor.isCanceled() ? Status.CANCEL_STATUS : overallStatus);
+ } finally {
+ subMonitor.done();
+ }
+ }
+
+ private String basicGetArtifactLocation(IArtifactDescriptor descriptor) {
+ return computeLocation(descriptor.getArtifactKey());
+ }
+
+ private String basicGetArtifactLocation(IArtifactKey key) {
+ boolean found = false;
+ for (Iterator iterator = artifactDescriptors.iterator(); iterator.hasNext();) {
+ IArtifactDescriptor desc = (IArtifactDescriptor) iterator.next();
+ if (desc.getArtifactKey().equals(key)) { //TODO This should probably be a lookup in the set
+ found = true;
+ break;
+ }
+ }
+ return (found ? computeLocation(key) : null);
+ }
+
+ String computeLocation(IArtifactKey key) {
+ return mapper.map(location.toExternalForm(), key.getNamespace(), key.getClassifier(), key.getId(), key.getVersion().toString());
+ }
+
+ public IArtifactKey[] getArtifactKeys() {
+ // there may be more descriptors than keys to collect up the unique keys
+ HashSet result = new HashSet(artifactDescriptors.size());
+ for (Iterator it = artifactDescriptors.iterator(); it.hasNext();)
+ result.add(((IArtifactDescriptor) it.next()).getArtifactKey());
+ return (IArtifactKey[]) result.toArray(new IArtifactKey[result.size()]);
+ }
+
+ public URI getArtifact(IArtifactKey key) {
+ String result = basicGetArtifactLocation(key);
+ return (result != null ? URI.create(result) : null);
+ // if (location == null)
+ // return null;
+ // try {
+ // URL url = new URL(location);
+ // return new URI(url.getProtocol(), url.getHost(), url.getPath(), url.getQuery());
+ // } catch (MalformedURLException e) {
+ // throw new IllegalArgumentException(e);
+ // } catch (URISyntaxException e) {
+ // throw new IllegalArgumentException(e);
+ // }
+ }
+
+ public String toString() {
+ return location.toExternalForm();
+ }
+
+ public IStatus getArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) {
+ ProcessingStepHandler handler = new ProcessingStepHandler();
+ try {
+ destination = addPostSteps(handler, descriptor, destination, monitor);
+ destination = handler.createAndLink(descriptor.getProcessingSteps(), descriptor, destination, monitor);
+ destination = addPreSteps(handler, descriptor, destination, monitor);
+ IStatus status = handler.validateSteps(destination);
+ if (status.getCode() == IStatus.OK || status.getCode() == IStatus.INFO)
+ return getTransport().download(basicGetArtifactLocation(descriptor), destination, monitor);
+ return status;
+ } finally {
+ try {
+ //don't close the underlying output stream - the caller will do that
+ if (destination instanceof ProcessingStep)
+ destination.close();
+ } catch (IOException e) {
+ return new Status(IStatus.ERROR, Activator.ID, "Error closing processing steps", e);
+ }
+ }
+ }
+
+ private OutputStream addPostSteps(ProcessingStepHandler handler, IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) {
+ ArrayList steps = new ArrayList();
+ if (signatureVerification)
+ steps.add(new SignatureVerifier());
+ // if (md5Verification)
+ // steps.add(new MD5Verifier(descriptor.getProperty(IArtifactDescriptor.ARTIFACT_MD5)));
+ if (steps.isEmpty())
+ return destination;
+ ProcessingStep[] stepArray = (ProcessingStep[]) steps.toArray(new ProcessingStep[steps.size()]);
+ // TODO should probably be using createAndLink here
+ return handler.link(stepArray, destination, monitor);
+ }
+
+ private OutputStream addPreSteps(ProcessingStepHandler handler, IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) {
+ ArrayList steps = new ArrayList();
+ // Add steps here if needed
+ if (steps.isEmpty())
+ return destination;
+ ProcessingStep[] stepArray = (ProcessingStep[]) steps.toArray(new ProcessingStep[steps.size()]);
+ // TODO should probably be using createAndLink here
+ return handler.link(stepArray, destination, monitor);
+ }
+
+ private Transport getTransport() {
+ return ECFTransport.getInstance();
+ }
+
+ public IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) {
+ ArrayList result = new ArrayList();
+ for (Iterator iterator = artifactDescriptors.iterator(); iterator.hasNext();) {
+ IArtifactDescriptor descriptor = (IArtifactDescriptor) iterator.next();
+ if (descriptor.getArtifactKey().equals(key))
+ result.add(descriptor);
+ }
+ return (IArtifactDescriptor[]) result.toArray(new IArtifactDescriptor[result.size()]);
+ }
+
+ private class ArtifactOutputStream extends OutputStream {
+ private OutputStream destination;
+ private IArtifactDescriptor descriptor;
+ private long count = 0;
+
+ public ArtifactOutputStream(OutputStream os, IArtifactDescriptor descriptor) {
+ this.destination = os;
+ this.descriptor = descriptor;
+ }
+
+ public void write(int b) throws IOException {
+ destination.write(b);
+ count++;
+ }
+
+ public void write(byte[] b) throws IOException {
+ destination.write(b);
+ count += b.length;
+ }
+
+ public void write(byte[] b, int off, int len) throws IOException {
+ destination.write(b, off, len);
+ count += len;
+ }
+
+ public void close() throws IOException {
+ // Write the artifact descriptor
+ destination.close();
+ ((ArtifactDescriptor) descriptor).setProperty(IArtifactDescriptor.DOWNLOAD_SIZE, Long.toString(count));
+ addDescriptor(descriptor);
+ }
+ }
+
+ public void addDescriptor(IArtifactDescriptor toAdd) {
+ // TODO: here we may want to ensure that the artifact has not been added concurrently
+ artifactDescriptors.add(toAdd);
+ save();
+ }
+
+ public void save() {
+ try {
+ FileOutputStream os = new FileOutputStream(getActualLocation(location).getFile());
+ ArtifactRepositoryIO.write(this, os);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public OutputStream getOutputStream(IArtifactDescriptor descriptor) {
+ // TODO we need a better way of distinguishing between errors and cases where
+ // the stuff just already exists
+ // Check if the artifact is already in this repository
+ if (contains(descriptor))
+ return null;
+
+ // Determine writing location
+ String location = computeLocation(descriptor.getArtifactKey());
+ if (location == null)
+ // TODO: Log an error, or throw an exception?
+ return null;
+
+ String file = null;
+ try {
+ file = new URL(location).getFile();
+ } catch (MalformedURLException e1) {
+ // This should not happen
+ }
+
+ File outputFile = new File(file);
+ if (outputFile.exists())
+ System.err.println("Artifact repository out of synch. Overwriting " + outputFile.getAbsoluteFile());
+
+ if (!outputFile.getParentFile().exists() && !outputFile.getParentFile().mkdirs())
+ // TODO: Log an error, or throw an exception?
+ return null;
+
+ try {
+ return new ArtifactOutputStream(new BufferedOutputStream(new FileOutputStream(file)), descriptor);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public boolean contains(IArtifactDescriptor descriptor) {
+ return artifactDescriptors.contains(descriptor);
+ }
+
+ public boolean contains(IArtifactKey key) {
+ for (Iterator iterator = artifactDescriptors.iterator(); iterator.hasNext();) {
+ IArtifactDescriptor descriptor = (IArtifactDescriptor) iterator.next();
+ if (descriptor.getArtifactKey().equals(key))
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Return the set of descriptors in this repository.
+ * <b>NOTE:</b> this is NOT part of the API
+ * @return the set of descriptors
+ */
+ public Set getDescriptors() {
+ return artifactDescriptors;
+ }
+
+ public String[][] getRules() {
+ return mappingRules;
+ }
+
+ public void setRules(String[][] rules) {
+ mappingRules = rules;
+ }
+
+ public void tagAsImplementation() {
+ properties.setProperty(IRepositoryInfo.IMPLEMENTATION_ONLY_KEY, Boolean.valueOf(true).toString());
+ }
+
+ public void removeAll() {
+ artifactDescriptors.clear();
+ save();
+ }
+
+ public void removeDescriptor(IArtifactDescriptor descriptor) {
+ artifactDescriptors.remove(descriptor);
+ save();
+ }
+
+ public void removeDescriptor(IArtifactKey key) {
+ ArrayList toRemove = new ArrayList();
+ for (Iterator iterator = artifactDescriptors.iterator(); iterator.hasNext();) {
+ IArtifactDescriptor descriptor = (IArtifactDescriptor) iterator.next();
+ if (descriptor.getArtifactKey().equals(key))
+ toRemove.add(descriptor);
+ }
+ artifactDescriptors.removeAll(toRemove);
+ save();
+ }
+
+ // use this method to setup any transient fields etc after the object has been restored from a stream
+ public void initializeAfterLoad(URL location) {
+ this.location = location;
+ if (mapper == null)
+ mapper = new Mapper();
+ mapper.initialize(Activator.getContext(), mappingRules);
+ }
+
+ public void setSignatureVerification(boolean value) {
+ signatureVerification = value;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/SimpleArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/SimpleArtifactRepositoryFactory.java
new file mode 100644
index 000000000..d7295b329
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/SimpleArtifactRepositoryFactory.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.artifact.repository;
+
+import java.io.*;
+import java.net.URL;
+import org.eclipse.equinox.prov.artifact.repository.IArtifactRepository;
+import org.eclipse.equinox.prov.artifact.repository.IArtifactRepositoryFactory;
+import org.eclipse.equinox.prov.core.repository.RepositoryCreationException;
+
+public class SimpleArtifactRepositoryFactory implements IArtifactRepositoryFactory {
+
+ public IArtifactRepository load(URL location) {
+ if (location == null)
+ return null;
+ try {
+ InputStream descriptorStream = null;
+ try {
+ descriptorStream = new BufferedInputStream(SimpleArtifactRepository.getActualLocation(location).openStream());
+ SimpleArtifactRepository result = (SimpleArtifactRepository) ArtifactRepositoryIO.read(descriptorStream);
+ result.initializeAfterLoad(location);
+ return result;
+ } catch (RepositoryCreationException e) {
+ // TODO Auto-generated catch block
+ return null;
+ } finally {
+ if (descriptorStream != null)
+ descriptorStream.close();
+ }
+ } catch (IOException e) {
+ }
+ return null;
+ }
+
+ public IArtifactRepository create(URL location, String name, String type) {
+ return new SimpleArtifactRepository(name, location);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/Unpack200Step.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/Unpack200Step.java
new file mode 100644
index 000000000..0750ef994
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/prov/artifact/repository/Unpack200Step.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+* Copyright (c) 2007 compeople AG 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:
+* compeople AG (Stefan Liebig) - initial API and implementation
+* IBM - continuing development
+*******************************************************************************/
+package org.eclipse.equinox.internal.prov.artifact.repository;
+
+import java.io.*;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.equinox.internal.p2.jarprocessor.UnpackStep;
+import org.eclipse.equinox.internal.p2.jarprocessor.Utils;
+import org.eclipse.equinox.p2.jarprocessor.JarProcessorExecutor;
+import org.eclipse.equinox.p2.jarprocessor.JarProcessorExecutor.Options;
+import org.eclipse.equinox.prov.artifact.repository.processing.ProcessingStep;
+import org.eclipse.equinox.prov.core.helpers.FileUtils;
+
+/**
+ * The Pack200Unpacker expects an input containing ".jar.pack.gz" data.
+ */
+public class Unpack200Step extends ProcessingStep {
+ private final static String PACKED_EXT = Utils.JAR_SUFFIX + Utils.PACKED_SUFFIX;
+
+ private File packed;
+ private OutputStream tempStream;
+
+ public boolean areRequirementsSatisfied() {
+ return UnpackStep.canUnpack();
+ }
+
+ public void write(int b) throws IOException {
+ OutputStream stream = getOutputStream();
+ stream.write(b);
+ }
+
+ private OutputStream getOutputStream() throws IOException {
+ if (tempStream != null)
+ return tempStream;
+ // store input stream in temporary file
+ packed = File.createTempFile("pack200", PACKED_EXT);
+ tempStream = new BufferedOutputStream(new FileOutputStream(packed));
+ return tempStream;
+ }
+
+ private void performUnpack() throws IOException {
+ BufferedInputStream unpackedStream = null;
+ File unpacked = null;
+ File workDir = null;
+ try {
+ if (tempStream == null)
+ // hmmm, no one wrote to this stream so there is nothing to pass on
+ return;
+ // Ok, so there is content, close the tempStream
+ tempStream.close();
+ // now create a temporary directory for the JarProcessor to work in
+ // TODO How to create a unique, temporary directory atomically?
+ workDir = File.createTempFile("work", "");
+ if (!workDir.delete())
+ throw new IOException("Could not delete file for creating temporary working dir.");
+ if (!workDir.mkdirs())
+ throw new IOException("Could not create temporary working dir.");
+
+ // unpack
+ Options options = new Options();
+ options.unpack = true;
+ options.processAll = true;
+ options.input = packed;
+ options.outputDir = workDir.getPath();
+ new JarProcessorExecutor().runJarProcessor(options);
+
+ // now write the unpacked content to our destination
+ String packedFileName = packed.getName();
+ unpacked = new File(workDir, packedFileName.substring(0, packedFileName.length() - Utils.PACKED_SUFFIX.length()));
+ unpackedStream = new BufferedInputStream(new FileInputStream(unpacked));
+ FileUtils.copyStream(unpackedStream, true, destination, false);
+ unpackedStream = null;
+ } finally {
+ if (packed != null)
+ packed.delete();
+ if (unpackedStream != null)
+ unpackedStream.close();
+ if (unpacked != null)
+ unpacked.delete();
+ if (workDir != null)
+ workDir.delete();
+ }
+ }
+
+ public void close() throws IOException {
+ // When we go to close we must have seen all the content we are going to see
+ // So before closing, run unpack and write the unpacked result to the destination
+ performUnpack();
+ super.close();
+ if (status == null)
+ status = Status.OK_STATUS;
+ }
+
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/ArtifactDescriptor.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/ArtifactDescriptor.java
new file mode 100644
index 000000000..e33e07269
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/ArtifactDescriptor.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository;
+
+import java.util.*;
+import org.eclipse.equinox.prov.artifact.repository.processing.ProcessingStepDescriptor;
+import org.eclipse.equinox.prov.metadata.IArtifactKey;
+
+/**
+ * This represents information about a given artifact stored on a particular byte server.
+ */
+public class ArtifactDescriptor implements IArtifactDescriptor {
+ private static int hashCode(Object[] array) {
+ int prime = 31;
+ if (array == null)
+ return 0;
+ int result = 1;
+ for (int index = 0; index < array.length; index++) {
+ result = prime * result + (array[index] == null ? 0 : array[index].hashCode());
+ }
+ return result;
+ }
+
+ protected IArtifactKey key; // The key associated with this artifact
+
+ // The list of post processing steps that must be applied one the artifact once it
+ // has been downloaded (e.g, unpack, then md5 checksum, then...)
+ protected ProcessingStepDescriptor[] processingSteps = null;
+
+ protected Map properties = new HashMap(2);
+
+ //QUESTION: Do we need any description or user readable name
+
+ public ArtifactDescriptor(IArtifactKey key) {
+ super();
+ this.key = key;
+ }
+
+ public IArtifactKey getArtifactKey() {
+ return key;
+ }
+
+ public String getProperty(String key) {
+ return (String) properties.get(key);
+ }
+
+ public void setProperty(String key, String value) {
+ properties.put(key, value);
+ }
+
+ public ProcessingStepDescriptor[] getProcessingSteps() {
+ return processingSteps;
+ }
+
+ public void setProcessingSteps(ProcessingStepDescriptor[] value) {
+ processingSteps = value;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ArtifactDescriptor other = (ArtifactDescriptor) obj;
+ if (key == null) {
+ if (other.key != null)
+ return false;
+ } else if (!key.equals(other.key))
+ return false;
+ if (!Arrays.equals(processingSteps, other.processingSteps))
+ return false;
+ if (properties == null) {
+ if (other.properties != null)
+ return false;
+ } else if (!properties.equals(other.properties))
+ return false;
+ return true;
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((key == null) ? 0 : key.hashCode());
+ result = prime * result + ArtifactDescriptor.hashCode(processingSteps);
+ result = prime * result + ((properties == null) ? 0 : properties.hashCode());
+ return result;
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactDescriptor.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactDescriptor.java
new file mode 100644
index 000000000..0cc89ef71
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactDescriptor.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository;
+
+import org.eclipse.equinox.prov.artifact.repository.processing.ProcessingStepDescriptor;
+import org.eclipse.equinox.prov.metadata.IArtifactKey;
+
+public interface IArtifactDescriptor {
+
+ public static final String DOWNLOAD_SIZE = "download.size"; //$NON-NLS-1$
+ public static final String ARTIFACT_SIZE = "artifact.size"; //$NON-NLS-1$
+ public static final String DOWNLOAD_MD5 = "download.md5"; //$NON-NLS-1$
+ public static final String ARTIFACT_MD5 = "artifact.md5"; //$NON-NLS-1$
+
+ public abstract IArtifactKey getArtifactKey();
+
+ public abstract String getProperty(String key);
+
+ public abstract ProcessingStepDescriptor[] getProcessingSteps();
+
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRepository.java
new file mode 100644
index 000000000..daf900aa1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRepository.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository;
+
+import java.io.OutputStream;
+import java.net.URI;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.prov.core.repository.IRepositoryInfo;
+import org.eclipse.equinox.prov.metadata.IArtifactKey;
+
+/**
+ * TODO: Convert to abstract class
+ */
+public interface IArtifactRepository extends IRepositoryInfo {
+ /**
+ * Returns true if this repository contains the given descriptor.
+ * @param descriptor the descriptor to query
+ * @return true if the given descriptor is already in this repository
+ */
+ public boolean contains(IArtifactDescriptor descriptor);
+
+ /**
+ * Returns true if this repository contains the given artifact key.
+ * @param key the key to query
+ * @return true if the given key is already in this repository
+ */
+ public boolean contains(IArtifactKey key);
+
+ /**
+ * Executes the given artifact requests on this byte server.
+ * @param requests The artifact requests
+ * @param monitor
+ * @return a status object that is <code>OK</code> if requests were
+ * processed successfully. Otherwise, a status indicating information,
+ * warnings, or errors that occurred while executing the artifact requests
+ */
+ public IStatus getArtifacts(IArtifactRequest[] requests, IProgressMonitor monitor);
+
+ /**
+ * Return the set of artifact descriptors describing the ways that this repository
+ * can supply the artifact associated with the given artifact key
+ * @param key the artifact key to lookup
+ * @return the descriptors associated with the given key
+ */
+ public IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key);
+
+ /**
+ * Return a stream containing the described artifact, or null if not available
+ */
+ public IStatus getArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor);
+
+ /**
+ * Returns the list of artifact keys managed by this repository
+ * @return list of artifact keys
+ */
+ public IArtifactKey[] getArtifactKeys();
+
+ // TODO move this to a local repo interface and change to return a file
+ /**
+ * Return a URI to the given key, or null if not available
+ */
+ public URI getArtifact(IArtifactKey key);
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRepositoryFactory.java
new file mode 100644
index 000000000..b3d9dca07
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRepositoryFactory.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository;
+
+import java.net.URL;
+
+public interface IArtifactRepositoryFactory {
+
+ public IArtifactRepository load(URL location);
+
+ public IArtifactRepository create(URL location, String name, String type);
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRepositoryManager.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRepositoryManager.java
new file mode 100644
index 000000000..ace98461d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRepositoryManager.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository;
+
+import java.net.URL;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.equinox.prov.metadata.IArtifactKey;
+
+public interface IArtifactRepositoryManager {
+ public static final IArtifactRequest[] NO_ARTIFACT_REQUEST = new IArtifactRequest[0];
+
+ /**
+ * Return the list of artifact repositories known by this manager.
+ * @return the list of known repositories
+ */
+ public IArtifactRepository[] getKnownRepositories();
+
+ /**
+ * Add a repository at the given location. The location is expected to contain
+ * data that describes a valid artifact repository of a known type. If this manager
+ * already knows a repository at the given location then that repository is returned.
+ * @param location the location in which to look for a repository description
+ * @monitor
+ * @return a repository object for the given location or <code>null</code> if a repository
+ * could not be found or loaded.
+ */
+ public IArtifactRepository loadRepository(URL location, IProgressMonitor monitor);
+
+ /**
+ * Add the given repository to the set of repositories managed by this manager.
+ * @param repository the repository to add
+ */
+ public void addRepository(IArtifactRepository repository);
+
+ /**
+ * Return the artifact repository at the given location if known by this manager.
+ * Otherwise return <code>null</code>
+ * @param location the location of the repository to return
+ * @return the found repository
+ */
+ public IArtifactRepository getRepository(URL location);
+
+ /**
+ * Remove the given repository from this manager. Do nothing if the repository
+ * is not currently managed.
+ * @param toRemove the repository to remove
+ */
+ public void removeRepository(IArtifactRepository toRemove);
+
+ /**
+ * Creates and returns an artifact repository of the given type at the given location.
+ * If a repository already exists at that location <code>null</code> is returned.
+ * @param location the location for the new repository
+ * @param name the name of the new repo
+ * @param type the kind of repository to create
+ * @return the discovered or created repository
+ */
+ public IArtifactRepository createRepository(URL location, String name, String type);
+
+ /**
+ * Return a new request to download the given artifact and store it at the given destination.
+ * @param key the artifact to download
+ * @param destination the destination where the artifact will be stored
+ * @return the newly created request object
+ */
+ public IArtifactRequest createDownloadRequest(IArtifactKey key, IPath destination);
+
+ /**
+ * Return a new request to mirror the given artifact into the destination repository.
+ * @param key the artifact to mirror
+ * @param destination the destination where the artifact will be mirrored
+ * @return the newly created request object
+ */
+ public IArtifactRequest createMirrorRequest(IArtifactKey key, IWritableArtifactRepository destination);
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRequest.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRequest.java
new file mode 100644
index 000000000..2a86946b4
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IArtifactRequest.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.internal.prov.artifact.repository.ArtifactRequest;
+import org.eclipse.equinox.prov.metadata.IArtifactKey;
+
+/**
+ * This interface is not intended to be implemented by clients
+ */
+public interface IArtifactRequest {
+
+ public IArtifactKey getArtifactKey();
+
+ /**
+ * Returns the result of the previous call to {@link ArtifactRequest#perform(IProgressMonitor)},
+ * or <code>null</code> if perform has never been called.
+ *
+ * @return The result of the previous perform call.
+ */
+ public IStatus getResult();
+
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IWritableArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IWritableArtifactRepository.java
new file mode 100644
index 000000000..227c68ec5
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/IWritableArtifactRepository.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository;
+
+import java.io.OutputStream;
+import org.eclipse.equinox.prov.metadata.IArtifactKey;
+
+// TODO consider having the add and remove methods take several keys/descriptors
+// to operate on at one time.
+
+public interface IWritableArtifactRepository extends IArtifactRepository {
+
+ /**
+ * Open an output stream to which a client can write the data for the given
+ * artifact descriptor.
+ * @param descriptor the descriptor describing the artifact data to be written to the
+ * resultant stream
+ * @return the stream to which the artifact content can be written
+ */
+ public OutputStream getOutputStream(IArtifactDescriptor descriptor);
+
+ /**
+ * Add the given descriptor to the set of descriptors in this repository. This is
+ * a relatively low-level operation that should be used only when the actual related
+ * content is in this repository and the given descriptor accurately describes
+ * that content.
+ * @param descriptor the descriptor to add.
+ */
+ public void addDescriptor(IArtifactDescriptor descriptor);
+
+ /**
+ * Remove the given descriptor from the set of descriptors in this repository.
+ * @param descriptor the descriptor to remove.
+ */
+ public void removeDescriptor(IArtifactDescriptor descriptor);
+
+ /**
+ * Remove the given key and all related descriptors from this repository.
+ * @param key the key to remove.
+ */
+ public void removeDescriptor(IArtifactKey key);
+
+ /**
+ * Remove the all key and descriptor information from this repository.
+ */
+ public void removeAll();
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/Mapper.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/Mapper.java
new file mode 100644
index 000000000..b84bff2ed
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/Mapper.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import org.osgi.framework.*;
+
+public class Mapper {
+ private Filter[] filters;
+ private String[] outputStrings;
+
+ private static final String REPOURL = "repoUrl";
+ private static final String NAMESPACE = "namespace";
+ private static final String CLASSIFIER = "classifier";
+ private static final String ID = "id";
+ private static final String VERSION = "version";
+
+ public Mapper() {
+ filters = new Filter[0];
+ outputStrings = new String[0];
+ }
+
+ /**
+ * mapping rule: LDAP filter --> output value
+ * the more specific filters should be given first.
+ */
+ public void initialize(BundleContext ctx, String[][] mappingRules) {
+ filters = new Filter[mappingRules.length];
+ outputStrings = new String[mappingRules.length];
+ for (int i = 0; i < mappingRules.length; i++) {
+ try {
+ filters[i] = ctx.createFilter(mappingRules[i][0]);
+ outputStrings[i] = mappingRules[i][1];
+ } catch (InvalidSyntaxException e) {
+ //TODO Neeed to process this
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public String map(String repoUrl, String namespace, String classifier, String id, String version) {
+ Dictionary values = new Hashtable(5);
+ if (repoUrl != null)
+ values.put(REPOURL, repoUrl);
+
+ if (namespace != null)
+ values.put(NAMESPACE, namespace);
+
+ if (classifier != null)
+ values.put(CLASSIFIER, classifier);
+
+ if (id != null)
+ values.put(ID, id);
+
+ if (version != null)
+ values.put(VERSION, version);
+
+ for (int i = 0; i < filters.length; i++) {
+ if (filters[i].match(values))
+ return doReplacement(outputStrings[i], repoUrl, namespace, classifier, id, version);
+ }
+ return null;
+ }
+
+ private String doReplacement(String pattern, String repoUrl, String namespace, String classifier, String id, String version) {
+
+ // currently our mapping rules assume the repo URL is not "/" terminated.
+ // This may be the case for repoURLs in the root of a URL space e.g. root of a jar file or file:/c:/
+ if (repoUrl.endsWith("/"))
+ repoUrl = repoUrl.substring(0, repoUrl.length() - 1);
+
+ StringBuffer output = new StringBuffer(pattern);
+ int index = 0;
+ while (index < output.length()) {
+ int beginning = output.indexOf("${", index);
+ if (beginning == -1)
+ return output.toString();
+
+ int end = output.indexOf("}", beginning);
+ if (end == -1)
+ return pattern;
+
+ String varName = output.substring(beginning + 2, end);
+ String varValue = null;
+ if (varName.equalsIgnoreCase(NAMESPACE)) {
+ varValue = namespace;
+ } else if (varName.equalsIgnoreCase(CLASSIFIER)) {
+ varValue = classifier;
+ } else if (varName.equalsIgnoreCase(ID)) {
+ varValue = id;
+ } else if (varName.equalsIgnoreCase(VERSION)) {
+ varValue = version;
+ } else if (varName.equalsIgnoreCase(REPOURL)) {
+ varValue = repoUrl;
+ }
+ if (varValue == null)
+ varValue = "";
+
+ output.replace(beginning, end + 1, varValue);
+ index = beginning + varValue.length();
+ }
+ return output.toString();
+ }
+
+ public String toString() {
+ StringBuffer result = new StringBuffer();
+ for (int i = 0; i < filters.length; i++) {
+ result.append(filters[i]).append('-').append('>').append(outputStrings[i]).append('\n');
+ }
+ return result.toString();
+ }
+
+ public String[][] serialize() {
+ String[][] result = new String[filters.length][2];
+ for (int i = 0; i < filters.length; i++) {
+ result[i][0] = filters[i].toString();
+ result[i][1] = outputStrings[i].toString();
+ }
+ return result;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/RepositoryDescriptor.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/RepositoryDescriptor.java
new file mode 100644
index 000000000..cb8a0378a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/RepositoryDescriptor.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository;
+
+import java.net.URI;
+import org.eclipse.equinox.prov.metadata.IArtifactKey;
+import org.osgi.framework.Version;
+
+public abstract class RepositoryDescriptor {
+ /**
+ * Return the type of repository described.
+ * @return the type of repository
+ */
+ public abstract String getType();
+
+ /**
+ * Return the version of the repository
+ * @return the version of the repository
+ */
+ public abstract Version getVersion();
+
+ /**
+ * The set of transports that can be used to download artifacts from this repository
+ * @return an array of
+ */
+ public abstract String[] getTransports();
+
+ public abstract IArtifactDescriptor getArtifact(IArtifactKey key);
+
+ public abstract URI getBaseURL(); //the url to be used as a base for download
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/Transport.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/Transport.java
new file mode 100644
index 000000000..c8ff18afe
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/Transport.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository;
+
+import java.io.OutputStream;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+
+public abstract class Transport {
+ public abstract IStatus download(String toDownload, OutputStream target, IProgressMonitor pm);
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/processing/ProcessingStep.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/processing/ProcessingStep.java
new file mode 100644
index 000000000..f6338eeaf
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/processing/ProcessingStep.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+* Copyright (c) 2007 compeople AG 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:
+* compeople AG (Stefan Liebig) - initial API and implementation
+* IBM Corporation - continuing development
+*******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository.processing;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.internal.prov.artifact.repository.Activator;
+import org.eclipse.equinox.prov.artifact.repository.IArtifactDescriptor;
+
+/**
+ * ProcessingSteps process the data written to them and pass the resultant data on
+ * to a configured destination stream. Steps may monitor (e.g., count) the data, compute information
+ * about the data (e.g., checksum or hash) or transform the data (e.g., unpack200).
+ */
+public abstract class ProcessingStep extends OutputStream {
+ protected OutputStream destination;
+ protected IProgressMonitor monitor;
+ protected IStatus status = Status.OK_STATUS;
+
+ protected ProcessingStep() {
+ super();
+ }
+
+ /**
+ * Initialize this processing step according to the information in the given
+ * descriptor and context. After initialization, this step is ready for linking
+ * with other steps or output streams
+ * @param descriptor description of the step
+ * @param context the context in which the step is being used
+ */
+ public void initialize(ProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
+ }
+
+ /**
+ * Link this step with the given output stream and configure the step to use the given
+ * progress monitor. After linking the step is ready to have data written to it.
+ * @param destination the stream into which to write the processed data
+ * @param monitor the progress monitor to use for reporting activity
+ */
+ public void link(OutputStream destination, IProgressMonitor monitor) {
+ this.destination = destination;
+ this.monitor = monitor;
+ }
+
+ /**
+ * Process the given byte and pass the result on to the configured destination stream
+ * @param b the byte being written
+ */
+ public void write(int b) throws IOException {
+ }
+
+ /**
+ * Flush any unwritten data from this stream.
+ */
+ public void flush() throws IOException {
+ super.flush();
+ if (destination != null)
+ destination.flush();
+ }
+
+ /**
+ * Close this stream and, if the configured destination is a ProcessingStep,
+ * close it as well. Typically a chain of steps terminates in a conventional
+ * output stream. Implementors of this method should ensure they set the
+ * status of the step.
+ */
+ public void close() throws IOException {
+ super.close();
+ if (destination instanceof ProcessingStep)
+ destination.close();
+ destination = null;
+ monitor = null;
+ }
+
+ /**
+ * Return the status of this step. The status will be <code>null</code> if the
+ * step has not yet executed. If the step has executed the returned status
+ * indicates the success or failure of the step.
+ * @param deep whether or not to aggregate the status of any linked steps
+ * @return the requested status
+ */
+ public IStatus getStatus(boolean deep) {
+ if (!deep)
+ return status;
+ ArrayList list = new ArrayList();
+ int severity = collectStatus(list);
+ if (severity == IStatus.OK)
+ return Status.OK_STATUS;
+ IStatus[] result = (IStatus[]) list.toArray(new IStatus[list.size()]);
+ return new MultiStatus(Activator.ID, severity, result, "Result of processing steps", null);
+ }
+
+ private int collectStatus(ArrayList list) {
+ list.add(status);
+ if (!(destination instanceof ProcessingStep))
+ return status.getSeverity();
+ int result = ((ProcessingStep) destination).collectStatus(list);
+ // TODO greater than test here is a little brittle but it is very unlikely that we will add
+ // a new status severity.
+ if (status.getSeverity() > result)
+ return status.getSeverity();
+ return result;
+
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/processing/ProcessingStepDescriptor.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/processing/ProcessingStepDescriptor.java
new file mode 100644
index 000000000..e79910ef0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/processing/ProcessingStepDescriptor.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+* Copyright (c) 2007 compeople AG 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:
+* compeople AG (Stefan Liebig) - initial API and implementation
+*******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository.processing;
+
+/**
+ * The description of a processor step.
+ */
+public class ProcessingStepDescriptor {
+
+ private final String processorId; //the operation to be applied (e.g: unpack, md5, signature verification, etc.)
+ private final String data; //data requested for the processing (eg. expected checksum)
+ private final boolean required; //whether the step is optional or not
+
+ /**
+ * Create a processing step description.
+ *
+ * @param processorId
+ * @param data
+ * @param required
+ */
+ public ProcessingStepDescriptor(String processorId, String data, boolean required) {
+ super();
+ this.processorId = processorId;
+ this.data = data;
+ this.required = required;
+ }
+
+ public String getProcessorId() {
+ return processorId;
+ }
+
+ public String getData() {
+ return data;
+ }
+
+ public boolean isRequired() {
+ return required;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((data == null) ? 0 : data.hashCode());
+ result = prime * result + ((processorId == null) ? 0 : processorId.hashCode());
+ result = prime * result + (required ? 1231 : 1237);
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof ProcessingStepDescriptor))
+ return false;
+ final ProcessingStepDescriptor other = (ProcessingStepDescriptor) obj;
+ if (data == null) {
+ if (other.data != null)
+ return false;
+ } else if (!data.equals(other.data))
+ return false;
+ if (processorId == null) {
+ if (other.processorId != null)
+ return false;
+ } else if (!processorId.equals(other.processorId))
+ return false;
+ if (required != other.required)
+ return false;
+ return true;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/processing/ProcessingStepHandler.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/processing/ProcessingStepHandler.java
new file mode 100644
index 000000000..e1777da14
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/prov/artifact/repository/processing/ProcessingStepHandler.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+* Copyright (c) 2007 compeople AG 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:
+* compeople AG (Stefan Liebig) - initial API and implementation
+* IBM - continuing development
+*******************************************************************************/
+package org.eclipse.equinox.prov.artifact.repository.processing;
+
+import java.io.OutputStream;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.internal.prov.artifact.repository.Activator;
+import org.eclipse.equinox.prov.artifact.repository.IArtifactDescriptor;
+
+/**
+ * Creates processing step instances from extensions and executes them.
+ */
+public class ProcessingStepHandler {
+
+ public ProcessingStep[] create(ProcessingStepDescriptor[] descriptors, IArtifactDescriptor context) {
+ ProcessingStep[] result = new ProcessingStep[descriptors.length];
+ for (int i = 0; i < descriptors.length; i++)
+ result[i] = create(descriptors[i], context);
+ return result;
+ }
+
+ public ProcessingStep create(ProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
+ IExtensionRegistry registry = RegistryFactory.getRegistry();
+ IExtension extension = registry.getExtension("org.eclipse.equinox.prov.artifact.repository.processingSteps", descriptor.getProcessorId()); //$NON-NLS-1$
+ IConfigurationElement[] config = extension.getConfigurationElements();
+ Exception error = null;
+ try {
+ Object object = config[0].createExecutableExtension("class"); //$NON-NLS-1$
+ if (object instanceof ProcessingStep) {
+ ProcessingStep step = (ProcessingStep) object;
+ step.initialize(descriptor, context);
+ return step;
+ }
+ } catch (CoreException e) {
+ error = e;
+ }
+ int severity = descriptor.isRequired() ? IStatus.ERROR : IStatus.INFO;
+ ProcessingStep result = new ProcessingStep() {};
+ result.status = new Status(severity, Activator.ID, "Could not instantiate step:" + descriptor.getProcessorId(), error);
+ return result;
+ }
+
+ public OutputStream createAndLink(ProcessingStepDescriptor[] descriptors, IArtifactDescriptor context, OutputStream output, IProgressMonitor monitor) {
+ if (descriptors == null)
+ return output;
+ ProcessingStep[] steps = create(descriptors, context);
+ return link(steps, output, monitor);
+ }
+
+ public OutputStream link(ProcessingStep[] steps, OutputStream output, IProgressMonitor monitor) {
+ OutputStream previous = output;
+ for (int i = steps.length - 1; i >= 0; i--) {
+ ProcessingStep step = steps[i];
+ step.link(previous, monitor);
+ previous = step;
+ }
+ return previous;
+ }
+
+ public IStatus validateSteps(OutputStream output) {
+ if (!(output instanceof ProcessingStep))
+ return Status.OK_STATUS;
+ return ((ProcessingStep) output).getStatus(true);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.console/.classpath b/bundles/org.eclipse.equinox.p2.console/.classpath
new file mode 100644
index 000000000..7cdeb7319
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.console/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.console/.project b/bundles/org.eclipse.equinox.p2.console/.project
new file mode 100644
index 000000000..7c645a5cb
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.console/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.equinox.prov.console</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.p2.console/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.console/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..a455b6228
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.console/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,340 @@
+#Thu Sep 13 22:02:41 EDT 2007
+eclipse.preferences.version=1
+instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
+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.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.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=error
+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=ignore
+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.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.p2.console/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.p2.console/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..b61b6ad25
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.console/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+#Sun Sep 23 11:57:44 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.p2.console/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..d9dbf8884
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Provisioning Console Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.equinox.prov.console
+Bundle-Version: 0.1.0.qualifier
+Bundle-Activator: org.eclipse.equinox.internal.prov.console.Activator
+Bundle-Vendor: IBM
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.equinox.internal.prov.console;x-friends:="org.eclipse.equinox.prov.director.app,org.eclipse.equinox.prov.tools"
+Import-Package: org.eclipse.core.runtime;common=split,
+ org.eclipse.equinox.configurator,
+ org.eclipse.equinox.prov.artifact.repository,
+ org.eclipse.equinox.prov.core,
+ org.eclipse.equinox.prov.core.helpers,
+ org.eclipse.equinox.prov.core.location,
+ org.eclipse.equinox.prov.core.repository,
+ org.eclipse.equinox.prov.director,
+ org.eclipse.equinox.prov.engine,
+ org.eclipse.equinox.prov.installregistry,
+ org.eclipse.equinox.prov.metadata,
+ org.eclipse.equinox.prov.metadata.repository,
+ org.eclipse.equinox.prov.query,
+ org.eclipse.osgi.framework.console;version="1.0.0";resolution:=optional,
+ org.eclipse.osgi.service.environment;version="1.0.0",
+ org.eclipse.osgi.service.resolver;version="1.1.0",
+ org.osgi.framework;version="1.4.0",
+ org.osgi.util.tracker;version="1.3.3"
+Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
+ J2SE-1.4
diff --git a/bundles/org.eclipse.equinox.p2.console/Provisioning console.launch b/bundles/org.eclipse.equinox.p2.console/Provisioning console.launch
new file mode 100644
index 000000000..d255cbeb7
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.console/Provisioning console.launch
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher">
+<booleanAttribute key="automaticAdd" value="false"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="false"/>
+<stringAttribute key="configLocation" value="d:\tmp\selfhosting"/>
+<booleanAttribute key="default_auto_start" value="false"/>
+<intAttribute key="default_start_level" value="4"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-console -consolelog"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="target_bundles" value="org.eclipse.core.jobs@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.osgi@:,org.eclipse.osgi.services@default:default"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<stringAttribute key="workspace_bundles" value="com.thoughtworks.xstream@default:default,org.eclipse.ecf@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:true,org.eclipse.equinox.prov.artifact.repository@default:default,org.eclipse.equinox.prov.console@default:true,org.eclipse.equinox.prov.core@default:default,org.eclipse.equinox.prov.director@default:default,org.eclipse.equinox.prov.download@default:default,org.eclipse.equinox.prov.engine@default:default,org.eclipse.equinox.prov.examplarysetup@default:true,org.eclipse.equinox.prov.metadata@default:default,org.eclipse.equinox.prov.metadata.repository@default:default,org.eclipse.equinox.prov.touchpoint.eclipse@default:default,org.eclipse.equinox.prov.touchpoint.natives@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.mozilla.rhino@default:default"/>
+</launchConfiguration>
diff --git a/bundles/org.eclipse.equinox.p2.console/build.properties b/bundles/org.eclipse.equinox.p2.console/build.properties
new file mode 100644
index 000000000..4a49c9482
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.console/build.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/prov/console/Activator.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/prov/console/Activator.java
new file mode 100644
index 000000000..28017a393
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/prov/console/Activator.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.console;
+
+import org.eclipse.equinox.prov.engine.IProfileRegistry;
+import org.osgi.framework.*;
+import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+
+public class Activator implements BundleActivator, ServiceTrackerCustomizer {
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.equinox.prov.console"; //$NON-NLS-1$
+ private static final String PROVIDER_NAME = "org.eclipse.osgi.framework.console.CommandProvider"; //$NON-NLS-1$
+ private static BundleContext context;
+
+ private ServiceTracker profileTracker;
+ private ProvCommandProvider provider;
+ private ServiceRegistration providerRegistration = null;
+
+ public static BundleContext getContext() {
+ return context;
+ }
+
+ public Activator() {
+ super();
+ }
+
+ public void start(BundleContext context) throws Exception {
+ Activator.context = context;
+ boolean registerCommands = true;
+ try {
+ Class.forName(PROVIDER_NAME);
+ } catch (ClassNotFoundException e) {
+ registerCommands = false;
+ }
+
+ if (registerCommands) {
+ profileTracker = new ServiceTracker(context, IProfileRegistry.class.getName(), this);
+ profileTracker.open();
+ }
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ profileTracker.close();
+ if (providerRegistration != null)
+ providerRegistration.unregister();
+ providerRegistration = null;
+ Activator.context = null;
+ }
+
+ public Object addingService(ServiceReference reference) {
+ BundleContext context = Activator.getContext();
+ IProfileRegistry registry = (IProfileRegistry) context.getService(reference);
+ provider = new ProvCommandProvider(context.getProperty("eclipse.prov.profile"), registry);
+ providerRegistration = context.registerService(PROVIDER_NAME, provider, null);
+ return registry;
+ }
+
+ public void modifiedService(ServiceReference reference, Object service) {
+ // TODO Auto-generated method stub
+ }
+
+ public void removedService(ServiceReference reference, Object service) {
+ if (providerRegistration != null)
+ providerRegistration.unregister();
+ providerRegistration = null;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/prov/console/ProvCommandProvider.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/prov/console/ProvCommandProvider.java
new file mode 100644
index 000000000..698c17b90
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/prov/console/ProvCommandProvider.java
@@ -0,0 +1,345 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.prov.console;
+
+import java.net.*;
+import java.util.*;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.equinox.prov.artifact.repository.IArtifactRepository;
+import org.eclipse.equinox.prov.core.ProvisionException;
+import org.eclipse.equinox.prov.engine.IProfileRegistry;
+import org.eclipse.equinox.prov.engine.Profile;
+import org.eclipse.equinox.prov.metadata.*;
+import org.eclipse.equinox.prov.metadata.repository.IMetadataRepository;
+import org.eclipse.equinox.prov.query.Query;
+import org.eclipse.osgi.framework.console.CommandInterpreter;
+import org.eclipse.osgi.framework.console.CommandProvider;
+import org.eclipse.osgi.service.resolver.VersionRange;
+
+/**
+ * An OSGi console command provider that adds various commands for interacting
+ * with the provisioning system.
+ */
+public class ProvCommandProvider implements CommandProvider {
+ public static final String NEW_LINE = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ private static final String IU_KIND_NAMESPACE = "org.eclipse.equinox.prov.type";
+
+ // private Profile profile;
+
+ public ProvCommandProvider(String profileId, IProfileRegistry registry) {
+ // look up the profile we are currently running and use it as the
+ // default.
+ // TODO define a way to spec the default profile to manage
+ // if (profileId != null) {
+ // profile = registry.getProfile(profileId);
+ // if (profile != null)
+ // return;
+ // }
+ // // A default was not defined so manage the first profile we can find
+ // Profile[] profiles = registry.getProfiles();
+ // if (profiles.length > 0)
+ // profile = profiles[0];
+ }
+
+ /**
+ * Adds a metadata repository.
+ */
+ public void _provaddrepo(CommandInterpreter interpreter) {
+ String urlString = interpreter.nextArgument();
+ if (urlString == null) {
+ interpreter.print("Repository location must be provided");
+ interpreter.println();
+ return;
+ }
+ URL repoURL = toURL(interpreter, urlString);
+ if (repoURL == null)
+ return;
+ if (ProvisioningHelper.addMetadataRepository(repoURL) == null)
+ interpreter.println("Unable to add repository: " + repoURL);
+ }
+
+ public void _provaddartifactrepo(CommandInterpreter interpreter) {
+ String urlString = interpreter.nextArgument();
+ if (urlString == null) {
+ interpreter.print("Repository location must be provided");
+ interpreter.println();
+ return;
+ }
+ URL repoURL = toURL(interpreter, urlString);
+ if (repoURL == null)
+ return;
+ if (ProvisioningHelper.addArtifactRepository(repoURL) == null)
+ interpreter.println("Unable to add repository: " + repoURL);
+ }
+
+ /**
+ * Install a given IU to a given profile location.
+ */
+ public void _provinstall(CommandInterpreter interpreter) {
+ String iu = interpreter.nextArgument();
+ String version = interpreter.nextArgument();
+ String profileId = interpreter.nextArgument();
+ if (profileId == null || profileId.equals("this"))
+ profileId = IProfileRegistry.SELF;
+ if (iu == null || version == null || profileId == null) {
+ interpreter.println("Installable unit id, version, and profile Id must be provided");
+ return;
+ }
+ IStatus s = null;
+ try {
+ s = ProvisioningHelper.install(iu, version, ProvisioningHelper.getProfile(profileId), new NullProgressMonitor());
+ } catch (ProvisionException e) {
+ interpreter.println("installation failed ");
+ e.printStackTrace();
+ return;
+ }
+ if (s.isOK())
+ interpreter.println("installation complete");
+ else
+ interpreter.println("installation failed " + s.getMessage());
+ }
+
+ /**
+ * Creates a profile given an id, location, and flavor
+ */
+ public void _provaddprofile(CommandInterpreter interpreter) {
+ String profileId = interpreter.nextArgument();
+ String location = interpreter.nextArgument();
+ String flavor = interpreter.nextArgument();
+ if (profileId == null || location == null || flavor == null) {
+ interpreter.println("Id, location, and flavor must be provided");
+ return;
+ }
+ String environments = interpreter.nextArgument();
+ Properties props = new Properties();
+ props.setProperty(Profile.PROP_INSTALL_FOLDER, location);
+ props.setProperty(Profile.PROP_FLAVOR, flavor);
+ if (environments != null)
+ props.setProperty(Profile.PROP_ENVIRONMENTS, environments);
+
+ ProvisioningHelper.addProfile(profileId, props);
+ }
+
+ /**
+ * Lists the known metadata repositories, or the contents of a given
+ * metadata repository.
+ *
+ * @param interpreter
+ */
+ public void _provliu(CommandInterpreter interpreter) {
+ String urlString = processArgument(interpreter.nextArgument());
+ String id = processArgument(interpreter.nextArgument());
+ String version = processArgument(interpreter.nextArgument());
+ URL repoURL = null;
+ if (urlString != null && !urlString.equals("*"))
+ repoURL = toURL(interpreter, urlString);
+ IInstallableUnit[] units = sort(ProvisioningHelper.getInstallableUnits(repoURL, id, new VersionRange(version), null));
+ for (int i = 0; i < units.length; i++)
+ println(interpreter, units[i]);
+ }
+
+ /**
+ * Lists the known metadata repositories, or the contents of a given
+ * metadata repository.
+ *
+ * @param interpreter
+ */
+ public void _provlr(CommandInterpreter interpreter) {
+ String urlString = processArgument(interpreter.nextArgument());
+ String id = processArgument(interpreter.nextArgument());
+ String version = processArgument(interpreter.nextArgument());
+ if (urlString == null) {
+ IMetadataRepository[] repositories = ProvisioningHelper.getMetadataRepositories();
+ if (repositories == null)
+ return;
+ for (int i = 0; i < repositories.length; i++)
+ interpreter.println(repositories[i].getLocation());
+ return;
+ }
+ URL repoURL = toURL(interpreter, urlString);
+ if (repoURL == null)
+ return;
+ IInstallableUnit[] units = sort(ProvisioningHelper.getInstallableUnits(repoURL, id, new VersionRange(version), null));
+ for (int i = 0; i < units.length; i++)
+ println(interpreter, units[i]);
+ }
+
+ /**
+ * Lists the group IUs in all known metadata repositories, or in the given
+ * metadata repository.
+ *
+ * @param interpreter
+ */
+ public void _provlg(CommandInterpreter interpreter) {
+ String urlString = processArgument(interpreter.nextArgument());
+ IMetadataRepository[] repositories;
+ if (urlString == null) {
+ repositories = ProvisioningHelper.getMetadataRepositories();
+ if (repositories == null)
+ return;
+ } else {
+ URL repoURL = toURL(interpreter, urlString);
+ if (repoURL == null)
+ return;
+ IMetadataRepository repo = null;
+ repo = ProvisioningHelper.getMetadataRepository(repoURL);
+ if (repo == null)
+ return;
+ repositories = new IMetadataRepository[] {repo};
+ }
+ RequiredCapability requirement = new RequiredCapability(IU_KIND_NAMESPACE, "group", null, null, false, false);
+ IInstallableUnit[] units = sort(Query.query(repositories, null, null, new RequiredCapability[] {requirement}, false, null));
+ for (int i = 0; i < units.length; i++)
+ println(interpreter, units[i]);
+ }
+
+ /**
+ * Lists the known artifact repositories, or the contents of a given
+ * artifact repository.
+ *
+ * @param interpreter
+ */
+ public void _provlar(CommandInterpreter interpreter) {
+ String urlString = processArgument(interpreter.nextArgument());
+ if (urlString == null) {
+ IArtifactRepository[] repositories = ProvisioningHelper.getArtifactRepositories();
+ if (repositories == null)
+ return;
+ for (int i = 0; i < repositories.length; i++)
+ interpreter.println(repositories[i].getLocation());
+ return;
+ }
+ URL repoURL = toURL(interpreter, urlString);
+ if (repoURL == null)
+ return;
+ IArtifactRepository repo = ProvisioningHelper.getArtifactRepository(repoURL);
+ IArtifactKey[] keys = null;
+ try {
+ keys = (repo != null) ? repo.getArtifactKeys() : null;
+ } catch (UnsupportedOperationException e) {
+ interpreter.println("Repository does not support list commands.");
+ return;
+ }
+ if (keys == null || keys.length == 0) {
+ interpreter.println("Repository has no artifacts");
+ return;
+ }
+ for (int i = 0; i < keys.length; i++)
+ println(interpreter, keys[i], repo.getArtifact(keys[i]));
+ }
+
+ /**
+ * 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 new URL(urlString);
+ } catch (MalformedURLException e) {
+ interpreter.print(e.getMessage());
+ interpreter.println();
+ return null;
+ }
+ }
+
+ private String processArgument(String arg) {
+ if (arg == null || arg.equals("*"))
+ return null;
+ return arg;
+ }
+
+ /**
+ * Lists the known profiles, or the contents of a given profile.
+ *
+ * @param interpreter
+ */
+ public void _provlp(CommandInterpreter interpreter) {
+ String profileId = processArgument(interpreter.nextArgument());
+ String id = processArgument(interpreter.nextArgument());
+ String range = processArgument(interpreter.nextArgument());
+ if (profileId == null) {
+ Profile[] profiles = ProvisioningHelper.getProfiles();
+ for (int i = 0; i < profiles.length; i++)
+ interpreter.println(profiles[i].getProfileId());
+ return;
+ }
+ // determine which profile is to be listed
+ Profile target = null;
+ if (profileId.equals("this"))
+ profileId = IProfileRegistry.SELF;
+ target = ProvisioningHelper.getProfile(profileId);
+ if (target == null)
+ return;
+
+ // list the profile contents
+ IInstallableUnit[] result = sort(Query.query(new Profile[] {target}, id, new VersionRange(range), null, false, null));
+ for (int i = 0; i < result.length; i++)
+ interpreter.println(result[i]);
+ }
+
+ private IInstallableUnit[] sort(IInstallableUnit[] units) {
+ Arrays.sort(units, new Comparator() {
+ public int compare(Object arg0, Object arg1) {
+ return arg0.toString().compareTo(arg1.toString());
+ }
+ });
+ return units;
+ }
+
+ public String getHelp() {
+ StringBuffer help = new StringBuffer();
+ help.append(NEW_LINE);
+ help.append("---"); //$NON-NLS-1$
+ help.append("Provisioning Commands");
+ help.append("---"); //$NON-NLS-1$
+ help.append(NEW_LINE);
+ help.append("\tprovlr [<repository URL> <iu id | *> <version range | *>] - Lists all metadata repositories, or the contents of a given metadata repository");
+ help.append(NEW_LINE);
+ help.append("\tprovlar [<repository URL>] - Lists all artifact repositories, or the contents of a given artifact repository");
+ help.append(NEW_LINE);
+ help.append("\tprovliu [<repository URL | *> <iu id | *> <version range | *>] - Lists the IUs that match the pattern in the given repo. * matches all");
+ help.append(NEW_LINE);
+ help.append("\tprovlp [<profile id | *> - Lists all profiles, or the contents of the profile at the given profile");
+ help.append(NEW_LINE);
+ help.append("\tprovlg [<repository URL> <iu id | *> <version range | *>] - Lists all IUs with group capabilities in the given repo or in all repos if the URL is omitted");
+ help.append(NEW_LINE);
+ help.append("\tprovinstall <InstallableUnit> <version> <profileId> - Provisions an IU to the profile with the give id");
+ help.append(NEW_LINE);
+ help.append("\tprovaddrepo <repository URL> - Adds a metadata repository");
+ help.append(NEW_LINE);
+ help.append("\tprovaddartifactrepo <repository URL> - Adds an artifact repository");
+ help.append(NEW_LINE);
+ help.append("\tprovaddprofile <profileId> <location> <flavor> - Adds a profile with the given id, location and flavor");
+ help.append(NEW_LINE);
+ return help.toString();
+ }
+
+ /**
+ * Prints a string representation of an {@link InstallableUnit} to the
+ * iterpreter's output stream.
+ */
+ public void print(CommandInterpreter interpreter, IInstallableUnit unit) {
+ interpreter.print(unit.getId() + ' ' + unit.getVersion());
+ }
+
+ /**
+ * Prints a string representation of an {@link InstallableUnit} to the
+ * iterpreter's output stream, following by a line terminator
+ */
+ public void println(CommandInterpreter interpreter, IInstallableUnit unit) {
+ print(interpreter, unit);
+ interpreter.println();
+ }
+
+ private void println(CommandInterpreter interpreter, IArtifactKey artifactKey, URI artifact) {
+ interpreter.print(artifactKey.toString() + ' ' + artifact);
+ interpreter.println();
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/prov/console/ProvisioningHelper.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/prov/console/ProvisioningHelper.java
new file mode 100644
index 000000000..6e3099813
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/prov/console/ProvisioningHelper.java
@@ -0,0 +1,288 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.console;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Properties;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.configurator.Configurator;
+import org.eclipse.equinox.prov.artifact.repository.IArtifactRepository;
+import org.eclipse.equinox.prov.artifact.repository.IArtifactRepositoryManager;
+import org.eclipse.equinox.prov.core.ProvisionException;
+import org.eclipse.equinox.prov.core.helpers.ServiceHelper;
+import org.eclipse.equinox.prov.director.IDirector;
+import org.eclipse.equinox.prov.engine.IProfileRegistry;
+import org.eclipse.equinox.prov.engine.Profile;
+import org.eclipse.equinox.prov.metadata.IInstallableUnit;
+import org.eclipse.equinox.prov.metadata.repository.IMetadataRepository;
+import org.eclipse.equinox.prov.metadata.repository.IMetadataRepositoryManager;
+import org.eclipse.equinox.prov.query.CompoundIterator;
+import org.eclipse.equinox.prov.query.Query;
+import org.eclipse.osgi.service.environment.EnvironmentInfo;
+import org.eclipse.osgi.service.resolver.VersionRange;
+import org.osgi.framework.Version;
+
+public class ProvisioningHelper {
+
+ public static IMetadataRepository addMetadataRepository(URL location) {
+ IMetadataRepositoryManager manager = (IMetadataRepositoryManager) ServiceHelper.getService(Activator.getContext(), IMetadataRepositoryManager.class.getName());
+ if (manager == null)
+ throw new IllegalStateException("No metadata repository manager found");
+ IMetadataRepository repository = manager.loadRepository(location, null);
+ if (repository != null)
+ return repository;
+
+ // for convenience create and add a repo here
+ // TODO need to get rid o fthe factory method.
+ String repositoryName = location + " - metadata"; //$NON-NLS-1$
+ IMetadataRepository result = manager.createRepository(location, repositoryName, "org.eclipse.equinox.prov.metadata.repository.simpleRepository"); //$NON-NLS-1$
+ return result;
+ }
+
+ public static IMetadataRepository getMetadataRepository(URL location) {
+ IMetadataRepositoryManager manager = (IMetadataRepositoryManager) ServiceHelper.getService(Activator.getContext(), IMetadataRepositoryManager.class.getName());
+ if (manager == null)
+ throw new IllegalStateException("No metadata repository manager found");
+ return manager.getRepository(location);
+ }
+
+ public static void removeMetadataRepository(URL location) {
+ IMetadataRepositoryManager manager = (IMetadataRepositoryManager) ServiceHelper.getService(Activator.getContext(), IMetadataRepositoryManager.class.getName());
+ if (manager == null)
+ throw new IllegalStateException("No metadata repository manager found");
+ IMetadataRepository repo = manager.getRepository(location);
+ if (repo != null)
+ manager.removeRepository(repo);
+ }
+
+ public static IArtifactRepository addArtifactRepository(URL location) {
+ IArtifactRepositoryManager manager = (IArtifactRepositoryManager) ServiceHelper.getService(Activator.getContext(), IArtifactRepositoryManager.class.getName());
+ if (manager == null)
+ // TODO log here
+ return null;
+ IArtifactRepository repository = manager.loadRepository(location, null);
+ if (repository != null)
+ return repository;
+
+ // could not load a repo at that location so create one as a convenience
+ String repositoryName = location + " - artifacts"; //$NON-NLS-1$
+ return manager.createRepository(location, repositoryName, "org.eclipse.equinox.prov.artifact.repository.simpleRepository"); //$NON-NLS-1$
+ }
+
+ public static void removeArtifactRepository(URL location) {
+ IArtifactRepositoryManager manager = (IArtifactRepositoryManager) ServiceHelper.getService(Activator.getContext(), IArtifactRepositoryManager.class.getName());
+ if (manager == null)
+ // TODO log here
+ return;
+ IArtifactRepository[] repos = manager.getKnownRepositories();
+ for (int i = 0; i < repos.length; i++) {
+ IArtifactRepository repo = repos[i];
+ if (repo.getLocation().equals(location)) {
+ manager.removeRepository(repo);
+ return;
+ }
+ }
+ }
+
+ public static Profile addProfile(String profileId, Properties properties) {
+ IProfileRegistry profileRegistry = (IProfileRegistry) ServiceHelper.getService(Activator.getContext(), IProfileRegistry.class.getName());
+ if (profileRegistry == null)
+ return null;
+ Profile profile = profileRegistry.getProfile(profileId);
+ if (profile != null)
+ return profile;
+
+ profile = new Profile(profileId);
+
+ for (Iterator it = properties.keySet().iterator(); it.hasNext();) {
+ String key = (String) it.next();
+ profile.setValue(key, properties.getProperty(key));
+ }
+
+ if (profile.getValue(Profile.PROP_ENVIRONMENTS) == null) {
+ EnvironmentInfo info = (EnvironmentInfo) ServiceHelper.getService(Activator.getContext(), EnvironmentInfo.class.getName());
+ if (info != null)
+ profile.setValue(Profile.PROP_ENVIRONMENTS, "osgi.os=" + info.getOS() + ",osgi.ws=" + info.getWS() + ",osgi.arch=" + info.getOSArch());
+ else
+ profile.setValue(Profile.PROP_ENVIRONMENTS, "");
+ }
+
+ profileRegistry.addProfile(profile);
+ return profile;
+ }
+
+ public static void removeProfile(String profileId) {
+ IProfileRegistry profileRegistry = (IProfileRegistry) ServiceHelper.getService(Activator.getContext(), IProfileRegistry.class.getName());
+ if (profileRegistry == null)
+ return;
+ Profile profile = profileRegistry.getProfile(profileId);
+ if (profile != null)
+ profileRegistry.removeProfile(profile);
+ }
+
+ public static Profile[] getProfiles() {
+ IProfileRegistry profileRegistry = (IProfileRegistry) ServiceHelper.getService(Activator.getContext(), IProfileRegistry.class.getName());
+ if (profileRegistry == null)
+ return new Profile[0];
+ return profileRegistry.getProfiles();
+ }
+
+ public static Profile getProfile(String id) {
+ IProfileRegistry profileRegistry = (IProfileRegistry) ServiceHelper.getService(Activator.getContext(), IProfileRegistry.class.getName());
+ if (profileRegistry == null)
+ return null;
+ return profileRegistry.getProfile(id);
+ }
+
+ /**
+ * Returns the installable units with the given id and version
+ * specifications in the given metadata repository. <code>null</code>
+ * can be used to indicate wildcards for any of the arguments.
+ *
+ * @param location The location of the metdata repo to search. <code>null</code> indicates
+ * search all known repos.
+ * @param id The id of the IUs to find. <code>null</code> indicates
+ * wildcard.
+ * @param range The version range of the IUs to find. <code>null</code>
+ * indicates wildcard.
+ * @return The IUs that match the query
+ */
+ public static IInstallableUnit[] getInstallableUnits(URL location, String id, VersionRange range, IProgressMonitor progress) {
+ IMetadataRepository[] repositories = null;
+ if (location == null)
+ repositories = getMetadataRepositories();
+ else
+ repositories = new IMetadataRepository[] {getMetadataRepository(location)};
+ Iterator i = Query.getIterator(repositories, id, range, null, false);
+ return CompoundIterator.asArray(i, progress);
+ }
+
+ /**
+ * Returns the installable units with the given id and version
+ * specifications.
+ *
+ * @param profileId The profile to search
+ * @param id The id of the IUs to find. <code>null</code> indicates
+ * wildcard.
+ * @param range The version range of the IUs to find. <code>null</code>
+ * indicates wildcard.
+ * @return The IUs that match the query
+ */
+ public static IInstallableUnit[] getInstallableUnits(String profileId, String id, VersionRange range, IProgressMonitor progress) {
+ Profile[] profiles = null;
+ if (profileId == null)
+ profiles = getProfiles();
+ else
+ profiles = new Profile[] {getProfile(profileId)};
+ Iterator i = Query.getIterator(profiles, id, range, null, false);
+ return CompoundIterator.asArray(i, progress);
+ }
+
+ public static IMetadataRepository[] getMetadataRepositories() {
+ IMetadataRepositoryManager manager = (IMetadataRepositoryManager) ServiceHelper.getService(Activator.getContext(), IMetadataRepositoryManager.class.getName());
+ if (manager == null)
+ // TODO log here
+ return null;
+ IMetadataRepository[] repos = manager.getKnownRepositories();
+ if (repos.length > 0)
+ return repos;
+ return null;
+ }
+
+ /**
+ * Install the described IU
+ */
+ public static IStatus install(String unitId, String version, Profile profile, IProgressMonitor progress) throws ProvisionException {
+ IMetadataRepository[] repos = getMetadataRepositories();
+ if (repos == null || profile == null)
+ return null;
+ // search for a matching IU in the known repositories
+ IInstallableUnit toInstall = null;
+ Version unitVersion = new Version(version);
+ outer: for (int i = 0; i < repos.length; i++) {
+ IInstallableUnit[] ius = repos[i].getInstallableUnits(progress);
+ for (int j = 0; j < ius.length; j++) {
+ if (unitId.equals(ius[j].getId()) && unitVersion.equals(ius[j].getVersion())) {
+ toInstall = ius[j];
+ break outer;
+ }
+ }
+ }
+ if (toInstall == null) {
+ StringBuffer error = new StringBuffer();
+ error.append("Installable unit not found: " + unitId + ' ' + unitVersion + '\n');
+ error.append("Repositories searched:\n");
+ for (int i = 0; i < repos.length; i++)
+ error.append(repos[i].getLocation() + "\n");
+ throw new ProvisionException(error.toString());
+ }
+
+ IDirector director = (IDirector) ServiceHelper.getService(Activator.getContext(), IDirector.class.getName());
+ if (director == null)
+ throw new ProvisionException("No director service found.");
+
+ return director.install(new IInstallableUnit[] {toInstall}, profile, null, progress);
+ }
+
+ /**
+ * Uninstall the described IU
+ */
+ public static IStatus uninstall(String unitId, String version, Profile profile, IProgressMonitor progress) throws ProvisionException {
+ IDirector director = (IDirector) ServiceHelper.getService(Activator.getContext(), IDirector.class.getName());
+ if (director == null)
+ throw new ProvisionException("No director service found.");
+
+ // return director.uninstall(new InstallableUnit[] {toInstall}, profile,
+ // null);
+ return null;
+ }
+
+ public static void kick(String profileId) {
+ Configurator configurator = (Configurator) ServiceHelper.getService(Activator.getContext(), Configurator.class.getName());
+ if (configurator == null)
+ return;
+ if (profileId == null)
+ try {
+ configurator.applyConfiguration();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ else {
+ // TODO do some work here to figure out how to kick some random profile
+ // configurator.applyConfiguration(configURL);
+ }
+ }
+
+ public static IArtifactRepository[] getArtifactRepositories() {
+ IArtifactRepositoryManager manager = (IArtifactRepositoryManager) ServiceHelper.getService(Activator.getContext(), IArtifactRepositoryManager.class.getName());
+ if (manager == null)
+ // TODO log here
+ return null;
+ IArtifactRepository[] repos = manager.getKnownRepositories();
+ if (repos.length > 0)
+ return repos;
+ return null;
+ }
+
+ public static IArtifactRepository getArtifactRepository(URL repoURL) {
+ IArtifactRepository[] repositories = getArtifactRepositories();
+ if (repositories == null)
+ return null;
+ for (int i = 0; i < repositories.length; i++)
+ if (repoURL.equals(repositories[i].getLocation()))
+ return repositories[i];
+ return null;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/.classpath b/bundles/org.eclipse.equinox.p2.core/.classpath
new file mode 100644
index 000000000..ce7393340
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.core/.project b/bundles/org.eclipse.equinox.p2.core/.project
new file mode 100644
index 000000000..6a29114b4
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.equinox.prov.core</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.p2.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..744f8b46f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,331 @@
+#Thu Sep 13 16:23:45 EDT 2007
+eclipse.preferences.version=1
+instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
+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.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.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=error
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+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.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+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.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+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.p2.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..c4540955a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+#Sun Sep 23 11:57: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.p2.core/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..7913d20db
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..7b94ce6da
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF
@@ -0,0 +1,27 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Core Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.equinox.prov.core;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Import-Package: com.thoughtworks.xstream,
+ org.eclipse.core.runtime.adaptor,
+ org.eclipse.osgi.framework.eventmgr;version="1.0.0",
+ org.eclipse.osgi.framework.log;version="1.0.0",
+ org.eclipse.osgi.internal.resolver,
+ org.eclipse.osgi.service.datalocation;version="1.0.0",
+ org.eclipse.osgi.service.resolver;version="1.1.0",
+ org.eclipse.osgi.util;version="1.0.0",
+ org.osgi.framework;version="1.3.0",
+ org.osgi.util.tracker;version="1.3.3"
+Export-Package: org.eclipse.equinox.internal.prov.core;x-internal:=true,
+ org.eclipse.equinox.prov.core,
+ org.eclipse.equinox.prov.core.eventbus,
+ org.eclipse.equinox.prov.core.helpers,
+ org.eclipse.equinox.prov.core.location,
+ org.eclipse.equinox.prov.core.repository
+Eclipse-LazyStart: true
+Bundle-ClassPath: .
+Bundle-RequiredExecutionEnvironment: J2SE-1.4,
+ CDC-1.1/Foundation-1.1
+Bundle-Activator: org.eclipse.equinox.internal.prov.core.Activator
+Require-Bundle: org.eclipse.equinox.common
diff --git a/bundles/org.eclipse.equinox.p2.core/about.html b/bundles/org.eclipse.equinox.p2.core/about.html
new file mode 100644
index 000000000..460233046
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/about.html
@@ -0,0 +1,28 @@
+<!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 (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). 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, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.p2.core/build.properties b/bundles/org.eclipse.equinox.p2.core/build.properties
new file mode 100644
index 000000000..475da1dec
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Activator.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Activator.java
new file mode 100644
index 000000000..521779118
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Activator.java
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.prov.core;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Dictionary;
+import java.util.Hashtable;
+import org.eclipse.equinox.prov.core.location.AgentLocation;
+import org.eclipse.osgi.framework.log.FrameworkLog;
+import org.eclipse.osgi.service.datalocation.Location;
+import org.osgi.framework.*;
+import org.osgi.util.tracker.ServiceTracker;
+
+public class Activator implements BundleActivator {
+
+ public static final String AGENT_DATA_AREA = "eclipse.prov.data.area"; //$NON-NLS-1$
+ public static Location agentDataLocation = null;
+
+ public static BundleContext context;
+ public static Location downloadLocation = null;
+ private static Activator instance;
+ // Data mode constants for user, configuration and data locations.
+ private static final String NO_DEFAULT = "@noDefault"; //$NON-NLS-1$
+ private static final String NONE = "@none"; //$NON-NLS-1$
+
+ private static final String PROP_CONFIG_DIR = "osgi.configuration.area"; //$NON-NLS-1$
+ public static final String PROP_TMPDIR = "java.io.tmpdir"; //$NON-NLS-1$
+ public static final String PROP_USER_DIR = "user.dir"; //$NON-NLS-1$
+ public static final String PROP_USER_HOME = "user.home"; //$NON-NLS-1$
+
+ public static final String READ_ONLY_AREA_SUFFIX = ".readOnly"; //$NON-NLS-1$
+
+ private static final String VAR_CONFIG_DIR = "@config.dir"; //$NON-NLS-1$
+ private static final String VAR_USER_DIR = "@user.dir"; //$NON-NLS-1$
+ private static final String VAR_USER_HOME = "@user.home"; //$NON-NLS-1$
+ private ServiceRegistration agentLocationRegistration = null;
+ ServiceTracker logTracker;
+
+ /**
+ * NOTE: This method is copied from LocationHelper in org.eclipse.osgi
+ * due to access restrictions.
+ */
+ private static URL adjustTrailingSlash(URL url, boolean trailingSlash) throws MalformedURLException {
+ String file = url.getFile();
+ if (trailingSlash == (file.endsWith("/"))) //$NON-NLS-1$
+ return url;
+ file = trailingSlash ? file + "/" : file.substring(0, file.length() - 1); //$NON-NLS-1$
+ return new URL(url.getProtocol(), url.getHost(), file);
+ }
+
+ /**
+ * Builds a URL with the given specification
+ * NOTE: This method is copied from LocationHelper in org.eclipse.osgi
+ * due to access restrictions.
+ *
+ * @param spec the URL specification
+ * @param trailingSlash flag to indicate a trailing slash on the spec
+ * @return a URL
+ */
+ private static URL buildURL(String spec, boolean trailingSlash) {
+ if (spec == null)
+ return null;
+ boolean isFile = spec.startsWith("file:"); //$NON-NLS-1$
+ try {
+ if (isFile)
+ return adjustTrailingSlash(new File(spec.substring(5)).toURL(), trailingSlash);
+ return new URL(spec);
+ } catch (MalformedURLException e) {
+ // if we failed and it is a file spec, there is nothing more we can do
+ // otherwise, try to make the spec into a file URL.
+ if (isFile)
+ return null;
+ try {
+ return adjustTrailingSlash(new File(spec).toURL(), trailingSlash);
+ } catch (MalformedURLException e1) {
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns the framework log, or null if not available
+ */
+ public static FrameworkLog getFrameworkLog() {
+ //protect against concurrent shutdown
+ Activator a = instance;
+ if (a == null)
+ return null;
+ ServiceTracker tracker = a.getLogTracker();
+ if (tracker == null)
+ return null;
+ return (FrameworkLog) tracker.getService();
+ }
+
+ private static String substituteVar(String source, String var, String prop) {
+ String value = Activator.context.getProperty(prop);
+ if (value == null)
+ value = "";
+ return value + source.substring(var.length());
+ }
+
+ private Location buildLocation(String property, URL defaultLocation, boolean readOnlyDefault, boolean addTrailingSlash) {
+ String location = Activator.context.getProperty(property);
+ // the user/product may specify a non-default readOnly setting
+ String userReadOnlySetting = Activator.context.getProperty(property + READ_ONLY_AREA_SUFFIX);
+ boolean readOnly = (userReadOnlySetting == null ? readOnlyDefault : Boolean.valueOf(userReadOnlySetting).booleanValue());
+ // if the instance location is not set, predict where the workspace will be and
+ // put the instance area inside the workspace meta area.
+ if (location == null)
+ return new BasicLocation(property, defaultLocation, readOnly);
+ String trimmedLocation = location.trim();
+ if (trimmedLocation.equalsIgnoreCase(NONE))
+ return null;
+ if (trimmedLocation.equalsIgnoreCase(NO_DEFAULT))
+ return new BasicLocation(property, null, readOnly);
+ if (trimmedLocation.startsWith(VAR_USER_HOME)) {
+ String base = substituteVar(location, VAR_USER_HOME, PROP_USER_HOME);
+ location = new File(base).getAbsolutePath();
+ } else if (trimmedLocation.startsWith(VAR_USER_DIR)) {
+ String base = substituteVar(location, VAR_USER_DIR, PROP_USER_DIR);
+ location = new File(base).getAbsolutePath();
+ } else if (trimmedLocation.startsWith(VAR_CONFIG_DIR)) {
+ //note the config dir system property is already a URL
+ location = substituteVar(location, VAR_CONFIG_DIR, PROP_CONFIG_DIR);
+ }
+ URL url = buildURL(location, addTrailingSlash);
+ BasicLocation result = null;
+ if (url != null) {
+ result = new BasicLocation(property, null, readOnly);
+ result.setURL(url, false);
+ }
+ return result;
+ }
+
+ private ServiceTracker getLogTracker() {
+ if (logTracker != null)
+ return logTracker;
+ //lazy init if the bundle has been started
+ if (context == null)
+ return null;
+ logTracker = new ServiceTracker(context, FrameworkLog.class.getName(), null);
+ logTracker.open();
+ return logTracker;
+ }
+
+ public void start(BundleContext context) throws Exception {
+ instance = this;
+ Activator.context = context;
+ URL defaultLocation = new URL(context.getProperty("osgi.configuration.area") + "org.eclipse.equinox.prov.core/agentdata/");
+ agentDataLocation = buildLocation(AGENT_DATA_AREA, defaultLocation, false, true);
+ Dictionary locationProperties = new Hashtable();
+ if (defaultLocation != null) {
+ locationProperties.put("type", AGENT_DATA_AREA); //$NON-NLS-1$
+ agentLocationRegistration = context.registerService(new String[] {Location.class.getName(), AgentLocation.class.getName()}, agentDataLocation, locationProperties);
+ }
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ instance = null;
+ if (agentLocationRegistration != null)
+ agentLocationRegistration.unregister();
+ if (logTracker != null) {
+ logTracker.close();
+ logTracker = null;
+ }
+ Activator.context = null;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/BasicLocation.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/BasicLocation.java
new file mode 100644
index 000000000..304327928
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/BasicLocation.java
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.prov.core;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.eclipse.equinox.prov.core.location.AgentLocation;
+import org.eclipse.osgi.service.datalocation.Location;
+
+/**
+ * Internal class.
+ */
+public class BasicLocation implements AgentLocation {
+ private static class MockLocker implements Locker {
+ public boolean lock() throws IOException {
+ // locking always successful
+ return true;
+ }
+
+ public void release() {
+ // nothing to release
+ }
+ }
+
+ private boolean isReadOnly;
+ private URL location = null;
+ private Location parent;
+ private URL defaultValue;
+
+ // locking related fields
+ private File lockFile;
+ private Locker locker;
+ public static final String PROP_OSGI_LOCKING = "osgi.locking"; //$NON-NLS-1$
+ public static boolean DEBUG;
+
+ private static boolean isRunningWithNio() {
+ try {
+ Class.forName("java.nio.channels.FileLock"); //$NON-NLS-1$
+ } catch (ClassNotFoundException e) {
+ return false;
+ }
+ return true;
+ }
+
+ public static Locker createLocker(File lock, String lockMode) {
+ if (lockMode == null)
+ lockMode = Activator.context.getProperty(PROP_OSGI_LOCKING);
+
+ if ("none".equals(lockMode)) //$NON-NLS-1$
+ return new MockLocker();
+
+ if ("java.io".equals(lockMode)) //$NON-NLS-1$
+ return new Locker_JavaIo(lock);
+
+ if ("java.nio".equals(lockMode)) { //$NON-NLS-1$
+ if (isRunningWithNio())
+ return new Locker_JavaNio(lock);
+ else
+ // TODO should we return null here. NIO was requested but we could not do it...
+ return new Locker_JavaIo(lock);
+ }
+
+ // Backup case if an invalid value has been specified
+ if (isRunningWithNio())
+ return new Locker_JavaNio(lock);
+ else
+ return new Locker_JavaIo(lock);
+ }
+
+ public BasicLocation(String property, URL defaultValue, boolean isReadOnly) {
+ super();
+ this.defaultValue = defaultValue;
+ this.isReadOnly = isReadOnly;
+ }
+
+ public boolean allowsDefault() {
+ return defaultValue != null;
+ }
+
+ public URL getDefault() {
+ return defaultValue;
+ }
+
+ public Location getParentLocation() {
+ return parent;
+ }
+
+ public synchronized URL getURL() {
+ if (location == null && defaultValue != null)
+ setURL(defaultValue, false);
+ return location;
+ }
+
+ public synchronized boolean isSet() {
+ return location != null;
+ }
+
+ public boolean isReadOnly() {
+ return isReadOnly;
+ }
+
+ public synchronized boolean setURL(URL value, boolean lock) throws IllegalStateException {
+ // if (location != null)
+ // throw new IllegalStateException(Messages.ECLIPSE_CANNOT_CHANGE_LOCATION);
+ //// File file = null;
+ //// if (value.getProtocol().equalsIgnoreCase("file")) { //$NON-NLS-1$
+ //// try {
+ //// String basePath = new File(value.getFile()).getCanonicalPath();
+ //// value = new URL("file:" + basePath); //$NON-NLS-1$
+ //// } catch (IOException e) {
+ //// // do nothing just use the original value
+ //// }
+ //// file = new File(value.getFile(), LOCK_FILENAME);
+ //// }
+ // lock = lock && !isReadOnly;
+ // if (lock) {
+ // try {
+ // if (!lock(file))
+ // return false;
+ // } catch (IOException e) {
+ // return false;
+ // }
+ // }
+ // lockFile = file;
+ location = value;
+ // LocationManager.buildURL(value.toExternalForm(), true);
+ // if (property != null)
+ // System.setProperty(property, location.toExternalForm());
+ return lock;
+ }
+
+ public synchronized void setParent(Location value) {
+ parent = value;
+ }
+
+ public synchronized boolean lock() throws IOException {
+ if (!isSet())
+ return false;
+ return lock(lockFile);
+ }
+
+ private boolean lock(File lock) throws IOException {
+ if (lock == null || isReadOnly)
+ return false;
+
+ File parentFile = new File(lock.getParent());
+ if (!parentFile.exists())
+ if (!parentFile.mkdirs())
+ return false;
+
+ setLocker(lock);
+ if (locker == null)
+ return true;
+ boolean locked = false;
+ try {
+ locked = locker.lock();
+ return locked;
+ } finally {
+ if (!locked)
+ locker = null;
+ }
+ }
+
+ private void setLocker(File lock) {
+ if (locker != null)
+ return;
+ String lockMode = Activator.context.getProperty(PROP_OSGI_LOCKING);
+ locker = createLocker(lock, lockMode);
+ }
+
+ public synchronized void release() {
+ if (locker != null)
+ locker.release();
+ }
+
+ public URL getArtifactRepositoryURL() {
+ try {
+ return new URL(getURL(), "artifactRepository/");
+ } catch (MalformedURLException e) {
+ // TODO Auto-generated catch block
+ return null;
+ }
+ }
+
+ public URL getMetadataRepositoryURL() {
+ try {
+ return new URL(getURL(), "metadataRepository/");
+ } catch (MalformedURLException e) {
+ // TODO Auto-generated catch block
+ return null;
+ }
+ }
+
+ public URL getTouchpointDataArea(String touchpointId) {
+ try {
+ return new URL(getURL(), "touchpoints/" + touchpointId);
+ } catch (MalformedURLException e) {
+ // TODO Auto-generated catch block
+ return null;
+ }
+ }
+
+ /**
+ * TODO: This method was added in Eclipse 3.4 - We need to stop implementing the OSGi interface,
+ * and then this stub method can be removed.
+ */
+ public Location createLocation(Location parent, URL defaultValue, boolean readonly) {
+ return null;
+ }
+
+ /**
+ * TODO: This method was added in Eclipse 3.4 - We need to stop implementing the OSGi interface,
+ * and then this stub method can be removed.
+ */
+ public boolean isLocked() throws IOException {
+ return false;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Locker.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Locker.java
new file mode 100644
index 000000000..521dc0501
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Locker.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.core;
+
+import java.io.IOException;
+
+/**
+ * Internal class.
+ */
+public interface Locker {
+ public boolean lock() throws IOException;
+
+ public void release();
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Locker_JavaIo.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Locker_JavaIo.java
new file mode 100644
index 000000000..2ba6cf51d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Locker_JavaIo.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.core;
+
+import java.io.*;
+
+/**
+ * Internal class.
+ */
+public class Locker_JavaIo implements Locker {
+ private File lockFile;
+ private RandomAccessFile lockRAF;
+
+ public Locker_JavaIo(File lockFile) {
+ this.lockFile = lockFile;
+ }
+
+ public synchronized boolean lock() throws IOException {
+ //if the lock file already exists, try to delete,
+ //assume failure means another eclipse has it open
+ if (lockFile.exists())
+ lockFile.delete();
+ if (lockFile.exists())
+ return false;
+
+ //open the lock file so other instances can't co-exist
+ lockRAF = new RandomAccessFile(lockFile, "rw"); //$NON-NLS-1$
+ lockRAF.writeByte(0);
+
+ return true;
+ }
+
+ public synchronized void release() {
+ try {
+ if (lockRAF != null) {
+ lockRAF.close();
+ lockRAF = null;
+ }
+ } catch (IOException e) {
+ //don't complain, we're making a best effort to clean up
+ }
+ if (lockFile != null)
+ lockFile.delete();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Locker_JavaNio.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Locker_JavaNio.java
new file mode 100644
index 000000000..917e26192
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Locker_JavaNio.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.core;
+
+import java.io.*;
+import java.nio.channels.FileLock;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Internal class.
+ */
+public class Locker_JavaNio implements Locker {
+ private File lockFile;
+ private FileLock fileLock;
+ private RandomAccessFile raFile;
+
+ public Locker_JavaNio(File lockFile) {
+ this.lockFile = lockFile;
+ }
+
+ public synchronized boolean lock() throws IOException {
+ raFile = new RandomAccessFile(lockFile, "rw"); //$NON-NLS-1$
+ try {
+ fileLock = raFile.getChannel().tryLock();
+ } catch (IOException ioe) {
+ // print exception if debugging
+ if (BasicLocation.DEBUG)
+ System.out.println(NLS.bind(Messages.location_cannotLock, lockFile));
+ // produce a more specific message for clients
+ String specificMessage = NLS.bind(Messages.location_cannotLockNIO, new Object[] {lockFile, ioe.getMessage(), "\"-D" + BasicLocation.PROP_OSGI_LOCKING + "=none\""}); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new IOException(specificMessage);
+ }
+ if (fileLock != null)
+ return true;
+ raFile.close();
+ raFile = null;
+ return false;
+ }
+
+ public synchronized void release() {
+ if (fileLock != null) {
+ try {
+ fileLock.release();
+ } catch (IOException e) {
+ //don't complain, we're making a best effort to clean up
+ }
+ fileLock = null;
+ }
+ if (raFile != null) {
+ try {
+ raFile.close();
+ } catch (IOException e) {
+ //don't complain, we're making a best effort to clean up
+ }
+ raFile = null;
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Messages.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Messages.java
new file mode 100644
index 000000000..672ebd4f7
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/Messages.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.core;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.prov.core.messages"; //$NON-NLS-1$
+ public static final String ECLIPSE_CANNOT_CHANGE_LOCATION = null;
+
+ static {
+ // initialize resource bundles
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ // Do not instantiate
+ }
+
+ public static String location_cannotLock;
+ public static String location_cannotLockNIO;
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/messages.properties b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/messages.properties
new file mode 100644
index 000000000..f6ae633b8
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/prov/core/messages.properties
@@ -0,0 +1,10 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/ProvisionException.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/ProvisionException.java
new file mode 100644
index 000000000..86d9afabe
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/ProvisionException.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core;
+
+public class ProvisionException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ public ProvisionException(String message) {
+ super(message);
+ }
+
+ public ProvisionException(Throwable e) {
+ super(e);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/eventbus/ProvisioningEventBus.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/eventbus/ProvisioningEventBus.java
new file mode 100644
index 000000000..e556b6f13
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/eventbus/ProvisioningEventBus.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.eventbus;
+
+import java.util.EventObject;
+import org.eclipse.osgi.framework.eventmgr.*;
+
+//TODO Need to clean up the lifecycle of this class
+public class ProvisioningEventBus implements EventDispatcher {
+ private EventListeners syncListeners = new EventListeners();
+ private EventListeners asyncListeners = new EventListeners();
+ private EventManager eventManager = new EventManager("Provisioning Event Dispatcher"); //$NON-NLS-1$
+
+ public void addListener(ProvisioningListener toAdd) {
+ if (toAdd instanceof SynchronousProvisioningListener) {
+ synchronized (syncListeners) {
+ syncListeners.addListener(toAdd, toAdd);
+ }
+ } else {
+ synchronized (asyncListeners) {
+ asyncListeners.addListener(toAdd, toAdd);
+ }
+ }
+ }
+
+ public void removeListener(ProvisioningListener toRemove) {
+ if (toRemove instanceof SynchronousProvisioningListener) {
+ synchronized (syncListeners) {
+ if (syncListeners != null) {
+ syncListeners.removeListener(toRemove);
+ }
+ }
+ } else {
+ synchronized (asyncListeners) {
+ if (asyncListeners != null) {
+ asyncListeners.removeListener(toRemove);
+ }
+ }
+ }
+ }
+
+ public void publishEvent(EventObject event) {
+ /* queue to hold set of listeners */
+ ListenerQueue listeners = new ListenerQueue(eventManager);
+
+ /* synchronize while building the listener list */
+ synchronized (syncListeners) {
+ /* add set of BundleContexts w/ listeners to queue */
+ listeners.queueListeners(syncListeners, this);
+ /* synchronously dispatch to populate listeners queue */
+ listeners.dispatchEventSynchronous(0, event);
+ }
+
+ listeners = new ListenerQueue(eventManager);
+ synchronized (asyncListeners) {
+ listeners.queueListeners(asyncListeners, this);
+ listeners.dispatchEventAsynchronous(0, event);
+ }
+ }
+
+ public void dispatchEvent(Object eventListener, Object listenerObject, int eventAction, Object eventObject) {
+ try {
+ ((ProvisioningListener) eventListener).notify((EventObject) eventObject);
+ } catch (Exception e) {
+ e.printStackTrace();
+ //TODO Need to do the appropriate logging
+ }
+ }
+
+ public void close() {
+ eventManager.close();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/eventbus/ProvisioningListener.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/eventbus/ProvisioningListener.java
new file mode 100644
index 000000000..15a90f2a6
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/eventbus/ProvisioningListener.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.eventbus;
+
+import java.util.EventListener;
+import java.util.EventObject;
+
+public interface ProvisioningListener extends EventListener {
+ public void notify(EventObject o);
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/eventbus/SynchronousProvisioningListener.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/eventbus/SynchronousProvisioningListener.java
new file mode 100644
index 000000000..b99afe766
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/eventbus/SynchronousProvisioningListener.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.eventbus;
+
+public interface SynchronousProvisioningListener extends ProvisioningListener {
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/ArrayUtils.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/ArrayUtils.java
new file mode 100644
index 000000000..ee8d5f7ac
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/ArrayUtils.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.helpers;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+public class ArrayUtils {
+ /**
+ * Find the index of the first occurrence of object in array, or -1.
+ * Use Arrays.binarySearch if array is big and sorted.
+ */
+ public static int indexOf(Object[] array, Object object) {
+ for (int i = 0; i < array.length; i += 1) {
+ if (object == null ? array[i] == null : object.equals(array[i]))
+ return i;
+ }
+ return -1;
+ }
+
+ /**
+ * Iterate over an array.
+ */
+ public static class ArrayIterator implements Iterator {
+ private final Object[] array;
+ private int next; // next element to return
+
+ public ArrayIterator(Object[] array) {
+ this.array = array;
+ this.next = 0;
+ }
+
+ public boolean hasNext() {
+ return this.next < this.array.length;
+ }
+
+ public Object next() throws NoSuchElementException {
+ try {
+ return this.array[this.next++];
+ } catch (ArrayIndexOutOfBoundsException e) {
+ throw new NoSuchElementException();
+ }
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/FileUtils.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/FileUtils.java
new file mode 100644
index 000000000..47d82467d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/FileUtils.java
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.helpers;
+
+import java.io.*;
+import java.net.URL;
+import java.util.zip.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.osgi.util.NLS;
+
+public class FileUtils {
+
+ /**
+ * Unzip from a File to an output directory.
+ */
+ public static void unzipFile(File zipFile, File outputDir) throws IOException {
+ InputStream in = new FileInputStream(zipFile);
+ try {
+ unzipStream(in, zipFile.length(), outputDir, null, null);
+ } catch (IOException e) {
+ // add the file name to the message
+ throw new IOException(NLS.bind(Messages.Util_Error_Unzipping, zipFile, e.getMessage()));
+ } finally {
+ in.close();
+ }
+ }
+
+ /**
+ * Unzip from a File to an output directory, with progress indication.
+ * monitor may be null.
+ */
+ public static void unzipFile(File zipFile, File outputDir, String taskName, IProgressMonitor monitor) throws IOException {
+ InputStream in = new FileInputStream(zipFile);
+ try {
+ unzipStream(in, zipFile.length(), outputDir, taskName, monitor);
+ } catch (IOException e) {
+ // add the file name to the message
+ throw new IOException(NLS.bind(Messages.Util_Error_Unzipping, zipFile, e.getMessage()));
+ } finally {
+ in.close();
+ }
+ }
+
+ /**
+ * Unzip from a URL to an output directory.
+ */
+ public static void unzipURL(URL zipURL, File outputDir) throws IOException {
+ unzipURL(zipURL, outputDir, null, null);
+ }
+
+ /**
+ * Unzip from a URL to an output directory, with progress indication.
+ * monitor may be null.
+ */
+ public static void unzipURL(URL zipURL, File outputDir, String taskName, IProgressMonitor monitor) throws IOException {
+ int size = zipURL.openConnection().getContentLength();
+ InputStream in = zipURL.openStream();
+ try {
+ unzipStream(in, size, outputDir, taskName, monitor);
+ } catch (IOException e) {
+ // add the URL to the message
+ throw new IOException(NLS.bind(Messages.Util_Error_Unzipping, zipURL, e.getMessage()));
+ } finally {
+ in.close();
+ }
+ }
+
+ /**
+ * Unzip from an InputStream to an output directory.
+ */
+ public static void unzipStream(InputStream stream, long size, File outputDir, String taskName, IProgressMonitor monitor) throws IOException {
+ InputStream is = monitor == null ? stream : stream; // new ProgressMonitorInputStream(stream, size, size, taskName, monitor); TODO Commented code
+ ZipInputStream in = new ZipInputStream(is);
+ ZipEntry ze = in.getNextEntry();
+ if (ze == null) {
+ // There must be at least one entry in a zip file.
+ // When there isn't getNextEntry returns null.
+ in.close();
+ throw new IOException(Messages.Util_Invalid_Zip_File_Format);
+ }
+ do {
+ File outFile = new File(outputDir, ze.getName());
+ if (ze.isDirectory()) {
+ outFile.mkdirs();
+ } else {
+ if (outFile.exists()) {
+ outFile.delete();
+ } else {
+ outFile.getParentFile().mkdirs();
+ }
+ try {
+ copyStream(in, false, new FileOutputStream(outFile), true);
+ } catch (FileNotFoundException e) {
+ // TEMP: ignore this for now in case we're trying to replace
+ // a running eclipse.exe
+ }
+ outFile.setLastModified(ze.getTime());
+ }
+ in.closeEntry();
+ } while ((ze = in.getNextEntry()) != null);
+ in.close();
+ }
+
+ // Delete empty directories under dir, including dir itself.
+ public static void deleteEmptyDirs(File dir) throws IOException {
+ File[] files = dir.listFiles();
+ if (files != null) {
+ for (int i = 0; i < files.length; i += 1) {
+ deleteEmptyDirs(files[i]);
+ }
+ dir.getCanonicalFile().delete();
+ }
+ }
+
+ /**
+ * 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 void zip(File[] sourceFiles, File destinationArchive) throws IOException {
+ ZipOutputStream output = new ZipOutputStream(new FileOutputStream(destinationArchive));
+ try {
+ for (int i = 0; i < sourceFiles.length; i++)
+ if (sourceFiles[i].isDirectory())
+ zipDir(output, sourceFiles[i], new Path(sourceFiles[i].getName()));
+ else
+ zipFile(output, sourceFiles[i], new Path(""));//$NON-NLS-1$
+ } finally {
+ try {
+ // Note! This call will fail miserably if no entries were added to the zip!
+ // The file is left open after an exception is thrown.
+ output.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+
+ /*
+ * Zip the contents of the given directory into the zip file represented by
+ * the given zip stream. Prepend the given prefix to the file paths.
+ */
+ private static void zipDir(ZipOutputStream output, File source, IPath prefix) {
+ File[] files = source.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ try {
+ if (files[i].isFile())
+ zipFile(output, files[i], prefix);
+ else
+ zipDir(output, files[i], prefix.append(files[i].getName()));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /*
+ * Add the given file to the zip file represented by the specified stream.
+ * Prepend the given prefix to the path of the file.
+ */
+ private static void zipFile(ZipOutputStream output, File sourceFile, IPath prefix) throws IOException {
+ InputStream input = new FileInputStream(sourceFile);
+ try {
+ ZipEntry zipEntry = new ZipEntry(prefix.append(sourceFile.getName()).toString());
+ zipEntry.setTime(sourceFile.lastModified());
+ output.putNextEntry(zipEntry);
+ copyStream(input, true, output, false);
+ } finally {
+ try {
+ input.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ try {
+ output.closeEntry();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/Headers.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/Headers.java
new file mode 100644
index 000000000..9fb93dc0f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/Headers.java
@@ -0,0 +1,300 @@
+package org.eclipse.equinox.prov.core.helpers;
+
+/*******************************************************************************
+ * Copyright (c) 2003, 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
+ *******************************************************************************/
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.*;
+import org.eclipse.osgi.util.ManifestElement;
+import org.osgi.framework.BundleException;
+
+/**
+ * Headers classes. This class implements a Dictionary that has
+ * the following behaviour:
+ * <ul>
+ * <li>put and remove clear throw UnsupportedOperationException.
+ * The Dictionary is thus read-only to others.
+ * <li>The String keys in the Dictionary are case-preserved,
+ * but the get operation is case-insensitive.
+ * </ul>
+ * TODO: This class is copied from org.eclipse.osgi due to access restrictions. We
+ * can't make this API so we need to find a place for it.
+ * @since 3.1
+ */
+public class Headers extends Dictionary implements Map {
+ private boolean readOnly = false;
+ private Object[] headers;
+ private Object[] values;
+ private int size = 0;
+
+ /**
+ * Create an empty Headers dictionary.
+ *
+ * @param initialCapacity The initial capacity of this Headers object.
+ */
+ public Headers(int initialCapacity) {
+ super();
+ headers = new Object[initialCapacity];
+ values = new Object[initialCapacity];
+ }
+
+ /**
+ * Create a Headers dictionary from a Dictionary.
+ *
+ * @param values The initial dictionary for this Headers object.
+ * @exception IllegalArgumentException If a case-variant of the key is
+ * in the dictionary parameter.
+ */
+ public Headers(Dictionary values) {
+ this(values.size());
+ /* initialize the headers and values */
+ Enumeration keys = values.keys();
+ while (keys.hasMoreElements()) {
+ Object key = keys.nextElement();
+ set(key, values.get(key));
+ }
+ }
+
+ /**
+ * Case-preserved keys.
+ */
+ public synchronized Enumeration keys() {
+ return new ArrayEnumeration(headers, size);
+ }
+
+ /**
+ * Values.
+ */
+ public synchronized Enumeration elements() {
+ return new ArrayEnumeration(values, size);
+ }
+
+ private int getIndex(Object key) {
+ boolean stringKey = key instanceof String;
+ for (int i = 0; i < size; i++) {
+ if (stringKey && (headers[i] instanceof String)) {
+ if (((String) headers[i]).equalsIgnoreCase((String) key))
+ return i;
+ } else {
+ if (headers[i].equals(key))
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ private Object remove(int remove) {
+ Object removed = values[remove];
+ for (int i = remove; i < size; i++) {
+ if (i == headers.length - 1) {
+ headers[i] = null;
+ values[i] = null;
+ } else {
+ headers[i] = headers[i + 1];
+ values[i] = values[i + 1];
+ }
+ }
+ if (remove < size)
+ size--;
+ return removed;
+ }
+
+ private void add(Object header, Object value) {
+ if (size == headers.length) {
+ // grow the arrays
+ Object[] newHeaders = new Object[headers.length + 10];
+ Object[] newValues = new Object[values.length + 10];
+ System.arraycopy(headers, 0, newHeaders, 0, headers.length);
+ System.arraycopy(values, 0, newValues, 0, values.length);
+ headers = newHeaders;
+ values = newValues;
+ }
+ headers[size] = header;
+ values[size] = value;
+ size++;
+ }
+
+ /**
+ * Support case-insensitivity for keys.
+ *
+ * @param key name.
+ */
+ public synchronized Object get(Object key) {
+ int i = -1;
+ if ((i = getIndex(key)) != -1)
+ return values[i];
+ return null;
+ }
+
+ /**
+ * Set a header value or optionally replace it if it already exists.
+ *
+ * @param key Key name.
+ * @param value Value of the key or null to remove key.
+ * @param replace A value of true will allow a previous
+ * value of the key to be replaced. A value of false
+ * will cause an IllegalArgumentException to be thrown
+ * if a previous value of the key exists.
+ * @return the previous value to which the key was mapped,
+ * or null if the key did not have a previous mapping.
+ *
+ * @exception IllegalArgumentException If a case-variant of the key is
+ * already present.
+ * @since 3.2
+ */
+ public synchronized Object set(Object key, Object value, boolean replace) {
+ if (readOnly)
+ throw new UnsupportedOperationException();
+ if (key instanceof String)
+ key = ((String) key).intern();
+ int i = getIndex(key);
+ if (value == null) { /* remove */
+ if (i != -1)
+ return remove(i);
+ } else { /* put */
+ if (i != -1) { /* duplicate key */
+ if (!replace)
+ throw new IllegalArgumentException("HEADER_DUPLICATE_KEY_EXCEPTION: " + key);
+ Object oldVal = values[i];
+ values[i] = value;
+ return oldVal;
+ }
+ add(key, value);
+ }
+ return null;
+ }
+
+ /**
+ * Set a header value.
+ *
+ * @param key Key name.
+ * @param value Value of the key or null to remove key.
+ * @return the previous value to which the key was mapped,
+ * or null if the key did not have a previous mapping.
+ *
+ * @exception IllegalArgumentException If a case-variant of the key is
+ * already present.
+ */
+ public synchronized Object set(Object key, Object value) {
+ return set(key, value, false);
+ }
+
+ public synchronized void setReadOnly() {
+ readOnly = true;
+ }
+
+ /**
+ * Returns the number of entries (distinct keys) in this dictionary.
+ *
+ * @return the number of keys in this dictionary.
+ */
+ public synchronized int size() {
+ return size;
+ }
+
+ /**
+ * Tests if this dictionary maps no keys to value. The general contract
+ * for the <tt>isEmpty</tt> method is that the result is true if and only
+ * if this dictionary contains no entries.
+ *
+ * @return <code>true</code> if this dictionary maps no keys to values;
+ * <code>false</code> otherwise.
+ */
+ public synchronized boolean isEmpty() {
+ return size == 0;
+ }
+
+ /**
+ * Always throws UnsupportedOperationException.
+ *
+ * @param key header name.
+ * @param value header value.
+ * @throws UnsupportedOperationException
+ */
+ public synchronized Object put(Object key, Object value) {
+ if (readOnly)
+ throw new UnsupportedOperationException();
+ return set(key, value, true);
+ }
+
+ /**
+ * Always throws UnsupportedOperationException.
+ *
+ * @param key header name.
+ * @throws UnsupportedOperationException
+ */
+ public Object remove(Object key) {
+ throw new UnsupportedOperationException();
+ }
+
+ public String toString() {
+ return (values.toString());
+ }
+
+ public static Headers parseManifest(InputStream in) throws BundleException {
+ Headers headers = new Headers(10);
+ try {
+ ManifestElement.parseBundleManifest(in, headers);
+ } catch (IOException e) {
+ throw new BundleException("Error reading bundle manifest", e);
+ }
+ headers.setReadOnly();
+ return headers;
+ }
+
+ class ArrayEnumeration implements Enumeration {
+ private Object[] array;
+ int cur = 0;
+
+ public ArrayEnumeration(Object[] array, int size) {
+ this.array = new Object[size];
+ System.arraycopy(array, 0, this.array, 0, this.array.length);
+ }
+
+ public boolean hasMoreElements() {
+ return cur < array.length;
+ }
+
+ public Object nextElement() {
+ return array[cur++];
+ }
+ }
+
+ public synchronized void clear() {
+ if (readOnly)
+ throw new UnsupportedOperationException();
+ }
+
+ public synchronized boolean containsKey(Object key) {
+ return getIndex(key) >= 0;
+ }
+
+ public boolean containsValue(Object var0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Set entrySet() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Set keySet() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void putAll(Map var0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Collection values() {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/LogHelper.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/LogHelper.java
new file mode 100644
index 000000000..140a4fa1f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/LogHelper.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.helpers;
+
+import java.util.ArrayList;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.internal.prov.core.Activator;
+import org.eclipse.osgi.framework.log.FrameworkLog;
+import org.eclipse.osgi.framework.log.FrameworkLogEntry;
+
+public class LogHelper {
+
+ public static void log(IStatus status) {
+ FrameworkLog log = Activator.getFrameworkLog();
+ if (log != null) {
+ log.log(getLog(status));
+ } else {
+ System.out.println(status.getMessage());
+ if (status.getException() != null)
+ status.getException().printStackTrace();
+ }
+ }
+
+ /**
+ * Copied from PlatformLogWriter in core runtime.
+ */
+ private static FrameworkLogEntry getLog(IStatus status) {
+ Throwable t = status.getException();
+ ArrayList childlist = new ArrayList();
+
+ int stackCode = t instanceof CoreException ? 1 : 0;
+ // ensure a substatus inside a CoreException is properly logged
+ if (stackCode == 1) {
+ IStatus coreStatus = ((CoreException) t).getStatus();
+ if (coreStatus != null) {
+ childlist.add(getLog(coreStatus));
+ }
+ }
+
+ if (status.isMultiStatus()) {
+ IStatus[] children = status.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ childlist.add(getLog(children[i]));
+ }
+ }
+
+ FrameworkLogEntry[] children = (FrameworkLogEntry[]) (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()]));
+
+ return new FrameworkLogEntry(status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), stackCode, t, children);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/Messages.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/Messages.java
new file mode 100644
index 000000000..665375aab
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/Messages.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.helpers;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.equinox.prov.core.helpers.messages"; //$NON-NLS-1$
+
+ static {
+ // load message values from bundle file and assign to fields below
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ public static String Util_Invalid_Zip_File_Format;
+ public static String Util_Error_Unzipping;
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/MultiStatus.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/MultiStatus.java
new file mode 100644
index 000000000..0ae29073b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/MultiStatus.java
@@ -0,0 +1,258 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.helpers;
+
+import java.util.*;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+/**
+ * An variation of the MultiStatus. Note that this does not
+ * extend runtime.MultiStatus, instead it extends Status, because
+ * the purpose of this class is to avoid a few shortcomings of
+ * runtime.MultiStatus. This is different as follows:
+ * - Add only non-ok status as child (this prevents bloat).
+ * - Children is a list instead of an array; helps when add()
+ * is called more often than getChildren()
+ */
+public class MultiStatus extends Status {
+ public final static String bundleId = "org.eclipse.equinox.prov";
+ public static final int STATUS_CODE_SUCCESS = 0;
+
+ // Use ArrayList rather than List so ensureCapacity() is available.
+ private ArrayList children = null;
+
+ /**
+ * Uses the default code, STATUS_CODE_SUCCESS and an empty message.
+ * Either set the message later, or add this to another MultiStatus.
+ */
+ public MultiStatus() {
+ this(STATUS_CODE_SUCCESS, ""); //$NON-NLS-1$
+ }
+
+ /**
+ * Uses the default code, STATUS_CODE_SUCCESS.
+ * @param msg The status message.
+ */
+ public MultiStatus(String msg) {
+ this(STATUS_CODE_SUCCESS, msg);
+ }
+
+ /**
+ * A MultiStatus with one child.
+ */
+ public MultiStatus(String msg, IStatus child) {
+ this(msg);
+ add(child);
+ }
+
+ /**
+ * This provides a way to use a specific code to
+ * indicate whether this status has been 'touched'
+ * or not. This will differentiate "operation done
+ * and successful" from "operation was not done and
+ * successful" if code < STATUS_CODE_SUCCESS.
+ * @param code The status code.
+ * @param msg The status message.
+ */
+ public MultiStatus(int code, String msg) {
+ this(code, msg, null);
+ }
+
+ /**
+ * A Multi-Status with an exception.
+ */
+ public MultiStatus(int code, String msg, Throwable exception) {
+ this(code, msg, null, exception);
+ }
+
+ /**
+ * A Multi-Status with children.
+ */
+ public MultiStatus(int code, String msg, IStatus[] nested, Throwable exception) {
+ this(OK, bundleId, code, msg, nested, exception);
+ }
+
+ /**
+ * For creation from outside of the default plugin.
+ */
+ public MultiStatus(String pluginId, int code, String msg, Throwable exception) {
+ this(OK, pluginId, code, msg, null, exception);
+ }
+
+ /**
+ * For creation from outside of the default plugin and with children.
+ */
+ public MultiStatus(String pluginId, int code, IStatus[] nested, String msg, Throwable exception) {
+ this(OK, pluginId, code, msg, nested, exception);
+ }
+
+ /**
+ * A Multi-Status with everything.
+ */
+ public MultiStatus(int severity, String pluginId, int code, String msg, IStatus[] nested, Throwable exception) {
+ super(severity, pluginId, code, msg, exception);
+ if (nested != null && nested.length > 0) {
+ addAll(Arrays.asList(nested));
+ }
+ }
+
+ /**
+ * A new MultiStatus with no children, based on a Status.
+ */
+ public MultiStatus(Status status) {
+ super(status.getSeverity(), status.getPlugin(), status.getCode(), status.getMessage(), status.getException());
+ }
+
+ /**
+ * Does this status indicate an error or cancelation.
+ */
+ public boolean isErrorOrCancel() {
+ return matches(ERROR | CANCEL);
+ }
+
+ public void setCanceled() {
+ setSeverity(getSeverity() | CANCEL);
+ }
+
+ public void setMessage(String message) {
+ super.setMessage(message);
+ }
+
+ /**
+ * Adds the given status as a child. Even if child is a
+ * multi-status it is attached as a single child. This
+ * helps in creating a tree instead of a flat list.
+ * This guards against a null child. It will add the child
+ * to the children only if the child has a non-ok severity.
+ * @param child An IStatus object to be added as a child.
+ */
+ public void add(IStatus child) {
+ if (child == null)
+ return;
+ setCumulativeCode(child);
+ // Add only non-OK children
+ if (!child.isOK()) {
+ if (child.isMultiStatus() && child.getMessage().length() == 0) {
+ addAll(child); // no message at root so just add children
+ } else {
+ ensureExtraCapacity(1);
+ children.add(child);
+ }
+ setCumulativeSeverity(child);
+ }
+ }
+
+ /**
+ * Add a collection as children of this MultiStatus, using add().
+ */
+ public void addAll(Collection nested) {
+ ensureExtraCapacity(nested.size());
+ for (Iterator i = nested.iterator(); i.hasNext();) {
+ IStatus child = (IStatus) i.next();
+ add(child);
+ }
+ }
+
+ /**
+ * Adds the children of the given status as its own
+ * chldren. This internally uses add(IStatus). This
+ * guards against a null status.
+ * @param status A multi-status IStatus object whose children
+ * are to be added to this children.
+ */
+ public void addAll(IStatus status) {
+ if (status == null || !status.isMultiStatus()) {
+ add(status);
+ return;
+ }
+ IStatus[] nested = status.getChildren();
+ ensureExtraCapacity(nested.length);
+ for (int i = 0; i < nested.length; i++) {
+ add(nested[i]);
+ }
+ }
+
+ /*
+ * @see IStatus#getChildren()
+ */
+ public IStatus[] getChildren() {
+ IStatus[] result = new IStatus[children == null ? 0 : children.size()];
+ if (result.length > 0) {
+ children.toArray(result);
+ }
+ return result;
+ }
+
+ /*
+ * @see IStatus#isMultiStatus()
+ */
+ public boolean isMultiStatus() {
+ return true;
+ }
+
+ /**
+ * Collapses the children into a flat list.
+ * If all the children are non-multi-status,
+ * this is essentially getChildren().
+ * @return An array of IStatus objects.
+ * @see #getChildren()
+ */
+ public IStatus[] getLeaves() {
+ List leaves = MultiStatusUtil.getStatusLeaves(this);
+ IStatus[] result = new IStatus[leaves.size()];
+ leaves.toArray(result);
+ return result;
+ }
+
+ // Ensure we have space for count more children,
+ // allocate or extends as needed.
+ private void ensureExtraCapacity(int count) {
+ if (this.children == null) {
+ this.children = new ArrayList(count < 4 ? 4 : count);
+ } else {
+ this.children.ensureCapacity(this.children.size() + count);
+ }
+ }
+
+ private void setCumulativeSeverity(IStatus child) {
+ int childSeverity = child.getSeverity();
+ if (childSeverity > this.getSeverity()) {
+ this.setSeverity(childSeverity);
+ }
+ }
+
+ private void setCumulativeCode(IStatus child) {
+ int childCode = child.getCode();
+ if (childCode > this.getCode()) {
+ this.setCode(childCode);
+ }
+ }
+
+ // This implementation of getMessage causes problems: in add(IStatus) we test
+ // child.getMessage().length() == 0. This change prevents that from ever being the case.
+ // We want adding a MultiStatus with no message to be equivalent to adding its children.
+ // /**
+ // * If the message is empty, iterates through the children at the time of
+ // * invocation of this message and returns the first non-blank message
+ // * @return Message string
+ // */
+ // public String getMessage() {
+ // String msg = super.getMessage();
+ // if (this.children != null) {
+ // for (Iterator i = this.children.iterator(); msg.trim().length() == 0 && i.hasNext(); ) {
+ // IStatus status = (IStatus) i.next();
+ // msg = status.getMessage();
+ // }
+ // }
+ // return msg;
+ // }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/MultiStatusUtil.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/MultiStatusUtil.java
new file mode 100644
index 000000000..df63cd910
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/MultiStatusUtil.java
@@ -0,0 +1,244 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.helpers;
+
+import java.util.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.MultiStatus;
+
+public class MultiStatusUtil {
+
+ private MultiStatusUtil() {
+ // No instances, please.
+ }
+
+ /**
+ * Does the given status indicate an error or cancellation.
+ */
+ public static boolean isErrorOrCancel(IStatus status) {
+ return status.matches(IStatus.ERROR | IStatus.CANCEL);
+ }
+
+ public static List getStatusLeaves(IStatus root) {
+ ArrayList leaves = new ArrayList();
+ collectStatusLeaves(root, leaves);
+ leaves.trimToSize();
+ return leaves;
+ }
+
+ public static String getFailureMessage(IStatus status) {
+ final String msgSeparator = "; "; //$NON-NLS-1$
+ return getFailureMessage(status, msgSeparator);
+ }
+
+ public static String getFailureMessage(IStatus status, String msgSeparator) {
+ if (status.isMultiStatus()) {
+ StringBuffer sb = new StringBuffer(status.getMessage());
+ List failures = MultiStatusUtil.getStatusLeaves(status);
+ boolean hasNext = false;
+ if (!failures.isEmpty()) {
+ sb.append(msgSeparator);
+ hasNext = true;
+ }
+ for (Iterator it = failures.iterator(); hasNext;) {
+ IStatus failure = (IStatus) it.next();
+ sb.append(failure.getMessage());
+ hasNext = it.hasNext();
+ int lastIndex = sb.length() - 1;
+ if (hasNext) {
+ if (sb.charAt(lastIndex) == '.') {
+ sb.deleteCharAt(lastIndex);
+ }
+ sb.append(msgSeparator);
+ } else {
+ if (sb.charAt(lastIndex) != '.') {
+ sb.append('.');
+ }
+ }
+ }
+ return sb.toString();
+ } else
+ return status.getMessage();
+ }
+
+ public static List getStatusNodes(IStatus root) {
+ ArrayList nodes = new ArrayList();
+ collectStatusNodes(root, nodes);
+ nodes.trimToSize();
+ return nodes;
+ }
+
+ private static void collectStatusLeaves(IStatus root, List leaves) {
+ if (root.isMultiStatus()) {
+ IStatus[] children = root.getChildren();
+ if (children.length == 0) {
+ leaves.add(root);
+ } else {
+ for (int i = 0; i < children.length; i++) {
+ collectStatusLeaves(children[i], leaves);
+ }
+ }
+ } else {
+ leaves.add(root);
+ }
+ }
+
+ private static IStatus newNonMultiStatus(IStatus status) {
+ if (status.isMultiStatus())
+ return new Status(status.getSeverity(), status.getPlugin(), status.getCode(), status.getMessage(), status.getException());
+ else
+ return status;
+ }
+
+ private static void collectStatusNodes(IStatus root, List nodes) {
+ nodes.add(newNonMultiStatus(root));
+ if (root.isMultiStatus()) {
+ IStatus[] children = root.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ collectStatusNodes(children[i], nodes);
+ }
+ }
+ }
+
+ public static IStatus newFlattenedStatus(String pluginId, IStatus root, String msg) {
+ if (!root.isMultiStatus())
+ return root;
+ List leaves = MultiStatusUtil.getStatusLeaves(root);
+ if (leaves.isEmpty())
+ return root;
+ IStatus[] children = (IStatus[]) leaves.toArray(new IStatus[leaves.size()]);
+ return new MultiStatus(pluginId, root.getCode(), children, msg, null);
+ }
+
+ private static boolean hasFilteredStatus(IStatus status, IStatusFilter filter) {
+ if (filter.include(status))
+ return true;
+ if (!filter.considerChildren())
+ return false;
+ IStatus[] children = status.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ IStatus child = children[i];
+ if (hasFilteredStatus(child, filter))
+ return true;
+ }
+ return false;
+ }
+
+ public interface IStatusFilter {
+ boolean include(IStatus status);
+
+ boolean considerChildren();
+ }
+
+ public static IStatus newFilteredStatus(String message, IStatus status, IStatusFilter filter) {
+ if (!status.isMultiStatus())
+ return status;
+ LinkedList list = new LinkedList();
+ IStatus[] children = status.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ IStatus child = children[i];
+ if (hasFilteredStatus(child, filter)) {
+ list.add(child);
+ }
+ }
+ IStatus[] newChildren = (IStatus[]) list.toArray(new IStatus[list.size()]);
+
+ if (newChildren.length == 0)
+ return status;
+ return new MultiStatus(status.getPlugin(), status.getCode(), newChildren, message, status.getException());
+ }
+
+ public interface IStatusRecoder {
+ boolean needsRecoding(IStatus status);
+
+ /**
+ * Recodes the status.
+ * <p>
+ * The returned status will always be a copy even if
+ * no recoding was necessary. If the input is a multi
+ * status the returned status is also a MultiStatus,
+ * but it does not yet have any children.
+ *
+ * @param status
+ * @return the recoded status
+ */
+ IStatus recode(IStatus status);
+
+ IStatus recode(IStatus multiStatus, IStatus[] children);
+ }
+
+ private static boolean needsRecoding(IStatus status, IStatusRecoder recoder) {
+ if (!status.isMultiStatus())
+ return recoder.needsRecoding(status);
+ else {
+ if (recoder.needsRecoding(status))
+ return true;
+ IStatus[] children = status.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ IStatus child = children[i];
+ if (needsRecoding(child, recoder))
+ return true;
+ }
+ return false;
+ }
+ }
+
+ private static IStatus doSingleRecode(IStatus status, IStatusRecoder recoder) {
+ if (recoder.needsRecoding(status))
+ return recoder.recode(status);
+ return status;
+ }
+
+ private static IStatus doSingleRecode(IStatus status, IStatus[] recodedChildren, IStatusRecoder recoder) {
+ if (recoder.needsRecoding(status))
+ return recoder.recode(status, recodedChildren);
+ return new org.eclipse.core.runtime.MultiStatus(status.getPlugin(), status.getCode(), recodedChildren, status.getMessage(), status.getException());
+ }
+
+ private static IStatus doRecodeStatus(IStatus status, IStatusRecoder recoder) {
+ if (!status.isMultiStatus())
+ return doSingleRecode(status, recoder);
+ IStatus[] children = status.getChildren();
+ IStatus[] recodedChildren = new IStatus[children.length];
+ for (int i = 0; i < children.length; i++) {
+ IStatus child = children[i];
+ IStatus childRecoded = doRecodeStatus(child, recoder);
+ recodedChildren[i] = childRecoded;
+ }
+ IStatus recoded = doSingleRecode(status, recodedChildren, recoder);
+ return recoded;
+ }
+
+ public static IStatus recodeStatus(IStatus status, IStatusRecoder recoder) {
+ if (!needsRecoding(status, recoder))
+ return status;
+ return doRecodeStatus(status, recoder);
+ }
+
+ public static IStatus recodeLevel(IStatus status, final int severityMask, final int newSeverity) {
+ return recodeStatus(status, new IStatusRecoder() {
+
+ public boolean needsRecoding(IStatus s) {
+ return !s.isMultiStatus() && s.matches(severityMask);
+ }
+
+ public IStatus recode(IStatus s) {
+ return new Status(newSeverity, s.getPlugin(), s.getCode(), s.getMessage(), s.getException());
+ }
+
+ public IStatus recode(IStatus multiStatus, IStatus[] children) {
+ throw new AssertionError("should never be called"); //$NON-NLS-1$
+ }
+
+ });
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/OrderedProperties.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/OrderedProperties.java
new file mode 100644
index 000000000..d1f489960
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/OrderedProperties.java
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.prov.core.helpers;
+
+import java.util.*;
+
+/**
+ * A Properties collection that maintains the order of insertion.
+ * <p>
+ * This class is used to store properties similar to {@link java.util.Properties}.
+ * In particular both keys and values are strings and must be not null.
+ * However this class is somewhat simplified and does not implement Cloneable,
+ * Serializable and Hashtable.
+ * <p>
+ * In contrast to java.util.Properties this class maintains the order by which
+ * properties are added. This is implemented using a {@link LinkedHashMap}.
+ * <p>
+ * The class does not support default properties as they can be expressed by
+ * creating java.util.Properties hierarchies.
+ */
+public class OrderedProperties implements Map {
+
+ private LinkedHashMap propertyMap = null;
+
+ private static final String[] NO_KEYS = new String[0];
+
+ public OrderedProperties() {
+ super();
+ }
+
+ /**
+ * Set the property value.
+ * <p>
+ * If a property with the key already exists, the previous
+ * value is replaced. Otherwise a new property is added at
+ * the end collection.
+ *
+ * @param key must not be null
+ * @param value must not be null
+ * @return previous value associated with specified key, or <tt>null</tt>
+ * if there was no mapping for key.
+ */
+ public Object setProperty(String key, String value) {
+ init();
+ return propertyMap.put(key, value);
+ }
+
+ public String getProperty(String key) {
+ return (String) (propertyMap == null ? null : propertyMap.get(key));
+ }
+
+ public String getProperty(String key, String defaultValue) {
+ String value = getProperty(key);
+ return (value == null) ? defaultValue : value;
+ }
+
+ public void putAll(OrderedProperties properties) {
+ putAll((Map) properties);
+ }
+
+ public Collection getPropertyKeysCollection() {
+ if (propertyMap == null)
+ return Collections.EMPTY_LIST;
+ return Collections.unmodifiableCollection(propertyMap.keySet());
+ }
+
+ public String[] getPropertyKeys() {
+ if (propertyMap == null)
+ return NO_KEYS;
+ Collection keySet = propertyMap.keySet();
+ return (String[]) keySet.toArray(new String[keySet.size()]);
+ }
+
+ /**
+ * Initialize the map.
+ */
+ private void init() {
+ if (propertyMap == null) {
+ propertyMap = new LinkedHashMap();
+ }
+ }
+
+ public int size() {
+ return propertyMap == null ? 0 : propertyMap.size();
+ }
+
+ public boolean isEmpty() {
+ return propertyMap == null ? true : propertyMap.isEmpty();
+ }
+
+ public synchronized void clear() {
+ propertyMap = null;
+ }
+
+ public Object put(Object arg0, Object arg1) {
+ init();
+ return propertyMap.put(arg0, arg1);
+ }
+
+ public boolean containsKey(Object key) {
+ return propertyMap != null ? propertyMap.containsKey(key) : false;
+ }
+
+ public boolean containsValue(Object value) {
+ return propertyMap != null ? propertyMap.containsValue(value) : false;
+ }
+
+ public Set entrySet() {
+ return propertyMap != null ? propertyMap.entrySet() : Collections.EMPTY_SET;
+ }
+
+ public Object get(Object key) {
+ return propertyMap != null ? propertyMap.get(key) : null;
+ }
+
+ public Set keySet() {
+ return propertyMap != null ? propertyMap.keySet() : Collections.EMPTY_SET;
+ }
+
+ public void putAll(Map arg0) {
+ init();
+ propertyMap.putAll(arg0);
+ }
+
+ public Object remove(Object key) {
+ return propertyMap != null ? propertyMap.remove(key) : null;
+ }
+
+ public Collection values() {
+ return propertyMap != null ? propertyMap.values() : Collections.EMPTY_LIST;
+ }
+
+ public boolean equals(Object o) {
+ if (o == this)
+ return true;
+ if (o instanceof OrderedProperties) {
+ OrderedProperties rhs = (OrderedProperties) o;
+ if (rhs.propertyMap == this.propertyMap)
+ return true;
+ if (rhs.propertyMap == null || this.propertyMap == null)
+ return false;
+ return rhs.propertyMap.equals(this.propertyMap);
+ }
+ return propertyMap.equals(o);
+ }
+
+ public int hashCode() {
+ return propertyMap != null ? propertyMap.hashCode() : 0;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append(propertyMap);
+ return sb.toString();
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/ServiceHelper.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/ServiceHelper.java
new file mode 100644
index 000000000..da2e44b65
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/ServiceHelper.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.prov.core.helpers;
+
+import org.osgi.framework.*;
+
+public class ServiceHelper {
+ /**
+ * Returns the service described by the given arguments. Note that this is a helper class
+ * that <b>immediately</b> ungets the service reference. This results in a window where the
+ * system thinks the service is not in use but indeed the caller is about to use the returned
+ * service object.
+ * @param context
+ * @param name
+ * @return The requested service
+ */
+ public static Object getService(BundleContext context, String name) {
+ ServiceReference reference = context.getServiceReference(name);
+ if (reference == null)
+ return null;
+ Object result = context.getService(reference);
+ context.ungetService(reference);
+ return result;
+ }
+
+ public static Object getService(BundleContext context, String name, String filter) {
+ ServiceReference[] references;
+ try {
+ references = context.getServiceReferences(name, filter);
+ } catch (InvalidSyntaxException e) {
+ // TODO Auto-generated catch block
+ return null;
+ }
+ if (references == null || references.length == 0)
+ return null;
+ Object result = context.getService(references[0]);
+ context.ungetService(references[0]);
+ return result;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/TwoTierMap.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/TwoTierMap.java
new file mode 100644
index 000000000..0ab331da4
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/TwoTierMap.java
@@ -0,0 +1,354 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.helpers;
+
+import java.io.PrintStream;
+import java.io.Serializable;
+import java.util.*;
+
+/**
+ * The purpose of this class is to provide a two-tier map.
+ * MapOf(key1 => MapOf(key2 => value)).
+ * Even though this class implements Map the behavior of
+ * the methods aren't exactly the same as that of a real
+ * Map - especially, entrySet(), keySet() etc. works off
+ * the outer map while values() returns all the values of
+ * all the inner maps.
+ */
+public class TwoTierMap implements Map, Serializable {
+
+ private static final long serialVersionUID = 362497720873186265L;
+
+ private Map outerMap;
+ private int policy;
+
+ public static final int POLICY_NONE = 0, POLICY_BOTH_MAPS_PRESERVE_ORDERING = 1 << 0, POLICY_INNER_MAP_PRESERVE_EXISTING = 1 << 1, POLICY_INNER_MAP_SORTED_ASCENDING = 1 << 2, POLICY_INNER_MAP_SORTED_DESCENDING = 1 << 3, POLICY_INNER_MAP_ENSURE_SINGLETON = 1 << 4;
+
+ private static final int POLICY_INNER_MAP_SORTED_MASK = POLICY_INNER_MAP_SORTED_ASCENDING | POLICY_INNER_MAP_SORTED_DESCENDING;
+
+ public TwoTierMap() {
+ this(8, POLICY_NONE);
+ }
+
+ public TwoTierMap(int initialCapacity) {
+ this(initialCapacity, POLICY_NONE);
+ }
+
+ /**
+ * Creates a two-tier map with the specified
+ * initialCapacity and policy. The policy determines
+ * whether the outer map is ordered, inner map is
+ * sorted, clobber values of inner map etc.
+ */
+ public TwoTierMap(int initialCapacity, int policy) {
+ this.policy = policy;
+ this.outerMap = shouldUseOrderedMap() ? new LinkedHashMap(initialCapacity) : new HashMap(initialCapacity);
+ }
+
+ /**
+ * Insert the value with key key1 into the inner map
+ * that is obtained from the outer map with key key2.
+ * If you have set POLICY_INNER_MAP_PRESERVE_EXISTING
+ * at the time of creating this, it will not overwrite
+ * if there is already a non-null value at key2.
+ * The other POLICY_INNER_MAP_* policies determine
+ * what kind of inner map is created.
+ * @param key1 The key for outer map.
+ * @param key2 The key for inner map.
+ * @param value The value.
+ * @return Existing value if any, otherwise null.
+ */
+ public Object put(Object key1, Object key2, Object value) {
+ Map innerMap = (Map) this.outerMap.get(key1);
+ if (innerMap == null) {
+ if (shouldUseSingletonInnerMap()) {
+ this.outerMap.put(key1, Collections.singletonMap(key2, value));
+ return null;
+ }
+ innerMap = createInnerMap();
+ this.outerMap.put(key1, innerMap);
+ }
+ // It is faster to check for already existing entry
+ // this way instead of containsKey() check. Of course,
+ // this will prevent us from recognizing a null entry,
+ // which I think shouldn't be a problem.
+ Object existing = innerMap.put(key2, value);
+ if (existing != null && shouldPreserveExisting()) {
+ innerMap.put(key2, existing);
+ }
+ return existing;
+ }
+
+ /**
+ * Get the object stored in the inner map using key2
+ * as key where the inner map is obtained from the
+ * outer map using key1.
+ * @param key1 The key for outer map.
+ * @param key2 The key for inner map.
+ * @return The object for key2 in inner map for key1
+ * in the outer map.
+ */
+ public Object get(Object key1, Object key2) {
+ if (key1 == null || key2 == null)
+ return getAll(key1);
+ Map innerMap = (Map) this.outerMap.get(key1);
+ Object value = innerMap == null ? null : innerMap.get(key2);
+ return value;
+ }
+
+ /**
+ * Get all the values in the inner map for key1 in
+ * the outer map.
+ * @param key1 The key for outer map.
+ * @return Collection of values in the inner map.
+ */
+ public Collection getAll(Object key1) {
+ if (key1 == null)
+ // return all
+ return values();
+ Map innerMap = (Map) this.outerMap.get(key1);
+ return innerMap == null ? Collections.EMPTY_LIST : Collections.unmodifiableCollection(innerMap.values());
+
+ }
+
+ public Object remove(Object key1, Object key2) {
+ if (key1 == null || key2 == null)
+ return removeAll(key1);
+ Map innerMap = (Map) this.outerMap.get(key1);
+ if (innerMap == null)
+ return null;
+ if (shouldUseSingletonInnerMap()) {
+ Object result = innerMap.get(key2);
+ if (result != null) {
+ this.outerMap.remove(key1);
+ }
+ return result;
+ }
+ Object result = (innerMap == null) ? null : innerMap.remove(key2);
+ if (result != null && innerMap.isEmpty()) {
+ this.outerMap.remove(key1);
+ }
+ return result;
+ }
+
+ public Collection removeAll(Object key1) {
+ if (key1 == null)
+ return Collections.EMPTY_LIST;
+ Map innerMap = (Map) this.outerMap.remove(key1);
+ return innerMap == null ? Collections.EMPTY_LIST : innerMap.values();
+ }
+
+ /**
+ * Determine whether there exists a valid object for
+ * key2 in the inner map for key1 in the outer map.
+ * @param key1 The key for outer map.
+ * @param key2 The key for inner map.
+ * @return true if a non-null object exists; otherwise
+ * false.
+ */
+ public boolean containsKey(Object key1, Object key2) {
+ if (key1 == null)
+ return false;
+ if (key2 == null)
+ return containsKey(key1);
+ return get(key1, key2) != null;
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Map#clear()
+ */
+ public void clear() {
+ this.outerMap.clear();
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Map#containsKey(java.lang.Object)
+ */
+ public boolean containsKey(Object key) {
+ return this.outerMap.containsKey(key);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Map#containsValue(java.lang.Object)
+ */
+ public boolean containsValue(Object value) {
+ for (Iterator it = entrySet().iterator(); it.hasNext();) {
+ Map.Entry entry = (Map.Entry) it.next();
+ Map innerMap = (Map) entry.getValue();
+ if (innerMap.containsValue(value))
+ return true;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Map#size()
+ */
+ public int size() {
+ return this.outerMap.size();
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Map#isEmpty()
+ */
+ public boolean isEmpty() {
+ return this.size() == 0;
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Map#entrySet()
+ */
+ public Set entrySet() {
+ return Collections.unmodifiableSet(this.outerMap.entrySet());
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Map#values()
+ */
+ public Collection values() {
+ ArrayList result = new ArrayList(size());
+ for (Iterator it = this.outerMap.keySet().iterator(); it.hasNext();) {
+ Object key = it.next();
+ // A null key will cause infinite recursion!
+ if (key != null) {
+ result.addAll(getAll(key));
+ }
+ }
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Map#get(java.lang.Object)
+ */
+ public Object get(Object key) {
+ if (key instanceof Object[]) {
+ Object[] keys = (Object[]) key;
+ return get(keys[0], keys[1]);
+ } else
+ return getAll(key);
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Map#keySet()
+ */
+ public Set keySet() {
+ return Collections.unmodifiableSet(this.outerMap.keySet());
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Map#put(java.lang.Object, java.lang.Object)
+ */
+ public Object put(Object key, Object value) {
+ if (key instanceof Object[]) {
+ Object[] keys = (Object[]) key;
+ return put(keys[0], keys[1], value);
+ }
+ throw new IllegalArgumentException("First arg should be an array!"); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Map#putAll(java.util.Map)
+ */
+ public void putAll(Map t) {
+ throw new UnsupportedOperationException();
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Map#remove(java.lang.Object)
+ */
+ public Object remove(Object key) {
+ if (key instanceof Object[]) {
+ Object[] keys = (Object[]) key;
+ return remove(keys[0], keys[1]);
+ } else
+ return removeAll(key);
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ if (this.outerMap.isEmpty()) {
+ sb.append(" (Empty)"); //$NON-NLS-1$
+ } else {
+ for (Iterator it = this.outerMap.entrySet().iterator(); it.hasNext();) {
+ Map.Entry entry = (Map.Entry) it.next();
+ sb.append(" ").append(entry.getKey()) //$NON-NLS-1$
+ .append(" = ") //$NON-NLS-1$
+ .append(entry.getValue()).append('\n');
+ }
+ sb.setLength(sb.length() - 1);
+ }
+ return sb.toString();
+ }
+
+ public void dump(PrintStream ps) {
+ if (ps == null) {
+ ps = System.out;
+ }
+ ps.println(this.toString());
+ }
+
+ private Map createInnerMap() {
+ Map innerMap;
+ if (shouldUseSortedInnerMap()) {
+ innerMap = new TreeMap(new ValueComparator(shouldSortInAscendingOrder()));
+ } else if (shouldUseOrderedMap()) {
+ innerMap = new LinkedHashMap(2);
+ } else {
+ innerMap = new HashMap(2);
+ }
+ return innerMap;
+ }
+
+ private boolean shouldPreserveExisting() {
+ return (this.policy & POLICY_INNER_MAP_PRESERVE_EXISTING) == POLICY_INNER_MAP_PRESERVE_EXISTING;
+ }
+
+ private boolean shouldUseOrderedMap() {
+ return (this.policy & POLICY_BOTH_MAPS_PRESERVE_ORDERING) == POLICY_BOTH_MAPS_PRESERVE_ORDERING;
+ }
+
+ private boolean shouldUseSortedInnerMap() {
+ return (this.policy & POLICY_INNER_MAP_SORTED_MASK) != 0;
+ }
+
+ private boolean shouldSortInAscendingOrder() {
+ return (this.policy & POLICY_INNER_MAP_SORTED_MASK) == POLICY_INNER_MAP_SORTED_ASCENDING;
+ }
+
+ private boolean shouldUseSingletonInnerMap() {
+ return (this.policy & POLICY_INNER_MAP_ENSURE_SINGLETON) == POLICY_INNER_MAP_ENSURE_SINGLETON;
+ }
+
+ private static class ValueComparator implements Comparator, Serializable {
+ private static final long serialVersionUID = 362497720873186266L;
+ private boolean ascending;
+
+ public ValueComparator(boolean ascending) {
+ this.ascending = ascending;
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+ */
+ public int compare(Object o1, Object o2) {
+ try {
+ if (o1 instanceof Comparable) {
+ int cmp = ((Comparable) o1).compareTo(o2);
+ return this.ascending ? cmp : (0 - cmp);
+ }
+ } catch (Exception e) {
+ // Ignore
+ }
+ return 1;
+ }
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/UnmodifiableProperties.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/UnmodifiableProperties.java
new file mode 100644
index 000000000..7b220d45d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/UnmodifiableProperties.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.prov.core.helpers;
+
+import java.util.Iterator;
+import java.util.Map;
+
+public class UnmodifiableProperties extends OrderedProperties {
+
+ public UnmodifiableProperties(OrderedProperties properties) {
+ super();
+ for (Iterator iter = properties.entrySet().iterator(); iter.hasNext();) {
+ Map.Entry entry = (Map.Entry) iter.next();
+ super.put(entry.getKey(), entry.getValue());
+ }
+ }
+
+ public synchronized Object setProperty(String key, String value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public synchronized Object put(Object key, Object value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public synchronized Object remove(Object key) {
+ throw new UnsupportedOperationException();
+ }
+
+ public synchronized void putAll(Map t) {
+ throw new UnsupportedOperationException();
+ }
+
+ public synchronized void clear() {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/Utils.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/Utils.java
new file mode 100644
index 000000000..02c1c7ede
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/Utils.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.helpers;
+
+import java.io.File;
+import java.net.URL;
+
+public class Utils {
+ /*
+ * Compares two URL for equality
+ * Return false if one of them is null
+ */
+ public static boolean sameURL(URL url1, URL url2) {
+
+ if (url1 == null || url2 == null)
+ return false;
+ if (url1 == url2)
+ return true;
+ if (url1.equals(url2))
+ return true;
+
+ // check if URL are file: URL as we may
+ // have 2 URL pointing to the same featureReference
+ // but with different representation
+ // (i.e. file:/C;/ and file:C:/)
+ if (!"file".equalsIgnoreCase(url1.getProtocol())) //$NON-NLS-1$
+ return false;
+ if (!"file".equalsIgnoreCase(url2.getProtocol())) //$NON-NLS-1$
+ return false;
+
+ File file1 = getFileFor(url1);//new File(url1.getFile());
+ File file2 = getFileFor(url2);
+
+ if (file1 == null)
+ return false;
+
+ return (file1.equals(file2));
+ }
+
+ /*
+ * Method getFileFor.
+ * @param url1
+ * @return File
+ */
+ private static File getFileFor(URL url1) {
+ return new File(url1.getFile());
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/messages.properties b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/messages.properties
new file mode 100644
index 000000000..a5294426c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/helpers/messages.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+
+Util_Invalid_Zip_File_Format=Invalid zip file format
+Util_Error_Unzipping=Error unzipping {0}: {1}
+
+
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/location/AgentLocation.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/location/AgentLocation.java
new file mode 100644
index 000000000..809826915
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/location/AgentLocation.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.location;
+
+import java.net.URL;
+import org.eclipse.osgi.service.datalocation.Location;
+
+/**
+ * TODO: We are not allowed to extend Location because it's not intended
+ * to be implemented by clients.
+ */
+public interface AgentLocation extends Location {
+
+ public URL getArtifactRepositoryURL();
+
+ public URL getMetadataRepositoryURL();
+
+ public URL getTouchpointDataArea(String touchpointId);
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/AbstractRepository.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/AbstractRepository.java
new file mode 100644
index 000000000..fed3e032e
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/AbstractRepository.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.repository;
+
+import java.net.URL;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.equinox.prov.core.helpers.OrderedProperties;
+import org.eclipse.equinox.prov.core.helpers.UnmodifiableProperties;
+
+/**
+* AbstractRepository defines common properties that may be provided by various kinds
+* of repositories.
+* <p>
+* Clients may extend this class.
+* </p>
+* TODO: Do we want additional properties - time zone, copyrights, security etc..
+*/
+
+public abstract class AbstractRepository extends PlatformObject {
+
+ protected String name;
+ protected String type;
+ protected String version;
+ protected String description;
+ protected String provider;
+ // TODO make sure that this is transiaent. NO point in storing the location in the repo itself.
+ protected URL location;
+ protected OrderedProperties properties = new OrderedProperties();
+
+ protected AbstractRepository(String name, String type, String version, URL location) {
+ this.name = name;
+ this.type = type;
+ this.version = version;
+ this.description = ""; //$NON-NLS-1$
+ this.provider = ""; //$NON-NLS-1$
+ this.location = location;
+ }
+
+ protected AbstractRepository(String name, String type, String version, URL location, String description, String provider) {
+ this(name, type, version, location);
+ this.description = description;
+ this.provider = provider;
+ }
+
+ /**
+ * Returns the name of the repository.
+ * @return the name of the repository.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Returns a string representing the type of the repository.
+ * @return the type of the repository.
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Returns a string representing the version for the repository type.
+ * @return the version of the type of the repository.
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Returns the location of this repository.
+ * TODO: Should we use URL or URI? URL requires a protocol handler
+ * to be installed in Java. Can the URL have any protocol?
+ * @return the URL of the repository.
+ */
+ public URL getLocation() {
+ return location;
+ }
+
+ /**
+ * Returns a brief description of the repository.
+ * @return the description of the repository.
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Returns the name of the provider of the repository.
+ * @return the provider of this repository.
+ */
+ public String getProvider() {
+ return provider;
+ }
+
+ /**
+ * Returns a read-only collection of the properties of the repository.
+ * @return the properties of this repository.
+ */
+ public UnmodifiableProperties getProperties() {
+ return new UnmodifiableProperties(properties);
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/IRepositoryInfo.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/IRepositoryInfo.java
new file mode 100644
index 000000000..a63b3fc8b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/IRepositoryInfo.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.repository;
+
+import java.net.URL;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.equinox.prov.core.helpers.UnmodifiableProperties;
+
+/**
+ * IRepositoryInfo defines common properties that may be provided by various kinds
+ * of repositories.
+ * <p>
+ * Clients may implement this interface.
+ * </p>
+ * TODO: This should be an abstract class so methods can be added in the future
+ * without breaking clients.
+ * TODO: Do we want additional properties - time zone, copyrights, security etc..
+ */
+public interface IRepositoryInfo extends IAdaptable {
+
+ /**
+ * Returns the URL of the repository.
+ * TODO: Should we use URL or URI? URL requires a protocol handler
+ * to be installed in Java. Can the URL have any protocol?
+ * @return the URL of the repository.
+ */
+ public URL getLocation();
+
+ /**
+ * Returns the name of the repository.
+ * @return the name of the repository.
+ */
+ public String getName();
+
+ /**
+ * Returns a string representing the type of the repository.
+ * @return the type of the repository.
+ */
+ public String getType();
+
+ /**
+ * Returns a string representing the version for the repository type.
+ * @return the version of the type of the repository.
+ */
+ public String getVersion();
+
+ /**
+ * Returns a brief description of the repository.
+ * @return the description of the repository.
+ */
+ public String getDescription();
+
+ /**
+ * Returns the name of the provider of the repository.
+ * @return the provider of this repository.
+ */
+ public String getProvider();
+
+ /**
+ * Returns a read-only collection of the properties of the repository.
+ * @return the properties of this repository.
+ */
+ public UnmodifiableProperties getProperties();
+
+ /**
+ * Definitions of common property keys
+ */
+
+ // The property key for a boolean property indicating that the repository
+ // is an implementation detail, not subject to general access, hidden
+ // from the typical user, etc.
+ static public String IMPLEMENTATION_ONLY_KEY = "implementationOnly"; //$NON-NLS-1$
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/IWritableRepositoryInfo.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/IWritableRepositoryInfo.java
new file mode 100644
index 000000000..895435165
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/IWritableRepositoryInfo.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.repository;
+
+import org.eclipse.equinox.prov.core.helpers.OrderedProperties;
+
+/**
+ * IWritableRepositoryInfo provides setters for common properties of various kinds
+ * of repositories.
+ * <p>
+ * Clients may implement this interface.
+ */
+public interface IWritableRepositoryInfo extends IRepositoryInfo {
+
+ /**
+ * Set the name of the repository.
+ */
+ public void setName(String name);
+
+ /**
+ * Set the type of the repository.
+ */
+ // TODO remove this method
+ public void setType(String type);
+
+ /**
+ * Set the string representing the version for the repository type.
+ */
+ // TODO and likely this method too
+ public void setVersion(String version);
+
+ /**
+ * Returns a brief description of the repository.
+ */
+ public void setDescription(String description);
+
+ /**
+ * Set the name of the provider of the repository.
+ */
+ public void setProvider(String provider);
+
+ /**
+ * Returns the modifiable collection of the properties of the repository.
+ * @return the properties of this repository.
+ */
+ public OrderedProperties getModifiableProperties();
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/RepositoryCreationException.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/RepositoryCreationException.java
new file mode 100644
index 000000000..87db53e90
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/prov/core/repository/RepositoryCreationException.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.prov.core.repository;
+
+public class RepositoryCreationException extends Exception {
+
+ private static final long serialVersionUID = -5648382121963317100L;
+
+ public RepositoryCreationException(Throwable e) {
+ super(e);
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.director.app/.classpath b/bundles/org.eclipse.equinox.p2.director.app/.classpath
new file mode 100644
index 000000000..ce0c7a5d4
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.0%Foundation-1.0"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.director.app/.cvsignore b/bundles/org.eclipse.equinox.p2.director.app/.cvsignore
new file mode 100644
index 000000000..c5e82d745
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/.cvsignore
@@ -0,0 +1 @@
+bin \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.director.app/.project b/bundles/org.eclipse.equinox.p2.director.app/.project
new file mode 100644
index 000000000..a1bda4f8f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.equinox.prov.director.app</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.p2.director.app/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.director.app/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..78523cd05
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,331 @@
+#Thu Aug 16 11:00:59 EDT 2007
+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.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.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=error
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+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.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+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.unsafeTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+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.p2.director.app/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.p2.director.app/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..03102cb3f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+#Sun Sep 23 11:57:58 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.p2.director.app/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..332a4197a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Equinox Provisioning Director Application Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.equinox.prov.director.app;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Import-Package: org.eclipse.equinox.app,
+ org.eclipse.equinox.internal.prov.console,
+ org.eclipse.equinox.prov.artifact.repository,
+ org.eclipse.equinox.prov.core.helpers,
+ org.eclipse.equinox.prov.core.location,
+ org.eclipse.equinox.prov.director,
+ org.eclipse.equinox.prov.engine,
+ org.eclipse.equinox.prov.metadata,
+ org.eclipse.equinox.prov.metadata.repository,
+ org.eclipse.equinox.prov.query,
+ org.eclipse.osgi.service.environment,
+ org.eclipse.osgi.service.resolver;version="1.1.0",
+ org.osgi.framework
+Bundle-Activator: org.eclipse.equinox.prov.internal.director.app.Activator
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0,
+ J2SE-1.4
+Require-Bundle: org.eclipse.equinox.common
diff --git a/bundles/org.eclipse.equinox.p2.director.app/build.properties b/bundles/org.eclipse.equinox.p2.director.app/build.properties
new file mode 100644
index 000000000..e2356b946
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/bundles/org.eclipse.equinox.p2.director.app/config.ini b/bundles/org.eclipse.equinox.p2.director.app/config.ini
new file mode 100644
index 000000000..c0024e787
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/config.ini
@@ -0,0 +1,87 @@
+# Eclipse runtime configuration file
+# This file contains a number of key/value pairs that are merged into the
+# System properties on system startup. The values control the way the
+# runtime is structured and runs.
+
+# Note: Only platform:/base/ and file: URLs are supported. In general the
+# URLs given may include a version number (e.g., .../location_1.2.3).
+# If a version is not specified, the system binds
+# to the location which matches exactly or to the versioned location with the
+# latest version number. If a version number is given then only exact matches
+# are considered.
+
+# The URL for the runtime entry point. The default value is
+# platform:/base/plugins/org.eclipse.osgi
+#osgi.framework=platform:/base/plugins/org.eclipse.osgi
+
+# The classpath for the framework found at the osgi.framework location. This
+# comma-separated list contains either URLs or simple element names. Simple
+# names are assumed to be relative to the framework's install directory.
+# Typically this value need not be set as it is initialized by the framework itself.
+# Version match searching is not done for URLs listed here.
+#osgi.frameworkClassPath =
+
+# The comma-separated list of locations to search for the splash screen file (splash.bmp).
+# For each list element a subdirectory structure based on the pattern nl/<locale> is searched.
+# The system binds to the first matching file. There is no default value.
+#osgi.splashPath=
+
+# The location of the splash screen file. If this value is set at system startup it is used
+# in favour of the osgi.splashPath searching outlined above. If the value is not set
+# the searching is done and this key is bound to the result of the search.
+#osgi.splashLocation =
+
+# The comma-separated list of bundles which are automatically installed and optionally started
+# once the system is up and running. Each entry if of the form
+# <URL | simple bundle location>[@ [<startlevel>] [":start"]]
+# If the startlevel is omitted then the framework will use the default start level for the bundle.
+# If the "start" tag is added then the bundle will be marked as started after being installed.
+# Simple bundle locations are interepreted as relative to the framework's parent directory.
+# The startlevel indicates the OSGi start level at which the bundle should run.
+osgi.bundles=\
+ com.thoughtworks.xstream,\
+ org.eclipse.core.jobs,\
+ org.eclipse.ecf,\
+ org.eclipse.ecf.filetransfer,\
+ org.eclipse.ecf.identity,\
+ org.eclipse.ecf.provider.filetransfer,\
+ org.eclipse.equinox.app@start,\
+ org.eclipse.equinox.common,\
+ org.eclipse.equinox.frameworkadmin,\
+ org.eclipse.equinox.frameworkadmin.equinox@start,\
+ org.eclipse.equinox.prov.artifact.repository,\
+ org.eclipse.equinox.prov.console,\
+ org.eclipse.equinox.prov.core,\
+ org.eclipse.equinox.prov.director,\
+ org.eclipse.equinox.prov.director.app,\
+ org.eclipse.equinox.prov.download,\
+ org.eclipse.equinox.prov.engine,\
+ org.eclipse.equinox.prov.examplarysetup@start,\
+ org.eclipse.equinox.prov.metadata,\
+ org.eclipse.equinox.prov.metadata.repository,\
+ org.eclipse.equinox.prov.operations,\
+ org.eclipse.equinox.prov.touchpoint.eclipse,\
+ org.eclipse.equinox.prov.touchpoint.natives,\
+ org.eclipse.equinox.registry,\
+ org.eclipse.equinox.simpleconfigurator,\
+ org.eclipse.equinox.simpleconfigurator.manipulator@start,\
+ org.eclipse.osgi.services,\
+ org.mozilla.rhino
+
+org.eclipse.update.reconcile=false
+
+# The product to run. A given Eclipse configuration may contain many products.
+# The product identified will supply the branding (window icons, title bar text) etc
+# as well as define the default application to run.
+#eclipse.product=
+
+# The application to run. The value specified here is the id of the application extension
+# the runtime will find, instantiate and execute once the system is up. Note that typically
+# the identified eclipse.product defines the default application to run.
+#eclipse.application=
+
+# The build identifier
+eclipse.buildId=@build@
+
+# End of file marker - must be here
+eof=eof \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.director.app/director app.launch b/bundles/org.eclipse.equinox.p2.director.app/director app.launch
new file mode 100644
index 000000000..1e149412a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/director app.launch
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="automaticAdd" value="false"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/director app"/>
+<booleanAttribute key="default_auto_start" value="false"/>
+<intAttribute key="default_start_level" value="4"/>
+<booleanAttribute key="includeOptional" value="false"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-console -consolelog -application org.eclipse.equinox.prov.director.app.application&#13;&#10;-metadataRepository file:d:/tmp/equinox.prov/servers/metadataRepository/ &#13;&#10;-artifactRepository file:d:/tmp/equinox.prov/servers/artifactRepository/ &#13;&#10;-installIU sdk&#13;&#10;-destination d:/tmp/equinox.prov/eclipseApp&#13;&#10;-flavor tooling&#13;&#10;-profile foo"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.prov.data.area=d:/tmp/equinox.prov/agentData"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="target_bundles" value="org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime@default:default,org.eclipse.core.runtime.compatibility.registry@default:default,org.eclipse.equinox.app@default:true,org.eclipse.equinox.common@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.osgi@:,org.eclipse.osgi.services@default:default"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<stringAttribute key="vminstall" value="ibm1.5sr1"/>
+<stringAttribute key="workspace_bundles" value="com.thoughtworks.xstream@default:default,org.eclipse.ecf@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:true,org.eclipse.equinox.prov.artifact.repository@default:default,org.eclipse.equinox.prov.console@default:default,org.eclipse.equinox.prov.core@default:default,org.eclipse.equinox.prov.director@default:default,org.eclipse.equinox.prov.director.app@default:default,org.eclipse.equinox.prov.download@default:default,org.eclipse.equinox.prov.engine@default:default,org.eclipse.equinox.prov.examplarysetup@default:true,org.eclipse.equinox.prov.metadata@default:default,org.eclipse.equinox.prov.metadata.repository@default:default,org.eclipse.equinox.prov.touchpoint.eclipse@default:default,org.eclipse.equinox.prov.touchpoint.natives@default:default,org.eclipse.equinox.simpleconfigurator@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:true,org.eclipse.osgi@:,org.mozilla.rhino@default:default"/>
+</launchConfiguration>
diff --git a/bundles/org.eclipse.equinox.p2.director.app/director.product b/bundles/org.eclipse.equinox.p2.director.app/director.product
new file mode 100644
index 000000000..da518df4c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/director.product
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.1"?>
+
+<product name="Equinox Provisioning Director" id="org.eclipse.equinox.prov.director.app.product" application="org.eclipse.equinox.prov.director.app.application" useFeatures="true">
+
+ <configIni use="custom" path="/org.eclipse.equinox.prov.director.app/config.ini"/>
+
+ <launcherArgs>
+ <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+ </launcherArgs>
+
+ <launcher name="eclipse">
+ <solaris/>
+ <win useIco="false">
+ <bmp/>
+ </win>
+ </launcher>
+
+ <vm>
+ </vm>
+
+ <plugins>
+ </plugins>
+
+ <features>
+ <feature id="org.eclipse.equinox.prov.director.feature" version="0.0.0"/>
+ <feature id="org.eclipse.rcp" version="0.0.0"/>
+ </features>
+
+</product>
diff --git a/bundles/org.eclipse.equinox.p2.director.app/plugin.xml b/bundles/org.eclipse.equinox.p2.director.app/plugin.xml
new file mode 100644
index 000000000..e1149a15c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/plugin.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension id="application" point="org.eclipse.core.runtime.applications">
+ <application>
+ <run class="org.eclipse.equinox.prov.internal.director.app.Application"/>
+ </application>
+ </extension>
+ <extension
+ id="product"
+ point="org.eclipse.core.runtime.products">
+ <product
+ application="org.eclipse.equinox.prov.director.app.application"
+ name="Equinox Provisioning Director">
+ </product>
+ </extension>
+
+</plugin>
diff --git a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/prov/internal/director/app/Activator.java b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/prov/internal/director/app/Activator.java
new file mode 100644
index 000000000..d87fe4da6
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/prov/internal/director/app/Activator.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.prov.internal.director.app;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @since 3.3
+ */
+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;
+ }
+
+ public static BundleContext getContext() {
+ return bundleContext;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/prov/internal/director/app/Application.java b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/prov/internal/director/app/Application.java
new file mode 100644
index 000000000..cb13a593c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/prov/internal/director/app/Application.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.prov.internal.director.app;
+
+import java.net.URL;
+import java.util.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.equinox.internal.prov.console.ProvisioningHelper;
+import org.eclipse.equinox.prov.core.helpers.LogHelper;
+import org.eclipse.equinox.prov.core.helpers.ServiceHelper;
+import org.eclipse.equinox.prov.director.IDirector;
+import org.eclipse.equinox.prov.engine.Profile;
+import org.eclipse.equinox.prov.metadata.IInstallableUnit;
+import org.eclipse.equinox.prov.metadata.repository.IMetadataRepository;
+import org.eclipse.equinox.prov.query.IQueryable;
+import org.eclipse.equinox.prov.query.Query;
+import org.eclipse.osgi.service.resolver.VersionRange;
+import org.osgi.framework.Version;
+
+/**
+ * @since 3.3
+ */
+public class Application implements IApplication {
+
+ private String destination;
+ private URL artifactRepositoryLocation;
+ private URL metadataRepositoryLocation;
+ private String root;
+ private String flavor;
+ private String profileId;
+ private boolean install;
+ private String bundlePool = null;
+ private String nl;
+ private String os;
+ private String arch;
+ private String ws;
+ private boolean roamingProfile = false;
+ private Version version = null;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
+ */
+ public Object start(IApplicationContext context) throws Exception {
+ Map args = context.getArguments();
+ initializeFromArguments((String[]) args.get("application.args"));
+
+ Properties props = new Properties();
+ props.setProperty(Profile.PROP_INSTALL_FOLDER, destination);
+ props.setProperty(Profile.PROP_FLAVOR, flavor);
+ if (bundlePool != null)
+ if (bundlePool.equals("<destination>"))
+ props.setProperty("eclipse.prov.cache", destination);
+ else
+ props.setProperty("eclipse.prov.cache", bundlePool);
+ if (roamingProfile)
+ props.setProperty("eclipse.prov.roaming", "true");
+
+ String env = getEnvironmentProperty();
+ if (env != null)
+ props.setProperty(Profile.PROP_ENVIRONMENTS, env);
+ Profile profile = ProvisioningHelper.addProfile(profileId, props);
+ String currentFlavor = profile.getValue(Profile.PROP_FLAVOR);
+ if (currentFlavor != null && !currentFlavor.endsWith(flavor))
+ throw new RuntimeException("Install flavor not consistent with profile flavor");
+
+ IDirector director = (IDirector) ServiceHelper.getService(Activator.getContext(), IDirector.class.getName());
+ if (director == null)
+ throw new RuntimeException("Director could not be loaded");
+ ProvisioningHelper.addArtifactRepository(artifactRepositoryLocation);
+ IMetadataRepository metadataRepository = ProvisioningHelper.addMetadataRepository(metadataRepositoryLocation);
+ IInstallableUnit[] roots = Query.query(new IQueryable[] {metadataRepository}, root, version == null ? null : new VersionRange(version, true, version, true), null, false, null);
+ IStatus operationStatus = null;
+ if (roots.length > 0) {
+ if (install) {
+ operationStatus = director.install(roots, profile, null, new NullProgressMonitor());
+ } else {
+ operationStatus = director.uninstall(roots, profile, new NullProgressMonitor());
+ }
+ } else {
+ operationStatus = new Status(IStatus.INFO, "org.eclipse.equinox.prov.director.test", "The installable unit '" + root + "' has not been found");
+ }
+
+ if (operationStatus.isOK()) {
+ System.out.println((install ? "installation" : "uninstallation") + " complete");
+ } else {
+ System.out.println((install ? "installation" : "uninstallation") + " failed. " + operationStatus);
+ LogHelper.log(operationStatus);
+ }
+ return null;
+ }
+
+ public void stop() {
+ }
+
+ public void initializeFromArguments(String[] args) throws Exception {
+ if (args == null)
+ return;
+ for (int i = 0; i < args.length; i++) {
+
+ if (args[i].equals("-roaming")) {
+ roamingProfile = true;
+ }
+
+ // check for args without parameters (i.e., a flag arg)
+
+ // check for args with parameters. If we are at the last
+ // argument or
+ // if the next one
+ // has a '-' as the first character, then we can't have an arg
+ // with
+ // a parm so continue.
+ if (i == args.length - 1 || args[i + 1].startsWith("-")) //$NON-NLS-1$
+ continue;
+
+ String arg = args[++i];
+
+ if (args[i - 1].equalsIgnoreCase("-profile"))
+ profileId = arg;
+
+ if (args[i - 1].equalsIgnoreCase("-destination") || args[i - 1].equalsIgnoreCase("-dest"))
+ destination = arg;
+
+ if (args[i - 1].equalsIgnoreCase("-bundlepool") || args[i - 1].equalsIgnoreCase("-bp"))
+ bundlePool = arg;
+
+ if (args[i - 1].equalsIgnoreCase("-metadataRepository") || args[i - 1].equalsIgnoreCase("-mr"))
+ metadataRepositoryLocation = new URL(arg);
+
+ if (args[i - 1].equalsIgnoreCase("-artifactRepository") | args[i - 1].equalsIgnoreCase("-ar"))
+ artifactRepositoryLocation = new URL(arg);
+
+ if (args[i - 1].equalsIgnoreCase("-flavor"))
+ flavor = arg;
+
+ if (args[i - 1].equalsIgnoreCase("-installIU")) {
+ root = arg;
+ install = true;
+ }
+
+ if (args[i - 1].equalsIgnoreCase("-version")) {
+ version = new Version(arg);
+ }
+
+ if (args[i - 1].equalsIgnoreCase("-uninstallIU")) {
+ root = arg;
+ install = false;
+ }
+
+ if (args[i - 1].equalsIgnoreCase("-prov.os")) {
+ os = arg;
+ }
+ if (args[i - 1].equalsIgnoreCase("-prov.ws")) {
+ ws = arg;
+ }
+ if (args[i - 1].equalsIgnoreCase("-prov.nl")) {
+ nl = arg;
+ }
+ if (args[i - 1].equalsIgnoreCase("-prov.arch")) {
+ arch = arg;
+ }
+ }
+ }
+
+ private String getEnvironmentProperty() {
+ Properties values = new Properties();
+ if (os != null)
+ values.put("osgi.os", os);
+ if (nl != null)
+ values.put("osgi.nl", nl);
+ if (ws != null)
+ values.put("osgi.ws", ws);
+ if (arch != null)
+ values.put("osgi.arch", arch);
+ if (values.isEmpty())
+ return null;
+ return toString(values);
+ }
+
+ private String toString(Properties context) {
+ StringBuffer result = new StringBuffer();
+ for (Enumeration iter = context.keys(); iter.hasMoreElements();) {
+ String key = (String) iter.nextElement();
+ result.append(key);
+ result.append('=');
+ result.append(context.get(key));
+ if (iter.hasMoreElements())
+ result.append(',');
+ }
+ return result.toString();
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.director/.classpath b/bundles/org.eclipse.equinox.p2.director/.classpath
new file mode 100644
index 000000000..7cdeb7319
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.director/.cvsignore b/bundles/org.eclipse.equinox.p2.director/.cvsignore
new file mode 100644
index 000000000..c5e82d745
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/.cvsignore
@@ -0,0 +1 @@
+bin \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.director/.project b/bundles/org.eclipse.equinox.p2.director/.project
new file mode 100644
index 000000000..aae538be8
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.equinox.prov.director</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.p2.director/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..78523cd05
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,331 @@
+#Thu Aug 16 11:00:59 EDT 2007
+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.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.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=error
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+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.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+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.unsafeTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+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.p2.director/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..014501b61
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+#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
+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.p2.director/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..7913d20db
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..bea852499
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Director Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.equinox.prov.director
+Bundle-Version: 0.1.0.qualifier
+Import-Package: org.eclipse.equinox.prov.core.eventbus,
+ org.eclipse.equinox.prov.core.helpers,
+ org.eclipse.equinox.prov.core.location,
+ org.eclipse.equinox.prov.core.repository,
+ org.eclipse.equinox.prov.engine,
+ org.eclipse.equinox.prov.installregistry,
+ org.eclipse.equinox.prov.metadata,
+ org.eclipse.equinox.prov.metadata.repository,
+ org.eclipse.equinox.prov.query,
+ org.eclipse.equinox.prov.resolution,
+ org.eclipse.osgi.service.resolver;version="1.1.0",
+ org.eclipse.osgi.util;version="1.0.0",
+ org.osgi.framework;version="1.3.0"
+Export-Package: org.eclipse.equinox.internal.prov.director,
+ org.eclipse.equinox.prov.director
+Bundle-Activator: org.eclipse.equinox.internal.prov.director.DirectorActivator
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
+ J2SE-1.4
+Require-Bundle: org.eclipse.equinox.common
diff --git a/bundles/org.eclipse.equinox.p2.director/about.html b/bundles/org.eclipse.equinox.p2.director/about.html
new file mode 100644
index 000000000..460233046
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/about.html
@@ -0,0 +1,28 @@
+<!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 (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). 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, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.p2.director/build.properties b/bundles/org.eclipse.equinox.p2.director/build.properties
new file mode 100644
index 000000000..475da1dec
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/BasicIUFilter.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/BasicIUFilter.java
new file mode 100644
index 000000000..bbc212a06
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/BasicIUFilter.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.prov.director;
+
+import org.eclipse.equinox.prov.metadata.IInstallableUnit;
+
+public class BasicIUFilter extends IUFilter {
+ private IInstallableUnit[] accepted;
+
+ public BasicIUFilter(IInstallableUnit[] accepted) {
+ this.accepted = accepted;
+ }
+
+ public boolean accept(IInstallableUnit iu) {
+ for (int i = 0; i < accepted.length; i++) {
+ if (accepted[i].equals(iu))
+ return true;
+ }
+ return false;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/DirectorActivator.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/DirectorActivator.java
new file mode 100644
index 000000000..6fc46f6de
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/DirectorActivator.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.director;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class DirectorActivator implements BundleActivator {
+ public static final String PI_DIRECTOR = "org.eclipse.equinox.prov.director"; //$NON-NLS-1$
+ public static BundleContext context;
+
+ public void start(BundleContext ctx) throws Exception {
+ context = ctx;
+ }
+
+ public void stop(BundleContext ctx) throws Exception {
+ DirectorActivator.context = null;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/IUFilter.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/IUFilter.java
new file mode 100644
index 000000000..96d88da8c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/IUFilter.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.director;
+
+import org.eclipse.equinox.prov.metadata.IInstallableUnit;
+
+public abstract class IUFilter {
+ public abstract boolean accept(IInstallableUnit iu);
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/IUTransformationHelper.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/IUTransformationHelper.java
new file mode 100644
index 000000000..5b305bdd0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/IUTransformationHelper.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.prov.director;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import org.eclipse.equinox.prov.metadata.IInstallableUnit;
+import org.eclipse.equinox.prov.metadata.RequiredCapability;
+import org.eclipse.osgi.service.resolver.VersionRange;
+
+public class IUTransformationHelper {
+ static public RequiredCapability[] toRequirements(Iterator ius, boolean optional) {
+ ArrayList result = new ArrayList();
+ while (ius.hasNext()) {
+ IInstallableUnit current = (IInstallableUnit) ius.next();
+ result.add(new RequiredCapability(IInstallableUnit.IU_NAMESPACE, current.getId(), new VersionRange(current.getVersion(), true, current.getVersion(), true), null, optional, false));
+ }
+ return (RequiredCapability[]) result.toArray(new RequiredCapability[result.size()]);
+ }
+
+ static public RequiredCapability[] toRequirements(IInstallableUnit[] ius, boolean optional) {
+ RequiredCapability[] result = new RequiredCapability[ius.length];
+ for (int i = 0; i < result.length; i++) {
+ IInstallableUnit current = ius[i];
+ result[i] = new RequiredCapability(IInstallableUnit.IU_NAMESPACE, current.getId(), new VersionRange(current.getVersion(), true, current.getVersion(), true), null, optional, false);
+ }
+ return result;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/Messages.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/Messages.java
new file mode 100644
index 000000000..dd4b9980a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/Messages.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.director;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.prov.director.messages"; //$NON-NLS-1$
+
+ static {
+ // initialize resource bundles
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ // Do not instantiate
+ }
+
+ public static String Director_Install_Problems;
+
+ public static String Director_Uninstall_Problems;
+ public static String Director_Nothing_To_Uninstall;
+ public static String Director_Cannot_Uninstall;
+
+ public static String Director_Replace_Problems;
+ public static String Director_Become_Problems;
+ public static String Director_Unexpected_IU;
+ public static String Director_Task_Installing;
+ public static String Director_Task_Uninstalling;
+ public static String Director_Task_Updating;
+ public static String Director_Task_Resolving_Dependencies;
+ public static String Director_Resolving_Shared_Dependencies;
+ public static String Director_Unsatisfied_Dependencies;
+ public static String Director_Unsatisfied_Dependency;
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/OperationGenerator.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/OperationGenerator.java
new file mode 100644
index 000000000..1944bb4b8
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/OperationGenerator.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.prov.director;
+
+import java.util.*;
+import org.eclipse.equinox.prov.engine.Operand;
+import org.eclipse.equinox.prov.metadata.*;
+import org.eclipse.equinox.prov.query.CompoundIterator;
+import org.eclipse.osgi.service.resolver.VersionRange;
+
+public class OperationGenerator {
+ static IResolvedInstallableUnit NULL_IU = new ResolvedInstallableUnit(new InstallableUnit());
+
+ public Operand[] generateOperation(Collection from_, Collection to_) {
+ List from = new ArrayList(from_);
+ Collections.sort(from);
+
+ List to = new ArrayList(to_);
+ Collections.sort(to);
+
+ ArrayList operations = new ArrayList();
+ generateUpdates(from, to, operations);
+ generateInstallUninstall(from, to, operations);
+ Operand[] ops = (Operand[]) operations.toArray(new Operand[operations.size()]);
+ return ops;
+ }
+
+ private void generateInstallUninstall(List from, List to, ArrayList operations) {
+ int toIdx = 0;
+ int fromIdx = 0;
+ while (fromIdx != from.size() && toIdx != to.size()) {
+ IResolvedInstallableUnit fromIU = (IResolvedInstallableUnit) from.get(fromIdx);
+ IResolvedInstallableUnit toIU = (IResolvedInstallableUnit) to.get(toIdx);
+ int comparison = toIU.compareTo(fromIU);
+ if (comparison < 0) {
+ operations.add(createInstallOperation(toIU));
+ toIdx++;
+ } else if (comparison == 0) {
+ toIdx++;
+ fromIdx++;
+ // System.out.println("same " + fromIU);
+ } else {
+ operations.add(createUninstallOperation(fromIU));
+ fromIdx++;
+ }
+ }
+ if (fromIdx != from.size()) {
+ for (int i = fromIdx; i < from.size(); i++) {
+ operations.add(createUninstallOperation((IResolvedInstallableUnit) from.get(i)));
+ }
+ }
+ if (toIdx != to.size()) {
+ for (int i = toIdx; i < to.size(); i++) {
+ operations.add(createInstallOperation((IResolvedInstallableUnit) to.get(i)));
+ }
+ }
+ }
+
+ private void generateUpdates(List from, List to, ArrayList operations) {
+ Set processed = new HashSet();
+ for (int toIdx = 0; toIdx < to.size(); toIdx++) {
+ IResolvedInstallableUnit iuTo = (IResolvedInstallableUnit) to.get(toIdx);
+ if (iuTo.getId().equals(next(from, toIdx).getId())) {
+ toIdx = skip(to, iuTo, toIdx) - 1;
+ //System.out.println("Can't update " + iuTo + " because another iu with same id is in the target state");
+ continue;
+ }
+ if (iuTo.getProperty(IInstallableUnitConstants.UPDATE_FROM) == null)
+ continue;
+ //when the ui we update from is in the new state, skip (for example FROM is A, C, B & TO is C (update of
+ Iterator updates = new CompoundIterator(new Iterator[] {from.iterator()}, iuTo.getProperty(IInstallableUnitConstants.UPDATE_FROM), new VersionRange(iuTo.getProperty(IInstallableUnitConstants.UPDATE_RANGE)), null, false);
+ IResolvedInstallableUnit iuFrom;
+ if (!updates.hasNext()) { //Nothing to udpate from.
+ continue;
+ }
+ iuFrom = (IResolvedInstallableUnit) updates.next();
+ if (updates.hasNext()) { //There are multiple IUs to update from
+ //System.out.println("Can't update " + iuTo + " because there are multiple IUs to update from (" + toString(iusFrom) + ')');
+ continue;
+ }
+ if (iuTo.equals(iuFrom)) {
+ from.remove(iuFrom);
+ to.remove(iuTo);
+ continue;
+ }
+ operations.add(createUpdateOperation(iuFrom, iuTo));
+ from.remove(iuFrom);
+ processed.add(iuTo);
+ }
+ to.removeAll(processed);
+ }
+
+ private Operand createUninstallOperation(IResolvedInstallableUnit iu) {
+ return new Operand(iu, null);
+ }
+
+ private Operand createInstallOperation(IResolvedInstallableUnit iu) {
+ return new Operand(null, iu);
+ }
+
+ private Operand createUpdateOperation(IResolvedInstallableUnit from, IResolvedInstallableUnit to) {
+ return new Operand(from, to);
+ }
+
+ private IResolvedInstallableUnit next(List l, int i) {
+ i++;
+ if (i >= l.size())
+ return NULL_IU;
+ return (IResolvedInstallableUnit) l.get(i);
+ }
+
+ private int skip(List c, IResolvedInstallableUnit id, int idx) {
+ int i = idx;
+ for (; i < c.size(); i++) {
+ if (!id.getId().equals(((IInstallableUnit) c.get(idx)).getId()))
+ return i;
+ }
+ return i;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/Picker.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/Picker.java
new file mode 100644
index 000000000..70249358e
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/Picker.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.prov.director;
+
+import java.util.*;
+import org.eclipse.equinox.prov.metadata.*;
+import org.eclipse.osgi.service.resolver.VersionRange;
+
+//The pickers goal is to find an installable unit that satisfies a search criteria
+//TODO we may need additional variations of these method where version can be null, or where the search returns all the match, not just the first one
+//TODO do we want a facility to limit the searching space, or do we assume that the unitsToPickFrom has already been scoped
+public class Picker {
+ //TODO we'll likely need better indexing capabilities
+ private IInstallableUnit[] preferredSet;
+ private IInstallableUnit[] completeSet;
+ private IInstallableUnit[] secondChoiceSet;
+ private RecommendationDescriptor recommendations;
+
+ private List filters;
+
+ public Picker(IInstallableUnit[] unitsToPickFrom, RecommendationDescriptor recommendations) {
+ if (unitsToPickFrom != null)
+ completeSet = unitsToPickFrom;
+ else
+ completeSet = new InstallableUnit[0];
+ this.secondChoiceSet = completeSet;
+ this.recommendations = recommendations;
+ this.filters = new ArrayList(2);
+ }
+
+ public Collection[] findInstallableUnit(String id, VersionRange range, RequiredCapability searchedCapability) {
+ IInstallableUnit[][] tmp = findInstallableUnit(id, range, new RequiredCapability[] {searchedCapability}, false);
+ return new Collection[] {Arrays.asList(tmp[0]), Arrays.asList(tmp[1])};
+ }
+
+ public void prefer(Collection filtersToAdd) {
+ if (!filters.addAll(filtersToAdd))
+ return;
+ if (filters.size() == 0)
+ return;
+ Set preferredIUs = new HashSet(completeSet.length);
+ Set secondChoice = new HashSet(completeSet.length);
+ for (int i = 0; i < completeSet.length; i++) {
+ for (Iterator iterator = filters.iterator(); iterator.hasNext();) {
+ if (((IUFilter) iterator.next()).accept(completeSet[i])) {
+ preferredIUs.add(completeSet[i]);
+ continue;
+ } else {
+ secondChoice.add(completeSet[i]);
+ }
+ }
+ }
+ preferredSet = (IInstallableUnit[]) preferredIUs.toArray(new IInstallableUnit[preferredIUs.size()]);
+ secondChoiceSet = (IInstallableUnit[]) secondChoice.toArray(new IInstallableUnit[secondChoice.size()]);
+ }
+
+ public IInstallableUnit[][] findInstallableUnit(String id, VersionRange range, RequiredCapability[] searchedCapability, boolean fragmentsOnly) {
+ return new IInstallableUnit[][] {findInstallableUnit(preferredSet, id, range, searchedCapability, fragmentsOnly), findInstallableUnit(secondChoiceSet, id, range, searchedCapability, fragmentsOnly)};
+ }
+
+ //TODO what should be the return value when all the parameters are null. Is it even a valid call?
+ //TODO A lot of improvement could be done on this algorithm, for example
+ // - remove from the set of searchedCapability the one that are found
+ private IInstallableUnit[] findInstallableUnit(IInstallableUnit[] pool, String id, VersionRange range, RequiredCapability[] searchedCapability, boolean fragmentsOnly) {
+ if (pool == null || pool.length == 0)
+ return new IInstallableUnit[0];
+ Set candidates = new HashSet();
+
+ //Filter on plugin id and range
+ if (id != null && range != null) {
+ for (int i = 0; i < pool.length; i++) {
+ if (pool[i].getId().equals(id) && range.isIncluded(pool[i].getVersion()))
+ candidates.add(pool[i]);
+ }
+ pool = (InstallableUnit[]) candidates.toArray(new IInstallableUnit[candidates.size()]);
+ }
+
+ //Filter on capabilities.
+ if (searchedCapability != null) {
+ searchedCapability = rewrite(searchedCapability);
+ for (int i = 0; i < pool.length; i++) {
+ IInstallableUnit candidate = pool[i];
+ for (int k = 0; k < searchedCapability.length; k++) {
+ boolean valid = false;
+ ProvidedCapability[] capabilities = candidate.getProvidedCapabilities();
+ if (capabilities.length == 0)
+ valid = false;
+ for (int j = 0; j < capabilities.length; j++) {
+ if ((searchedCapability[k].getName().equals(capabilities[j].getName()) && searchedCapability[k].getNamespace().equals(capabilities[j].getNamespace()) && (searchedCapability[k].getRange() == null ? true : searchedCapability[k].getRange().isIncluded(capabilities[j].getVersion())))) { //TODO Need to deal with option
+ valid = true;
+ break;
+ }
+ }
+ if (valid && (!fragmentsOnly || candidate.isFragment())) {
+ candidates.add(candidate);
+ }
+ }
+ }
+ pool = (IInstallableUnit[]) candidates.toArray(new IInstallableUnit[candidates.size()]);
+ }
+
+ return pool;
+ }
+
+ private RequiredCapability[] rewrite(RequiredCapability[] requiredCapabilities) {
+ if (recommendations == null)
+ return requiredCapabilities;
+ RequiredCapability[] result = new RequiredCapability[requiredCapabilities.length];
+ for (int i = 0; i < requiredCapabilities.length; i++) {
+ result[i] = getRecommendation(requiredCapabilities[i]);
+ if (result[i] == null)
+ result[i] = requiredCapabilities[i];
+ }
+ return result;
+ }
+
+ private RequiredCapability getRecommendation(RequiredCapability match) {
+ Recommendation foundRecommendation = recommendations.findRecommendation(match);
+ return foundRecommendation != null ? foundRecommendation.newValue() : match;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/RequirementBasedFilter.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/RequirementBasedFilter.java
new file mode 100644
index 000000000..957eb6f31
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/RequirementBasedFilter.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.prov.director;
+
+import org.eclipse.equinox.prov.metadata.IInstallableUnit;
+import org.eclipse.equinox.prov.metadata.RequiredCapability;
+
+public class RequirementBasedFilter extends IUFilter {
+ private RequiredCapability[] reqs;
+
+ public RequirementBasedFilter(RequiredCapability[] toFilterOn) {
+ reqs = toFilterOn;
+ }
+
+ public boolean accept(IInstallableUnit iu) {
+ for (int i = 0; i < reqs.length; i++) {
+ if (reqs[i].getNamespace().equals(IInstallableUnit.IU_NAMESPACE) && reqs[i].getName().equals(iu.getId()) && reqs[i].getRange().isIncluded(iu.getVersion()))
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/messages.properties b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/messages.properties
new file mode 100644
index 000000000..795fa00db
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/director/messages.properties
@@ -0,0 +1,28 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+
+Director_Uninstall_Problems=Problems occurred while uninstalling.
+Director_Install_Problems=Problems occurred while installing.
+Director_Cannot_Uninstall=Can not uninstall {0} because others IUs depend on it.
+Director_Nothing_To_Uninstall=Nothing to uninstall.
+Director_Replace_Problems=Problems occurred while replacing.
+Director_Become_Problems=Problems occured while running become.
+Director_Unexpected_IU=The installable unit {0} can not be used here.
+Director_Task_Installing=Installing {0} to {1}
+Director_Task_Uninstalling=Uninstalling
+Director_Task_Updating=Updating
+Director_Task_Resolving_Dependencies=Resolving dependencies
+
+Director_Unsatisfied_Dependencies=\
+ Cannot complete the install because some dependencies are not satisfiable
+Director_Unsatisfied_Dependency=\
+ Unsatisfied dependency: {0}
+Director_Resolving_Shared_Dependencies=Resolving shared dependencies
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/rollback/FormerState.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/rollback/FormerState.java
new file mode 100644
index 000000000..f6fa26786
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/prov/rollback/FormerState.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.prov.rollback;
+
+import java.util.EventObject;
+import java.util.Hashtable;
+import org.eclipse.equinox.internal.prov.director.IUTransformationHelper;
+import org.eclipse.equinox.prov.core.eventbus.ProvisioningEventBus;
+import org.eclipse.equinox.prov.core.eventbus.SynchronousProvisioningListener;
+import org.eclipse.equinox.prov.engine.*;
+import org.eclipse.equinox.prov.metadata.*;
+import org.eclipse.equinox.prov.metadata.repository.IWritableMetadataRepository;
+import org.osgi.framework.Version;
+
+public class FormerState {
+ IWritableMetadataRepository storage = null;
+
+ Hashtable generatedIUs = new Hashtable(); //key profile id, value the iu representing this profile
+
+ public FormerState(ProvisioningEventBus bus, IWritableMetadataRepository repo) {
+ if (bus == null || repo == null) {
+ throw new IllegalArgumentException("bus and storage can' be null"); //$NON-NLS-1$
+ }
+ storage = repo;
+
+ //listen for pre-event. to memorize the state of the profile
+ bus.addListener(new SynchronousProvisioningListener() {
+ public void notify(EventObject o) {
+ if (o instanceof BeginOperationEvent) {
+ BeginOperationEvent event = (BeginOperationEvent) o;
+ IInstallableUnit iuForProfile = profileToIU(event.getProfile());
+ generatedIUs.put(event.getProfile().getProfileId(), iuForProfile);
+ } else if (o instanceof CommitOperationEvent) {
+ CommitOperationEvent event = (CommitOperationEvent) o;
+ storage.addInstallableUnits(new IInstallableUnit[] {(IInstallableUnit) generatedIUs.get(event.getProfile().getProfileId())});
+ return;
+ } else if (o instanceof RollbackOperationEvent) {
+ RollbackOperationEvent event = (RollbackOperationEvent) o;
+ generatedIUs.remove(event.getProfile().getProfileId());
+ return;
+ }
+ //TODO We need to decide what to do on profile removal
+ // else if (o instanceof ProfileEvent) {
+ // ProfileEvent pe = (ProfileEvent) o;
+ // if (pe.getReason() == ProfileEvent.REMOVED) {
+ // profileRegistries.remove(pe.getProfile().getProfileId());
+ // persist();
+ // }
+ // }
+ }
+
+ });
+ }
+
+ IInstallableUnit profileToIU(Profile toConvert) {
+ InstallableUnit result = new InstallableUnit();
+ result.setProperty(IInstallableUnitConstants.PROFILE_IU_KEY, Boolean.TRUE.toString());
+ result.setId(toConvert.getProfileId());
+ result.setVersion(new Version(0, 0, 0, Long.toString(System.currentTimeMillis())));
+ result.setRequiredCapabilities(IUTransformationHelper.toRequirements(toConvert.getInstallableUnits(), false));
+ //TODO Need to do the properties in the profile
+ //TODO Do we need to mark profile with a special marker
+ return result;
+ }
+
+ // private copyProperty(Profile p) {
+ // Map profileProperties = p.getValues();
+ // }
+}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/prov/director/IDirector.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/prov/director/IDirector.java
new file mode 100644
index 000000000..152832a56
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/prov/director/IDirector.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.prov.director;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.prov.engine.Profile;
+import org.eclipse.equinox.prov.metadata.IInstallableUnit;
+
+/**
+ * Directors are responsible for determining what should be done to a given
+ * profile to reshape it as requested. That is, given the current state of a
+ * profile, a description of the desired end state of that profile and metadata
+ * describing the available IUs, a director produces a list of provisioning
+ * operations (e.g., install, update or uninstall) to perform on the related IUs.
+ * Directors are also able to validate profiles and assist in the diagnosis of
+ * configuration errors. Note that directors may range in complexity from
+ * very simple (e.g., reading a list of bundles from a static file) to very complex.
+ */
+public interface IDirector {
+ /**
+ * Installs the given units into the given profile.
+ *
+ * @param toInstall The units to install
+ * @param profile The profile to install into
+ * @param entryPoint The user visible name of the entry point. If <code>null</code> is being passed, no entry point gets created
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting is not desired
+ */
+ public IStatus install(IInstallableUnit[] toInstall, Profile profile, String entryPoint, IProgressMonitor monitor);
+
+ /**
+ * Uninstalls the given units from the given profile.
+ *
+ * @param toUninstall The units to uninstall
+ * @param profile The profile from which to uninstall
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting is not desired
+ */
+ public IStatus uninstall(IInstallableUnit[] toUninstall, Profile profile, IProgressMonitor monitor);
+
+ public IStatus become(IInstallableUnit target, Profile profile, IProgressMonitor monitor);
+
+ public IStatus replace(IInstallableUnit[] toUninstall, IInstallableUnit[] toInstall, Profile profile, IProgressMonitor monitor);
+
+ //TODO And many more operations for uninstallation and the rest ! See bug 179819
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/prov/director/NewDependencyExpander.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/prov/director/NewDependencyExpander.java
new file mode 100644
index 000000000..164aeeea3
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/prov/director/NewDependencyExpander.java
@@ -0,0 +1,573 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.prov.director;
+
+import java.util.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.internal.prov.director.*;
+import org.eclipse.equinox.prov.engine.Profile;
+import org.eclipse.equinox.prov.metadata.*;
+import org.eclipse.equinox.prov.query.CompoundIterator;
+import org.eclipse.equinox.prov.resolution.ResolutionHelper;
+import org.eclipse.equinox.prov.resolution.UnsatisfiedCapability;
+import org.eclipse.osgi.service.resolver.VersionRange;
+import org.eclipse.osgi.util.NLS;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.Version;
+
+/**
+ * Rather than trying to satisfy a particular IU, we try to satisfy all the requirements of this IU and thus recursively.
+ * The core data structure here is a map of all the requirements encountered. More precisely it is a map whose key is a simplified requirement object (ns and name only),
+ * and whose value is a data structure holding:
+ * - the intersection of all occurrences of the constraints encountered
+ * - the list of IUs satisfying this intersection
+ * The algorithm is rather simple:
+ * - gather the requirements of a set of bundles and add them to the map computing the intersection
+ * - find the IUs matching each of these requirement
+ * - repeat the two previous steps until the last step no longer find matches
+ * Then the resolver is invoked and for each unsatisfied IU that comes out of the resolver we verify if it belongs to an entry in the map where at least one other IU has been picked.
+ * If so we are good, otherwise we have a failure.
+ * Known problems:
+ * - Malicious IU. A malicious IU could be brought into the system, thus causing a detection of impossible solution. Is this really unavoidable?
+ * - The more general problem is that we do not backtrack and therefore when we pick an IU and it may cause problems that we will not discover soon enough. Looking ahead may help us
+ * in avoiding those cases but still we may have problems.
+ *
+ * To be implemented:
+ * - merge of requirements with filters
+ * - check if the IU is applicable according to its platform filter with the given environment
+ * - return unsatisfied constraints
+ * - do the recommendation
+ * TODO It may worth experimenting with two pickers (or chained) . One would pick on the alreadyInstalled ius and one on the available ones. This could help us favor already installed ius over the others.
+ */
+public class NewDependencyExpander {
+
+ private class Match {
+ /**
+ * The {@link IInstallableUnit}s satisfying this requirement.
+ */
+ Set candidates;
+ /**
+ * The environment against which capability filters are evaluated for this match.
+ */
+ Dictionary env;
+ RequiredCapability req;
+
+ public Match(RequiredCapability range, Dictionary environment) {
+ this.req = range;
+ this.env = environment;
+ candidates = new HashSet(2);
+ }
+
+ /**
+ * For debugging purposes only
+ */
+ public String toString() {
+ return "Match[" + req + ']'; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Represents a requirement name in the map of required capabilities.
+ */
+ private class MatchKey {
+ String name;
+ String namespace;
+
+ MatchKey(RequiredCapability capability) {
+ this.namespace = capability.getNamespace();
+ this.name = capability.getName();
+ }
+
+ public boolean equals(Object object) {
+ if (!(object instanceof MatchKey))
+ return false;
+ MatchKey that = (MatchKey) object;
+ return this.namespace.equals(that.namespace) && this.name.equals(that.name);
+ }
+
+ public int hashCode() {
+ return 31 * namespace.hashCode() + name.hashCode();
+ }
+
+ public String toString() {
+ return "MatchKey(" + namespace + '/' + name + ')'; //$NON-NLS-1$
+ }
+ }
+
+ // Installable units that are optional have a dependency on themselves.
+ private class OptionalInstallableUnit extends InstallableUnit {
+ private boolean optionalReqs;
+ private IInstallableUnit wrapped;
+
+ OptionalInstallableUnit(IInstallableUnit iu, boolean generateOptionalReqs) {
+ wrapped = iu;
+ optionalReqs = generateOptionalReqs;
+ }
+
+ public String getId() {
+ return wrapped.getId();
+ }
+
+ public Version getVersion() {
+ return wrapped.getVersion();
+ }
+
+ public String getProperty(String key) {
+ return wrapped.getProperty(key);
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final OptionalInstallableUnit other = (OptionalInstallableUnit) obj;
+ if (wrapped == null) {
+ if (other.wrapped != null)
+ return false;
+ } else if (!wrapped.equals(other.wrapped))
+ return false;
+ return true;
+ }
+
+ public RequiredCapability[] getRequiredCapabilities() {
+ ArrayList result = new ArrayList();
+ ProvidedCapability[] caps = wrapped.getProvidedCapabilities();
+ for (int i = 0; i < caps.length; i++) {
+ result.add(new RequiredCapability(caps[i].getNamespace(), caps[i].getName(), new VersionRange(caps[i].getVersion(), true, caps[i].getVersion(), true), null, optionalReqs, false));
+ }
+ result.addAll(Arrays.asList(wrapped.getRequiredCapabilities()));
+ return (RequiredCapability[]) result.toArray(new RequiredCapability[result.size()]);
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((wrapped == null) ? 0 : wrapped.hashCode());
+ return result;
+ }
+
+ public String toString() {
+ return wrapped.toString();
+ }
+ }
+
+ static final int OperationWork = 100;
+
+ private final Set alreadyInstalled = new HashSet();
+
+ private boolean includeOptional;
+
+ /**
+ * A map of all the requirements ever encountered in the system. The key is
+ * a MatchKey and the value is a List of Match objects.
+ */
+ private Map must = new HashMap();
+ private Picker picker;
+
+ private Profile profile;
+
+ private RecommendationDescriptor recommendations;
+
+ private ResolutionHelper resolver;
+
+ private IInstallableUnit[] roots;
+
+ private Collection solution;
+
+ public NewDependencyExpander(IInstallableUnit[] r, IInstallableUnit[] alreadyInstalled, IInstallableUnit[] availableIUs, Profile profile, boolean includeOptional) {
+ this.profile = profile;
+ this.roots = (r == null) ? new IInstallableUnit[0] : r;
+ this.includeOptional = includeOptional;
+ alreadyInstalled = alreadyInstalled == null ? new IInstallableUnit[0] : alreadyInstalled;
+ this.alreadyInstalled.addAll(Arrays.asList(alreadyInstalled));
+
+ IInstallableUnit[] result = new IInstallableUnit[roots.length + alreadyInstalled.length + availableIUs.length];
+ System.arraycopy(roots, 0, result, 0, roots.length);
+ System.arraycopy(alreadyInstalled, 0, result, roots.length, alreadyInstalled.length);
+ System.arraycopy(availableIUs, 0, result, roots.length + alreadyInstalled.length, availableIUs.length);
+ picker = new Picker(result, new RecommendationDescriptor(new HashSet()));
+ Collection filterForRoot = new ArrayList();
+ if (r != null && r.length > 0) {
+ filterForRoot.add(new BasicIUFilter(r));
+ filterForRoot.add(new RequirementBasedFilter(r[0].getRequiredCapabilities()));
+ }
+ picker.prefer(filterForRoot);
+ }
+
+ /**
+ * Creates a problem status for the given unsatisfied dependency.
+ */
+ private void addUnsatisfied(RequiredCapability req, Collection toAdd, MultiStatus problems) {
+ for (Iterator it = toAdd.iterator(); it.hasNext();) {
+ IInstallableUnit unit = (IInstallableUnit) it.next();
+ RequiredCapability[] required = unit.getRequiredCapabilities();
+ for (int i = 0; i < required.length; i++) {
+ if (required[i].equals(req)) {
+ UnsatisfiedCapability unsatisfied = new UnsatisfiedCapability(req, unit);
+ String msg = NLS.bind(Messages.Director_Unsatisfied_Dependency, unsatisfied);
+ problems.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, msg));
+ }
+ }
+ }
+ }
+
+ private void algo(SubMonitor p, MultiStatus problems) {
+ //First we create dependencies on the root themselves. The first iteration will mostly consist in rediscovering the roots.
+ Collection toAdd = asOptionalIUs(Arrays.asList(roots), false);
+ toAdd.addAll(alreadyInstalled);
+ do {
+ //reset work at each iteration, then use up a third. This results in an infinite series where remaining ticks gets steadily smaller
+ p.setWorkRemaining(100);
+ extractVisibilityData(toAdd);
+ extractRequirements(toAdd);
+ toAdd = collectMatches(toAdd, problems);
+ p.worked(33);
+ } while (toAdd.size() != 0);
+
+ //don't bother invoking the resolver if we already have problems
+ // if (!problems.isOK())
+ // return;
+ invokeResolver(problems);
+ // if (problems.isOK())
+ extractSolution();
+ }
+
+ private void extractVisibilityData(Collection ius) {
+ Collection filters = new ArrayList();
+ for (Iterator iterator = ius.iterator(); iterator.hasNext();) {
+ IInstallableUnit iu = (IInstallableUnit) iterator.next();
+ if ("true".equalsIgnoreCase(iu.getProperty("lineUp"))) {
+ filters.add(new RequirementBasedFilter(iu.getRequiredCapabilities()));
+ }
+ }
+ picker.prefer(filters);
+ }
+
+ private Collection asOptionalIUs(Collection asList, boolean generateOptionalReqs) {
+ ArrayList result = new ArrayList();
+ for (Iterator iterator = asList.iterator(); iterator.hasNext();) {
+ result.add(new OptionalInstallableUnit(((IInstallableUnit) iterator.next()), generateOptionalReqs));
+ }
+ return result;
+ }
+
+ private Collection collectFlavorProviders(Collection toSearchFor) {
+ String flavor = profile.getValue(Profile.PROP_FLAVOR);
+ if (flavor == null)
+ return new HashSet();
+ IInstallableUnit[][] picked = picker.findInstallableUnit(null, null, new RequiredCapability[] {new RequiredCapability(IInstallableUnit.FLAVOR_NAMESPACE, flavor, VersionRange.emptyRange, null, false, false)}, true /* fragmentsOnly */);
+ IInstallableUnit[] ius;
+ if (picked[0].length > 0)
+ ius = picked[0];
+ else
+ ius = picked[1];
+ Set results = new HashSet(ius.length);
+ for (int i = 0; i < ius.length; i++) {
+ IInstallableUnit tmp = match(toSearchFor, ius[i]);
+ if (tmp != null)
+ results.add(new OptionalInstallableUnit(tmp, false));
+ }
+ return results;
+ }
+
+ private Collection collectInstallableUnitFragments(Collection ius) {
+ Set picked = new HashSet();
+ for (Iterator iterator = ius.iterator(); iterator.hasNext();) {
+ IInstallableUnit current = (IInstallableUnit) iterator.next();
+ IInstallableUnit[][] candidates = picker.findInstallableUnit(null, null, new RequiredCapability[] {new RequiredCapability("fragment", current.getId(), VersionRange.emptyRange, null, true, false)}, false /* not fragmentsOnly */); //$NON-NLS-1$
+ IInstallableUnit[] matches = candidates[0].length > 0 ? candidates[0] : candidates[1];
+ if (matches.length > 0) { //TODO Here we need to check the filter of the found iu
+ if (matches.length == 1) {
+ picked.add(matches[0]);
+ continue;
+ }
+ //verify that each IU requires the current iu
+ ProvidedCapability capForCurrent = new ProvidedCapability(IInstallableUnit.IU_NAMESPACE, current.getId(), current.getVersion());
+ Map toAdd = new HashMap();
+ for (int i = 0; i < matches.length; i++) {
+ RequiredCapability[] reqs = matches[i].getRequiredCapabilities();
+ boolean isReallyAFragment = false;
+ for (int j = 0; j < reqs.length; j++) {
+ isReallyAFragment = capForCurrent.isSatisfiedBy(reqs[j]);
+ }
+ if (!isReallyAFragment)
+ continue;
+ IInstallableUnit match = (IInstallableUnit) toAdd.get(matches[i].getId());
+ if (match == null || match.getVersion().compareTo(matches[i].getVersion()) < 0)
+ toAdd.put(matches[i].getId(), matches[i]);
+ }
+ picked.addAll(toAdd.values());
+ //in the reminder, check if more than one is good, then pick the highest one.
+ }
+ }
+ return picked;
+ }
+
+ // For each requirement, find the potential IUs
+ private Collection collectMatches(Collection toAdd, MultiStatus problems) {
+ Collection thingsAdded = new HashSet();
+ for (Iterator iterator = must.values().iterator(); iterator.hasNext();) {
+ List all = (List) iterator.next();
+ for (Iterator matches = all.iterator(); matches.hasNext();) {
+ Match current = (Match) matches.next();
+ Collection[] picked = picker.findInstallableUnit(null, null, current.req);
+ Collection found = picked[0].size() > 0 ? picked[0] : picked[1];
+ if (current.candidates.addAll(found)) {
+ thingsAdded.addAll(found);
+ thingsAdded.addAll(collectOptionalInstallableUnits(found));
+ }
+ if (current.candidates.size() == 0 && requirementEnabled(current.req))
+ addUnsatisfied(current.req, toAdd, problems);
+ }
+ if (all.size() > 2) {
+ throw new IllegalStateException("Can't deal with three or more different versions of the same IU " + ((Match) all.get(0)).req + ". See bug 200380");
+ }
+ if (all.size() > 1) {
+ //TODO This algorithm needs to be generalized to consider all the potential candidates.
+ Set set1 = ((Match) all.get(0)).candidates;
+ Set set2 = ((Match) all.get(1)).candidates;
+ boolean potentialSolution = false;
+ for (Iterator iteratorSet1 = set1.iterator(); iteratorSet1.hasNext() && !potentialSolution;) {
+ IInstallableUnit itemSet1 = (IInstallableUnit) iteratorSet1.next();
+ for (Iterator iteratorSet2 = set2.iterator(); iteratorSet2.hasNext() && !potentialSolution;) {
+ IInstallableUnit itemSet2 = (IInstallableUnit) iteratorSet2.next();
+ if (itemSet1.getId().equals(itemSet2.getId()) && ((itemSet1.isSingleton() == true && itemSet1.isSingleton() == itemSet2.isSingleton()) || itemSet1.isSingleton() != itemSet2.isSingleton())) {
+ continue; //This combination would not work. Keep on searching
+ }
+ potentialSolution = true;
+ }
+ }
+ if (potentialSolution == false) {
+ String msg = "Can't find a solution where both: " + all.get(0) + " and " + all.get(1) + " would be satisfied.";
+ problems.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR,