diff options
author | Pascal Rapicault | 2009-03-30 01:49:22 +0000 |
---|---|---|
committer | Pascal Rapicault | 2009-03-30 01:49:22 +0000 |
commit | e3323e81f523c933c8dceb2a8c08d89f60eb87a2 (patch) | |
tree | ed2fa07a5d3bced8a2ccac516fd615d2d7e73514 | |
parent | eb03f3e34118fbe9152a17e3fc962690963c8d85 (diff) | |
download | rt.equinox.p2-e3323e81f523c933c8dceb2a8c08d89f60eb87a2.tar.gz rt.equinox.p2-e3323e81f523c933c8dceb2a8c08d89f60eb87a2.tar.xz rt.equinox.p2-e3323e81f523c933c8dceb2a8c08d89f60eb87a2.zip |
Bug 216278 - [prov] ECFTransport and ECFMetadataTransport should be merged
180 files changed, 1045 insertions, 5310 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF index 1a1299088..2ca738d6b 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF @@ -10,13 +10,14 @@ Import-Package: ie.wombat.jbdiff, org.eclipse.equinox.app;version="1.0.0", org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.p2.metadata, + org.eclipse.equinox.internal.p2.repository.helpers, + org.eclipse.equinox.internal.p2.sar, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing, org.eclipse.equinox.internal.provisional.p2.core, - org.eclipse.equinox.internal.provisional.p2.core.repository, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.internal.provisional.p2.metadata.repository, - org.eclipse.equinox.internal.p2.sar, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.internal.provisional.equinox.p2.jarprocessor, org.eclipse.osgi.util;version="1.1.0", org.osgi.framework;version="1.3.0" diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.artifact.processors/META-INF/MANIFEST.MF index d93837da5..8866bff2e 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.processors/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.artifact.processors/META-INF/MANIFEST.MF @@ -18,7 +18,7 @@ Import-Package: ie.wombat.jbdiff, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing, org.eclipse.equinox.internal.provisional.p2.core, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.internal.p2.sar, org.eclipse.internal.provisional.equinox.p2.jarprocessor diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java index ccef6f402..f3ae290f4 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java +++ b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java @@ -11,7 +11,7 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.artifact.processors; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; import java.net.URI; import org.eclipse.core.runtime.IStatus; 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 index b6983b57d..cc5924f42 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF @@ -10,6 +10,7 @@ Export-Package: org.eclipse.equinox.internal.p2.artifact.mirror;x-internal:=true org.eclipse.equinox.internal.p2.artifact.processors.md5;x-internal:=true, org.eclipse.equinox.internal.p2.artifact.processors.pack200;x-friends:="org.eclipse.equinox.p2.artifact.processors,org.eclipse.equinox.p2.artifact.optimizers", org.eclipse.equinox.internal.p2.artifact.repository;x-friends:="org.eclipse.equinox.p2.metadata.generator,org.eclipse.equinox.p2.publisher,org.eclipse.equinox.p2.reconciler.dropins", + org.eclipse.equinox.internal.p2.artifact.repository.ant, org.eclipse.equinox.internal.p2.artifact.repository.simple;x-friends:="org.eclipse.equinox.p2.selfhosting,org.eclipse.equinox.p2.touchpoint.eclipse,org.eclipse.equinox.p2.tests", org.eclipse.equinox.internal.provisional.p2.artifact.repository; x-friends:="org.eclipse.equinox.p2.artifact.optimizers, @@ -51,11 +52,13 @@ Import-Package: javax.xml.parsers, org.eclipse.equinox.internal.p2.jarprocessor, org.eclipse.equinox.internal.p2.metadata, org.eclipse.equinox.internal.p2.persistence, + org.eclipse.equinox.internal.p2.repository, + org.eclipse.equinox.internal.p2.repository.helpers, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.location, - org.eclipse.equinox.internal.provisional.p2.core.repository, org.eclipse.equinox.internal.provisional.p2.metadata, - org.eclipse.equinox.internal.provisional.spi.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, + org.eclipse.equinox.internal.provisional.spi.p2.repository, org.eclipse.equinox.security.storage, org.eclipse.internal.provisional.equinox.p2.jarprocessor;resolution:=optional, org.eclipse.osgi.framework.log;version="1.0.0", diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java index 728676220..498ff03b5 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java @@ -24,7 +24,7 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; import org.eclipse.osgi.framework.log.FrameworkLog; import org.eclipse.osgi.util.NLS; diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java index 83dcb5772..e30b52ed5 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java @@ -13,12 +13,14 @@ package org.eclipse.equinox.internal.p2.artifact.repository; import java.net.URI; import java.util.*; import org.eclipse.core.runtime.*; -import org.eclipse.equinox.internal.p2.core.helpers.*; +import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; +import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; +import org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.location.AgentLocation; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.ArtifactRepositoryFactory; /** @@ -82,9 +84,6 @@ public class ArtifactRepositoryManager extends AbstractRepositoryManager impleme return IRepository.TYPE_ARTIFACT; } - /** - * @deprecated see {@link #loadRepository(URI, int, IProgressMonitor)} - */ public IArtifactRepository loadRepository(URI location, IProgressMonitor monitor) throws ProvisionException { return loadRepository(location, 0, monitor); } diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java index 104dad304..96cda4bfa 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java @@ -23,8 +23,8 @@ import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryIO; import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.ICompositeRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.ICompositeRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.AbstractArtifactRepository; import org.eclipse.osgi.util.NLS; diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java index cc76cbd68..d51152978 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java @@ -19,9 +19,11 @@ import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.core.helpers.Tracing; import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryIO; import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState; +import org.eclipse.equinox.internal.p2.repository.RepositoryTransport; +import org.eclipse.equinox.internal.p2.repository.Transport; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.ArtifactRepositoryFactory; import org.eclipse.osgi.util.NLS; @@ -119,6 +121,6 @@ public class CompositeArtifactRepositoryFactory extends ArtifactRepositoryFactor } private Transport getTransport() { - return ECFTransport.getInstance(); + return RepositoryTransport.getInstance(); } } diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ECFTransport.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ECFTransport.java deleted file mode 100644 index a137a2893..000000000 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ECFTransport.java +++ /dev/null @@ -1,319 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * compeople AG (Stefan Liebig) - various ongoing maintenance - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.artifact.repository; - -import java.io.*; -import java.net.ProtocolException; -import java.net.URLEncoder; -import org.eclipse.core.runtime.*; -import org.eclipse.ecf.core.security.ConnectContextFactory; -import org.eclipse.ecf.core.security.IConnectContext; -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.internal.p2.core.helpers.LogHelper; -import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; -import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IStateful; -import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI; -import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI.AuthenticationInfo; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.security.storage.*; -import org.eclipse.osgi.util.NLS; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleException; -import org.osgi.service.packageadmin.PackageAdmin; -import org.osgi.util.tracker.ServiceTracker; - -/** - * A transport implementation that uses ECF file transfer API. - */ -public class ECFTransport extends Transport { - /** - * The number of password retry attempts allowed before failing. - */ - private static final int LOGIN_RETRIES = 3; - - private static final ProtocolException ERROR_401 = new ProtocolException(); - - private static final String SERVER_REDIRECT = "Server redirected too many times"; //$NON-NLS-1$ - - /** - * The singleton transport instance. - */ - private static ECFTransport instance; - - private final ServiceTracker retrievalFactoryTracker; - - /** - * Returns an initialized instance of ECFTransport - */ - 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(); - startBundle("org.eclipse.ecf.provider.filetransfer"); //$NON-NLS-1$ - } - - private boolean startBundle(String bundleId) { - PackageAdmin packageAdmin = (PackageAdmin) ServiceHelper.getService(Activator.getContext(), PackageAdmin.class.getName()); - if (packageAdmin == null) - return false; - - Bundle[] bundles = packageAdmin.getBundles(bundleId, null); - if (bundles != null && bundles.length > 0) { - for (int i = 0; i < bundles.length; i++) { - try { - if ((bundles[0].getState() & Bundle.INSTALLED) == 0) { - bundles[0].start(); - return true; - } - } catch (BundleException e) { - // failed, try next bundle - } - } - } - return false; - } - - /** - * Check if the given exception represents a permission failure (401 for HTTP), - * and throw a special marker exception if a permission failure was encountered. - */ - private void checkPermissionDenied(Throwable t) throws ProtocolException { - if (!(t instanceof IncomingFileTransferException)) - return; - IncomingFileTransferException e = (IncomingFileTransferException) t; - if (e.getErrorCode() == 401) - throw ERROR_401; - //try to figure out if we have a 401 by parsing the exception message - IStatus status = e.getStatus(); - Throwable exception = status.getException(); - if (exception instanceof IOException) - if (exception.getMessage() != null && (exception.getMessage().indexOf(" 401 ") != -1 || exception.getMessage().indexOf(SERVER_REDIRECT) != -1)) //$NON-NLS-1$ - throw ERROR_401; - } - - protected IStatus convertToStatus(IFileTransferEvent event, Exception failure, long startTime, String location) { - long speed = DownloadStatus.UNKNOWN_RATE; - if (event instanceof IIncomingFileTransferEvent) { - long bytes = ((IIncomingFileTransferEvent) event).getSource().getBytesReceived(); - if (bytes > 0) { - long elapsed = (System.currentTimeMillis() - startTime) / 1000;//in seconds - if (elapsed == 0) - elapsed = 1; - speed = bytes / elapsed; - } - } - DownloadStatus result = null; - if (failure == null) - result = new DownloadStatus(IStatus.OK, Activator.ID, Status.OK_STATUS.getMessage()); - else if (failure instanceof UserCancelledException) - result = new DownloadStatus(IStatus.CANCEL, Activator.ID, failure.getMessage(), failure); - else - result = new DownloadStatus(IStatus.ERROR, Activator.ID, NLS.bind(Messages.io_failedRead, location), failure); - result.setTransferRate(speed); - return result; - } - - public IStatus download(String url, OutputStream destination, IProgressMonitor monitor) { - try { - IConnectContext context = getConnectionContext(url, false); - for (int i = 0; i < LOGIN_RETRIES; i++) { - try { - return performDownload(url, destination, context, monitor); - } catch (ProtocolException e) { - if (e == ERROR_401) - context = getConnectionContext(url, true); - } - } - } catch (UserCancelledException e) { - return Status.CANCEL_STATUS; - } catch (ProvisionException e) { - return e.getStatus(); - } - //reached maximum number of retries without success - return new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, NLS.bind(Messages.io_failedRead, url), null); - } - - public IStatus performDownload(String toDownload, OutputStream target, IConnectContext context, IProgressMonitor monitor) throws ProtocolException { - IRetrieveFileTransferFactory factory = (IRetrieveFileTransferFactory) retrievalFactoryTracker.getService(); - if (factory == null) - return statusOn(target, new Status(IStatus.ERROR, Activator.ID, Messages.ecf_configuration_error)); - - return transfer(factory.newInstance(), toDownload, target, context, monitor); - } - - private IStatus transfer(final IRetrieveFileTransferContainerAdapter retrievalContainer, final String toDownload, final OutputStream target, IConnectContext context, final IProgressMonitor monitor) throws ProtocolException { - final IStatus[] result = new IStatus[1]; - final long startTime = System.currentTimeMillis(); - IFileTransferListener listener = new IFileTransferListener() { - public void handleTransferEvent(IFileTransferEvent event) { - if (event instanceof IFileTransferConnectStartEvent) { - IFileTransferConnectStartEvent cse = (IFileTransferConnectStartEvent) event; - FileTransferJob connectJob = cse.prepareConnectJob(null); - cse.connectUsingJob(connectJob); - } else if (event instanceof IIncomingFileTransferReceiveStartEvent) { - IIncomingFileTransferReceiveStartEvent rse = (IIncomingFileTransferReceiveStartEvent) event; - try { - if (target != null) { - rse.receive(target); - } - } catch (IOException e) { - IStatus status = convertToStatus(event, e, startTime, toDownload); - synchronized (result) { - result[0] = status; - result.notify(); - } - } - } - if (event instanceof IIncomingFileTransferReceiveDataEvent) { - IIncomingFileTransfer source = ((IIncomingFileTransferReceiveDataEvent) event).getSource(); - if (monitor != null) { - if (monitor.isCanceled()) { - synchronized (result) { - result[0] = Status.CANCEL_STATUS; - source.cancel(); - result.notify(); - } - } - } - } - if (event instanceof IIncomingFileTransferReceiveDoneEvent) { - Exception exception = ((IIncomingFileTransferReceiveDoneEvent) event).getException(); - IStatus status = convertToStatus(event, exception, startTime, toDownload); - synchronized (result) { - result[0] = status; - result.notify(); - } - } - } - }; - - try { - retrievalContainer.setConnectContextForAuthentication(context); - retrievalContainer.sendRetrieveRequest(FileIDFactory.getDefault().createFileID(retrievalContainer.getRetrieveNamespace(), toDownload), listener, null); - } catch (IncomingFileTransferException e) { - checkPermissionDenied(e); - return statusOn(target, e.getStatus()); - } catch (FileCreateException e) { - return statusOn(target, e.getStatus()); - } - 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$ - } - } - } - final Throwable exception = result[0].getException(); - checkPermissionDenied(exception); - //if the transfer failed, return the underlying exception status, otherwise return top level DownloadStatus - if (exception instanceof IncomingFileTransferException) { - IStatus cause = ((IncomingFileTransferException) exception).getStatus(); - if (!cause.isOK()) - return statusOn(target, cause); - } - return statusOn(target, result[0]); - } - - /** - * Returns the connection context for the given URL. This may prompt the - * user for user name and password as required. - * - * @param xmlLocation - the file location requiring login details - * @param prompt - use <code>true</code> to prompt the user instead of - * looking at the secure preference store for login, use <code>false</code> - * to only try the secure preference store - * @throws UserCancelledException when the user cancels the login prompt - * @throws ProvisionException if the password cannot be read or saved - * @return The connection context - */ - public IConnectContext getConnectionContext(String xmlLocation, boolean prompt) throws UserCancelledException, ProvisionException { - ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault(); - IPath hostLocation = new Path(xmlLocation).removeLastSegments(1); - String nodeKey; - try { - nodeKey = URLEncoder.encode(hostLocation.toString(), "UTF-8"); //$NON-NLS-1$ - } catch (UnsupportedEncodingException e2) { - //fall back to default platform encoding - nodeKey = URLEncoder.encode(hostLocation.toString()); - } - String nodeName = IRepository.PREFERENCE_NODE + '/' + nodeKey; - ISecurePreferences prefNode = null; - if (securePreferences.nodeExists(nodeName)) - prefNode = securePreferences.node(nodeName); - if (!prompt) { - if (prefNode == null) - return null; - try { - String username = prefNode.get(IRepository.PROP_USERNAME, null); - String password = prefNode.get(IRepository.PROP_PASSWORD, null); - //if we don't have stored connection data just return a null connection context - if (username == null || password == null) - return null; - return ConnectContextFactory.createUsernamePasswordConnectContext(username, password); - } catch (StorageException e) { - String msg = NLS.bind(Messages.repoMan_internalError, xmlLocation.toString()); - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.INTERNAL_ERROR, msg, null)); - } - } - //need to prompt user for user name and password - ServiceTracker adminUITracker = new ServiceTracker(Activator.getContext(), IServiceUI.class.getName(), null); - adminUITracker.open(); - IServiceUI adminUIService = (IServiceUI) adminUITracker.getService(); - AuthenticationInfo loginDetails = null; - if (adminUIService != null) - loginDetails = adminUIService.getUsernamePassword(hostLocation.toString()); - //null result means user canceled password dialog - if (loginDetails == null) - throw new UserCancelledException(); - //save user name and password if requested by user - if (loginDetails.saveResult()) { - if (prefNode == null) - prefNode = securePreferences.node(nodeName); - try { - prefNode.put(IRepository.PROP_USERNAME, loginDetails.getUserName(), true); - prefNode.put(IRepository.PROP_PASSWORD, loginDetails.getPassword(), true); - prefNode.flush(); - } catch (StorageException e1) { - String msg = NLS.bind(Messages.repoMan_internalError, xmlLocation.toString()); - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.INTERNAL_ERROR, msg, null)); - } catch (IOException e) { - String msg = NLS.bind(Messages.repoMan_internalError, xmlLocation.toString()); - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.INTERNAL_ERROR, msg, null)); - } - } - return ConnectContextFactory.createUsernamePasswordConnectContext(loginDetails.getUserName(), loginDetails.getPassword()); - } - - private static IStatus statusOn(OutputStream target, IStatus status) { - if (target instanceof IStateful) - ((IStateful) target).setStatus(status); - return status; - } -} diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java index 0d7960583..04b41e784 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java @@ -20,6 +20,7 @@ import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processin import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; +import org.eclipse.equinox.internal.provisional.p2.repository.IStateful; import org.eclipse.osgi.util.NLS; /** diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java index 736984398..21b35d24a 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java @@ -18,7 +18,7 @@ import javax.xml.parsers.DocumentBuilderFactory; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; import org.eclipse.equinox.internal.p2.core.helpers.Tracing; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.w3c.dom.*; /** diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Transport.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Transport.java deleted file mode 100644 index b89ec4c1e..000000000 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Transport.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.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/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java index 38821d581..85732309e 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java @@ -22,11 +22,14 @@ import org.eclipse.equinox.internal.p2.artifact.repository.*; import org.eclipse.equinox.internal.p2.artifact.repository.Messages; import org.eclipse.equinox.internal.p2.core.helpers.FileUtils; import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; +import org.eclipse.equinox.internal.p2.repository.RepositoryTransport; +import org.eclipse.equinox.internal.p2.repository.Transport; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IStateful; import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.AbstractArtifactRepository; import org.eclipse.osgi.util.NLS; @@ -460,7 +463,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme } private IStatus downloadArtifact(IArtifactDescriptor descriptor, URI mirrorLocation, OutputStream destination, IProgressMonitor monitor) { - IStatus result = getTransport().download(mirrorLocation.toString(), destination, monitor); + IStatus result = getTransport().download(mirrorLocation, destination, monitor); if (mirrors != null) mirrors.reportResult(mirrorLocation.toString(), result); if (result.isOK() || result.getSeverity() == IStatus.CANCEL) @@ -755,7 +758,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme } private Transport getTransport() { - return ECFTransport.getInstance(); + return RepositoryTransport.getInstance(); } // use this method to setup any transient fields etc after the object has been restored from a stream diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java index ca9360530..54c537c9e 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java @@ -14,7 +14,7 @@ import java.io.OutputStream; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.AbstractArtifactRepository; diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java index 334df0e83..804f1c96d 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java @@ -15,7 +15,7 @@ import java.util.Map; import java.util.Properties; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; /** diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IStateful.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IStateful.java deleted file mode 100644 index 1e2d7f16a..000000000 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IStateful.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * 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.internal.provisional.p2.artifact.repository; - -import org.eclipse.core.runtime.IStatus; - -/** - * Implementing <code>IStateful</code> adds the ability to store status information. - */ -public interface IStateful { - - /** - * Set the status. - * - * @param status if status equals null => getStatus().isOK - */ - void setStatus(IStatus status); - - /** - * Get status. - * @return status - */ - public IStatus getStatus(); - -} diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java index d1eab65f4..736b041f2 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java @@ -15,7 +15,7 @@ import java.io.IOException; import java.io.OutputStream; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactDescriptor; -import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IStateful; +import org.eclipse.equinox.internal.provisional.p2.repository.IStateful; /** * ProcessingSteps process the data written to them and pass the resultant data on diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java index 3b29aff0e..20d287e76 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java @@ -17,7 +17,7 @@ import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.artifact.repository.Activator; import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.ArtifactOutputStream; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactDescriptor; -import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IStateful; +import org.eclipse.equinox.internal.provisional.p2.repository.IStateful; /** * Creates processing step instances from extensions and executes them. @@ -25,6 +25,7 @@ import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IStateful public class ProcessingStepHandler { private static final String PROCESSING_STEPS_EXTENSION_ID = "org.eclipse.equinox.p2.artifact.repository.processingSteps"; //$NON-NLS-1$ + //TODO This method can go public static IStatus checkStatus(OutputStream output) { return getStatus(output, true); diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java index 7b1de5a39..2c5ac9cce 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java @@ -17,7 +17,7 @@ import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; -import org.eclipse.equinox.internal.provisional.spi.p2.core.repository.AbstractRepository; +import org.eclipse.equinox.internal.provisional.spi.p2.repository.AbstractRepository; public abstract class AbstractArtifactRepository extends AbstractRepository implements IArtifactRepository { diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java index 139870380..03ad7ad8e 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java @@ -15,7 +15,7 @@ import java.util.Map; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; /** * An artifact repository factory is responsible for creating and loading instances diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java index ac1caa9dc..f9bf277f0 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java @@ -16,13 +16,16 @@ import java.util.Map; import java.util.jar.JarEntry; import java.util.jar.JarInputStream; import org.eclipse.core.runtime.*; -import org.eclipse.equinox.internal.p2.artifact.repository.*; +import org.eclipse.equinox.internal.p2.artifact.repository.Activator; +import org.eclipse.equinox.internal.p2.artifact.repository.Messages; import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository; import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepositoryIO; import org.eclipse.equinox.internal.p2.core.helpers.Tracing; +import org.eclipse.equinox.internal.p2.repository.RepositoryTransport; +import org.eclipse.equinox.internal.p2.repository.Transport; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; import org.eclipse.osgi.util.NLS; public class SimpleArtifactRepositoryFactory extends ArtifactRepositoryFactory { @@ -117,6 +120,6 @@ public class SimpleArtifactRepositoryFactory extends ArtifactRepositoryFactory { } private Transport getTransport() { - return ECFTransport.getInstance(); + return RepositoryTransport.getInstance(); } } diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java index ed6e3b1bf..a86224e53 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java @@ -23,7 +23,7 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; /** * Ant task for creating a new composite artifact repository. diff --git a/bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF index 1eac3abb4..49cce8e97 100644 --- a/bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF @@ -13,7 +13,7 @@ Import-Package: org.eclipse.core.runtime;common=split, org.eclipse.equinox.internal.provisional.configurator, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.director, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.metadata, diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java index bf92d1af8..4abb06975 100644 --- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java +++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.console; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.util.*; import org.eclipse.core.runtime.IProgressMonitor; @@ -18,7 +20,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.director.*; import org.eclipse.equinox.internal.provisional.p2.engine.*; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; diff --git a/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF index 516fc6d92..5015fdd49 100644 --- a/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF @@ -18,7 +18,7 @@ Import-Package: javax.xml.parsers, org.osgi.util.tracker;version="1.3.3", org.xml.sax, org.xml.sax.helpers -Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equinox.p2.metadata.generator,org.eclipse.equinox.p2.publisher", +Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equinox.p2.metadata.generator,org.eclipse.equinox.p2.publisher,org.eclipse.equinox.p2.repository", org.eclipse.equinox.internal.p2.core.helpers; x-friends:="org.eclipse.equinox.p2.director, org.eclipse.equinox.p2.artifact.processors, @@ -47,8 +47,8 @@ Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equ org.eclipse.equinox.p2.reconciler.dropins, org.eclipse.equinox.p2.extensionlocation, org.eclipse.equinox.p2.publisher, - org.eclipse.equinox.p2.repository.tools", - org.eclipse.equinox.internal.p2.persistence;x-friends:="org.eclipse.equinox.p2.artifact.repository,org.eclipse.equinox.p2.engine,org.eclipse.equinox.p2.metadata.repository", + org.eclipse.equinox.p2.repository.tools, + org.eclipse.equinox.p2.repository", org.eclipse.equinox.internal.provisional.p2.core; x-friends:="org.eclipse.equinox.p2.artifact.optimizers, org.eclipse.equinox.p2.artifact.processors, @@ -74,7 +74,8 @@ Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equ org.eclipse.equinox.p2.updatesite, org.eclipse.pde.ui, org.eclipse.equinox.p2.metadata, - org.eclipse.equinox.p2.repository.tools", + org.eclipse.equinox.p2.repository.tools, + org.eclipse.equinox.p2.repository", org.eclipse.equinox.internal.provisional.p2.core.eventbus; x-friends:="org.eclipse.equinox.p2.metadata, org.eclipse.equinox.p2.metadata.generator, @@ -90,7 +91,8 @@ Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equ org.eclipse.equinox.p2.artifact.repository, org.eclipse.equinox.p2.touchpoint.eclipse, org.eclipse.equinox.p2.touchpoint.natives, - org.eclipse.equinox.p2.publisher", + org.eclipse.equinox.p2.publisher, + org.eclipse.equinox.p2.repository", org.eclipse.equinox.internal.provisional.p2.core.location; x-friends:="org.eclipse.equinox.p2.artifact.repository, org.eclipse.equinox.p2.touchpoint.natives, @@ -98,35 +100,6 @@ Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equ org.eclipse.equinox.p2.director, org.eclipse.equinox.p2.engine, org.eclipse.equinox.p2.touchpoint.eclipse", - org.eclipse.equinox.internal.provisional.p2.core.repository; - x-friends:="org.eclipse.equinox.p2.artifact.optimizers, - org.eclipse.equinox.p2.artifact.processors, - org.eclipse.equinox.p2.artifact.repository, - org.eclipse.equinox.p2.core, - org.eclipse.equinox.p2.director, - org.eclipse.equinox.p2.engine, - org.eclipse.equinox.p2.exemplarysetup, - org.eclipse.equinox.p2.extensionlocation, - org.eclipse.equinox.p2.garbagecollector, - org.eclipse.equinox.p2.installer, - org.eclipse.equinox.p2.jarprocessor, - org.eclipse.equinox.p2.metadata, - org.eclipse.equinox.p2.metadata.generator, - org.eclipse.equinox.p2.metadata.repository, - org.eclipse.equinox.p2.reconciler.dropins, - org.eclipse.equinox.p2.touchpoint.eclipse, - org.eclipse.equinox.p2.touchpoint.natives, - org.eclipse.equinox.p2.ui, - org.eclipse.equinox.p2.ui.admin, - org.eclipse.equinox.p2.ui.admin.rcp, - org.eclipse.equinox.p2.ui.sdk, - org.eclipse.equinox.p2.updatechecker, - org.eclipse.equinox.p2.updatesite, - org.eclipse.equinox.p2.console, - org.eclipse.equinox.p2.directorywatcher, - org.eclipse.equinox.p2.publisher, - org.eclipse.equinox.p2.director.app, - org.eclipse.equinox.p2.repository.tools", org.eclipse.equinox.internal.provisional.p2.query; x-friends:="org.eclipse.equinox.p2.artifact.optimizers, org.eclipse.equinox.p2.artifact.processors, @@ -156,13 +129,7 @@ Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equ org.eclipse.equinox.p2.console, org.eclipse.equinox.p2.publisher, org.eclipse.pde.ui, - org.eclipse.equinox.p2.repository.tools", - org.eclipse.equinox.internal.provisional.spi.p2.core.repository; - x-friends:="org.eclipse.equinox.p2.artifact.repository, - org.eclipse.equinox.p2.metadata.repository, - org.eclipse.equinox.p2.extensionlocation, - org.eclipse.equinox.p2.updatesite, - org.eclipse.equinox.p2.engine" + org.eclipse.equinox.p2.repository.tools" Eclipse-LazyStart: true Bundle-ClassPath: . Bundle-RequiredExecutionEnvironment: J2SE-1.4, diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java deleted file mode 100644 index df5002d62..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java +++ /dev/null @@ -1,955 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.core.helpers; - -import java.lang.ref.SoftReference; -import java.net.*; -import java.util.*; -import org.eclipse.core.runtime.*; -import org.eclipse.core.runtime.preferences.IPreferencesService; -import org.eclipse.equinox.internal.p2.core.Activator; -import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; -import org.eclipse.equinox.internal.provisional.p2.core.eventbus.ProvisioningListener; -import org.eclipse.equinox.internal.provisional.p2.core.repository.*; -import org.eclipse.osgi.util.NLS; -import org.osgi.service.prefs.BackingStoreException; -import org.osgi.service.prefs.Preferences; - -/** - * Common code shared between artifact and metadata repository managers. - */ -public abstract class AbstractRepositoryManager implements IRepositoryManager, ProvisioningListener { - protected static class RepositoryInfo { - public String description; - public boolean isEnabled = true; - public boolean isSystem = false; - public URI location; - public String name; - public String nickname; - public SoftReference repository; - public String suffix; - - public RepositoryInfo() { - super(); - } - } - - public static final String ATTR_SUFFIX = "suffix"; //$NON-NLS-1$ - public static final String EL_FACTORY = "factory"; //$NON-NLS-1$ - public static final String EL_FILTER = "filter"; //$NON-NLS-1$ - public static final String KEY_DESCRIPTION = "description"; //$NON-NLS-1$ - public static final String KEY_ENABLED = "enabled"; //$NON-NLS-1$ - public static final String KEY_NAME = "name"; //$NON-NLS-1$ - public static final String KEY_NICKNAME = "nickname"; //$NON-NLS-1$ - public static final String KEY_PROVIDER = "provider"; //$NON-NLS-1$ - public static final String KEY_SUFFIX = "suffix"; //$NON-NLS-1$ - public static final String KEY_SYSTEM = "isSystem"; //$NON-NLS-1$ - public static final String KEY_TYPE = "type"; //$NON-NLS-1$ - public static final String KEY_URI = "uri"; //$NON-NLS-1$ - public static final String KEY_URL = "url"; //$NON-NLS-1$ - public static final String KEY_VERSION = "version"; //$NON-NLS-1$ - - public static final String NODE_REPOSITORIES = "repositories"; //$NON-NLS-1$ - - /** - * Map of String->RepositoryInfo, where String is the repository key - * obtained via getKey(URI). - */ - protected Map repositories = null; - - //lock object to be held when referring to the repositories field - protected final Object repositoryLock = new Object(); - - /** - * Cache List of repositories that are not reachable. Maintain cache - * for short duration because repository may become available at any time. - */ - protected SoftReference unavailableRepositories; - - /** - * Set used to manage exclusive load locks on repository locations. - */ - private Map loadLocks = new HashMap(); - - protected AbstractRepositoryManager() { - IProvisioningEventBus bus = (IProvisioningEventBus) ServiceHelper.getService(Activator.getContext(), IProvisioningEventBus.SERVICE_NAME); - if (bus != null) - bus.addListener(this); - } - - /** - * Adds a repository to the list of known repositories - * @param repository the repository object to add - * @param signalAdd whether a repository change event should be fired - * @param suffix the suffix used to load the repository, or <code>null</code> if unknown - */ - protected void addRepository(IRepository repository, boolean signalAdd, String suffix) { - boolean added = false; - synchronized (repositoryLock) { - if (repositories == null) - restoreRepositories(); - String key = getKey(repository.getLocation()); - RepositoryInfo info = (RepositoryInfo) repositories.get(key); - if (info == null) { - info = new RepositoryInfo(); - added = true; - repositories.put(key, info); - } - info.repository = new SoftReference(repository); - info.name = repository.getName(); - info.description = repository.getDescription(); - info.location = repository.getLocation(); - String value = (String) repository.getProperties().get(IRepository.PROP_SYSTEM); - if (value != null) - info.isSystem = Boolean.valueOf(value).booleanValue(); - info.suffix = suffix; - } - // save the given repository in the preferences. - remember(repository, suffix); - if (added && signalAdd) - broadcastChangeEvent(repository.getLocation(), IRepository.TYPE_METADATA, RepositoryEvent.ADDED, true); - } - - /* (non-Javadoc) - * @see org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager#addRepository(java.net.URI) - */ - public void addRepository(URI location) { - //add the repository, or enable it if already known - if (!addRepository(location, true, true)) - setEnabled(location, true); - } - - /** - * Adds the repository to the list of known repositories. - * @param location The repository location - * @param isEnabled Whether the repository should be enabled - * @param signalAdd Whether a repository add event should be broadcast - * @return <code>true</code> if the repository was actually added, and - * <code>false</code> otherwise. - */ - private boolean addRepository(URI location, boolean isEnabled, boolean signalAdd) { - RepositoryInfo info = new RepositoryInfo(); - info.location = location; - info.isEnabled = isEnabled; - boolean added = true; - synchronized (repositoryLock) { - if (repositories == null) - restoreRepositories(); - if (contains(location)) - return false; - added = repositories.put(getKey(location), info) == null; - // save the given repository in the preferences. - remember(info, true); - } - if (added && signalAdd) - broadcastChangeEvent(location, getRepositoryType(), RepositoryEvent.ADDED, isEnabled); - return added; - } - - protected IRepository basicGetRepository(URI location) { - synchronized (repositoryLock) { - if (repositories == null) - restoreRepositories(); - RepositoryInfo info = (RepositoryInfo) repositories.get(getKey(location)); - if (info == null || info.repository == null) - return null; - IRepository repo = (IRepository) info.repository.get(); - //update our repository info because the repository may have changed - if (repo != null) - addRepository(repo, false, null); - return repo; - } - } - - public IRepository basicRefreshRepository(URI location, IProgressMonitor monitor) throws ProvisionException { - clearNotFound(location); - boolean wasEnabled = isEnabled(location); - //remove the repository so event is broadcast and repositories can clear their caches - if (!removeRepository(location)) - fail(location, ProvisionException.REPOSITORY_NOT_FOUND); - boolean loaded = false; - try { - IRepository result = loadRepository(location, monitor, null, 0); - loaded = true; - setEnabled(location, wasEnabled); - return result; - } finally { - //if we failed to load, make sure the repository is not lost - if (!loaded) - addRepository(location, wasEnabled, true); - } - } - - private void broadcastChangeEvent(URI location, int repositoryType, int kind, boolean isEnabled) { - IProvisioningEventBus bus = (IProvisioningEventBus) ServiceHelper.getService(Activator.getContext(), IProvisioningEventBus.class.getName()); - if (bus != null) - bus.publishEvent(new RepositoryEvent(location, repositoryType, kind, isEnabled)); - } - - /** - * Check if we recently attempted to load the given location and failed - * to find anything. Returns <code>true</code> if the repository was not - * found, and <code>false</code> otherwise. - */ - private boolean checkNotFound(URI location) { - if (unavailableRepositories == null) - return false; - List badRepos = (List) unavailableRepositories.get(); - if (badRepos == null) - return false; - return badRepos.contains(location); - } - - /** - * Clear the fact that we tried to load a repository at this location and did not find anything. - */ - protected void clearNotFound(URI location) { - List badRepos; - if (unavailableRepositories != null) { - badRepos = (List) unavailableRepositories.get(); - if (badRepos != null) { - badRepos.remove(location); - return; - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager#contains(java.net.URI) - */ - public boolean contains(URI location) { - synchronized (repositoryLock) { - if (repositories == null) - restoreRepositories(); - return repositories.containsKey(getKey(location)); - } - } - - /* (non-Javadoc) - * @see org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager#createRepository(java.net.URL, java.lang.String, java.lang.String, java.util.Map) - */ - protected IRepository doCreateRepository(URI location, String name, String type, Map properties) throws ProvisionException { - Assert.isNotNull(name); - Assert.isNotNull(type); - IRepository result = null; - try { - enterLoad(location); - boolean loaded = false; - try { - //repository should not already exist - loadRepository(location, (IProgressMonitor) null, type, 0); - loaded = true; - } catch (ProvisionException e) { - //expected - fall through and create the new repository - } - if (loaded) - fail(location, ProvisionException.REPOSITORY_EXISTS); - - IExtension extension = RegistryFactory.getRegistry().getExtension(getRepositoryProviderExtensionPointId(), type); - if (extension == null) - fail(location, ProvisionException.REPOSITORY_UNKNOWN_TYPE); - // MetadataRepositoryFactory factory = (MetadataRepositoryFactory) createExecutableExtension(extension, EL_FACTORY); - // if (factory == null) - // fail(location, ProvisionException.REPOSITORY_FAILED_READ); - result = factoryCreate(location, name, type, properties, extension); - if (result == null) - fail(location, ProvisionException.REPOSITORY_FAILED_READ); - clearNotFound(location); - addRepository(result, false, null); - } finally { - exitLoad(location); - } - //fire event after releasing load lock - broadcastChangeEvent(location, getRepositoryType(), RepositoryEvent.ADDED, true); - return result; - } - - /** - * Returns the executable extension, or <code>null</code> if there - * was no corresponding extension, or an error occurred loading it - */ - protected Object createExecutableExtension(IExtension extension, String element) { - IConfigurationElement[] elements = extension.getConfigurationElements(); - CoreException failure = null; - for (int i = 0; i < elements.length; i++) { - if (elements[i].getName().equals(element)) { - try { - return elements[i].createExecutableExtension("class"); //$NON-NLS-1$ - } catch (CoreException e) { - log("Error loading repository extension: " + extension.getUniqueIdentifier(), failure); //$NON-NLS-1$ - return null; - } - } - } - log("Malformed repository extension: " + extension.getUniqueIdentifier(), null); //$NON-NLS-1$ - return null; - } - - /** - * Obtains an exclusive right to load a repository at the given location. Blocks - * if another thread is currently loading at that location. Invocation of this - * method must be followed by a subsequent call to {@link #exitLoad(URI)}. - * - * To avoid deadlock between the loadLock and repositoryLock, this method - * must not be called when repositoryLock is held. - * - * @param location The location to lock - */ - private void enterLoad(URI location) { - Thread current = Thread.currentThread(); - synchronized (loadLocks) { - while (true) { - Thread owner = (Thread) loadLocks.get(location); - if (owner == null || current.equals(owner)) - break; - try { - loadLocks.wait(); - } catch (InterruptedException e) { - //keep trying - } - } - loadLocks.put(location, current); - } - } - - /** - * Relinquishes the exclusive right to load a repository at the given location. Unblocks - * other threads waiting to load at that location. - * @param location The location to unlock - */ - private void exitLoad(URI location) { - synchronized (loadLocks) { - loadLocks.remove(location); - loadLocks.notifyAll(); - } - } - - /** - * Creates and returns a repository using the given repository factory extension. Returns - * null if no factory could be found associated with that extension. - */ - protected abstract IRepository factoryCreate(URI location, String name, String type, Map properties, IExtension extension) throws ProvisionException; - - /** - * Loads and returns a repository using the given repository factory extension. Returns - * null if no factory could be found associated with that extension. - */ - protected abstract IRepository factoryLoad(URI location, IExtension extension, int flags, SubMonitor monitor) throws ProvisionException; - - protected void fail(URI location, int code) throws ProvisionException { - String msg = null; - switch (code) { - case ProvisionException.REPOSITORY_EXISTS : - msg = NLS.bind(Messages.repoMan_exists, location); - break; - case ProvisionException.REPOSITORY_UNKNOWN_TYPE : - msg = NLS.bind(Messages.repoMan_unknownType, location); - break; - case ProvisionException.REPOSITORY_FAILED_READ : - msg = NLS.bind(Messages.repoMan_failedRead, location); - break; - case ProvisionException.REPOSITORY_NOT_FOUND : - msg = NLS.bind(Messages.repoMan_notExists, location); - break; - } - if (msg == null) - msg = Messages.repoMan_internalError; - throw new ProvisionException(new Status(IStatus.ERROR, getBundleId(), code, msg, null)); - } - - protected IExtension[] findMatchingRepositoryExtensions(String suffix, String type) { - IConfigurationElement[] elt = null; - if (type != null && type.length() > 0) { - IExtension ext = RegistryFactory.getRegistry().getExtension(getRepositoryProviderExtensionPointId(), type); - elt = (ext != null) ? ext.getConfigurationElements() : new IConfigurationElement[0]; - } else { - elt = RegistryFactory.getRegistry().getConfigurationElementsFor(getRepositoryProviderExtensionPointId()); - } - int count = 0; - for (int i = 0; i < elt.length; i++) { - if (EL_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; - } - - protected String[] getAllSuffixes() { - IConfigurationElement[] elements = RegistryFactory.getRegistry().getConfigurationElementsFor(getRepositoryProviderExtensionPointId()); - ArrayList result = new ArrayList(elements.length); - result.add(getDefaultSuffix()); - for (int i = 0; i < elements.length; i++) { - if (elements[i].getName().equals(EL_FILTER)) { - String suffix = elements[i].getAttribute(ATTR_SUFFIX); - if (!result.contains(suffix)) - result.add(suffix); - } - } - return (String[]) result.toArray(new String[result.size()]); - } - - /** - * Returns the bundle id of the bundle that provides the concrete repository manager - * @return a symbolic bundle id - */ - protected abstract String getBundleId(); - - /** - * Returns the default repository suffix. This is used to ensure a particular - * repository type is preferred over all others. - */ - protected abstract String getDefaultSuffix(); - - /* - * Return a string key based on the given repository location which - * is suitable for use as a preference node name. - * TODO: convert local file system URI to canonical form - */ - private String getKey(URI location) { - String key = location.toString().replace('/', '_'); - //remove trailing slash - if (key.endsWith("_")) //$NON-NLS-1$ - key = key.substring(0, key.length() - 1); - return key; - } - - /* (non-Javadoc) - * @see org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager#getKnownRepositories(int) - */ - public URI[] getKnownRepositories(int flags) { - synchronized (repositoryLock) { - if (repositories == null) - restoreRepositories(); - ArrayList result = new ArrayList(); - int i = 0; - for (Iterator it = repositories.values().iterator(); it.hasNext(); i++) { - RepositoryInfo info = (RepositoryInfo) it.next(); - if (matchesFlags(info, flags)) - result.add(info.location); - } - return (URI[]) result.toArray(new URI[result.size()]); - } - } - - /** - * Return the preference node which is the root for where we store the repository information. - */ - Preferences getPreferences() { - IPreferencesService prefService = (IPreferencesService) ServiceHelper.getService(Activator.getContext(), IPreferencesService.class.getName()); - - try { - return prefService.getRootNode().node("/profile/_SELF_/" + getBundleId() + "/" + NODE_REPOSITORIES); //$NON-NLS-1$ //$NON-NLS-2$ - } catch (IllegalArgumentException e) { - return null; - } - } - - /** - * Restores a repository location from the preferences. - */ - private URI getRepositoryLocation(Preferences node) { - //prefer the location stored in URI form - String locationString = node.get(KEY_URI, null); - try { - if (locationString != null) - return new URI(locationString); - } catch (URISyntaxException e) { - log("Error while restoring repository: " + locationString, e); //$NON-NLS-1$ - } - //we used to store the repository as a URL, so try old key for backwards compatibility - locationString = node.get(KEY_URL, null); - try { - if (locationString != null) - return URIUtil.toURI(new URL(locationString)); - } catch (MalformedURLException e) { - log("Error while restoring repository: " + locationString, e); //$NON-NLS-1$ - } catch (URISyntaxException e) { - log("Error while restoring repository: " + locationString, e); //$NON-NLS-1$ - } - return null; - } - - /*(non-Javadoc) - * @see org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager#getRepositoryProperty(java.net.URI, java.lang.String) - */ - public String getRepositoryProperty(URI location, String key) { - synchronized (repositoryLock) { - if (repositories == null) - restoreRepositories(); - RepositoryInfo info = (RepositoryInfo) repositories.get(getKey(location)); - if (info == null) - return null;// Repository not found - if (IRepository.PROP_DESCRIPTION.equals(key)) - return info.description; - else if (IRepository.PROP_NAME.equals(key)) - return info.name; - else if (IRepository.PROP_SYSTEM.equals(key)) - return Boolean.toString(info.isSystem); - else if (IRepository.PROP_NICKNAME.equals(key)) - return info.nickname; - // Key not known, return null - return null; - } - } - - /*(non-Javadoc) - * @see org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager#getRepositoryProperty(java.net.URI, java.lang.String) - */ - public void setRepositoryProperty(URI location, String key, String value) { - synchronized (repositoryLock) { - if (repositories == null) - restoreRepositories(); - RepositoryInfo info = (RepositoryInfo) repositories.get(getKey(location)); - if (info == null) - return;// Repository not found - if (IRepository.PROP_DESCRIPTION.equals(key)) - info.description = value; - else if (IRepository.PROP_NAME.equals(key)) - info.name = value; - else if (IRepository.PROP_NICKNAME.equals(key)) - info.nickname = value; - else if (IRepository.PROP_SYSTEM.equals(key)) - //only true if value.equals("true") which is OK because a repository is only system if it's explicitly set to system. - info.isSystem = Boolean.valueOf(value).booleanValue(); - remember(info, true); - } - } - - /** - * Returns the fully qualified id of the repository provider extension point. - */ - protected abstract String getRepositoryProviderExtensionPointId(); - - /** - * Returns the system property used to specify additional repositories to be - * automatically added to the list of known repositories. - */ - protected abstract String getRepositorySystemProperty(); - - /** - * Returns the repository type stored in this manager. - */ - protected abstract int getRepositoryType(); - - /* (non-Javadoc) - * @see org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager#isEnabled(java.net.URI) - */ - public boolean isEnabled(URI location) { - synchronized (repositoryLock) { - if (repositories == null) - restoreRepositories(); - RepositoryInfo info = (RepositoryInfo) repositories.get(getKey(location)); - if (info != null) - return info.isEnabled; - // Repository not found, return false - return false; - } - } - - protected IRepository loadRepository(URI location, IProgressMonitor monitor, String type, int flags) throws ProvisionException { - boolean added = false; - IRepository result = null; - - try { - enterLoad(location); - result = basicGetRepository(location); - if (result != null) - return result; - if (checkNotFound(location)) - fail(location, ProvisionException.REPOSITORY_NOT_FOUND); - //add the repository first so that it will be enabled, but don't send add event until after the load - added = addRepository(location, true, false); - String[] suffixes = sortSuffixes(getAllSuffixes(), location); - SubMonitor sub = SubMonitor.convert(monitor, NLS.bind(Messages.repoMan_adding, location), suffixes.length * 100); - ProvisionException failure = null; - try { - for (int i = 0; i < suffixes.length; i++) { - if (sub.isCanceled()) - throw new OperationCanceledException(); - try { - result = loadRepository(location, suffixes[i], type, flags, sub.newChild(100)); - } catch (ProvisionException e) { - failure = e; - break; - } - if (result != null) { - addRepository(result, false, suffixes[i]); - break; - } - } - } finally { - sub.done(); - } - if (result == null) { - //if we just added the repository, remove it because it cannot be loaded - if (added) - removeRepository(location, false); - //eagerly cleanup missing system repositories - if (Boolean.valueOf(getRepositoryProperty(location, IRepository.PROP_SYSTEM)).booleanValue()) - removeRepository(location); - else - rememberNotFound(location); - if (failure != null) - throw failure; - fail(location, ProvisionException.REPOSITORY_NOT_FOUND); - } - } finally { - exitLoad(location); - } - //broadcast the add event after releasing lock - if (added) - broadcastChangeEvent(location, IRepository.TYPE_METADATA, RepositoryEvent.ADDED, true); - return result; - } - - private IRepository loadRepository(URI location, String suffix, String type, int flags, SubMonitor monitor) throws ProvisionException { - IExtension[] providers = findMatchingRepositoryExtensions(suffix, type); - // Loop over the candidates and return the first one that successfully loads - monitor.beginTask("", providers.length * 10); //$NON-NLS-1$ - for (int i = 0; i < providers.length; i++) - try { - IRepository repo = factoryLoad(location, providers[i], flags, monitor); - if (repo != null) - return repo; - } catch (ProvisionException e) { - if (e.getStatus().getCode() != ProvisionException.REPOSITORY_NOT_FOUND) - throw e; - } catch (Exception e) { - //catch and log unexpected errors and move onto the next factory - log("Unexpected error loading extension: " + providers[i].getUniqueIdentifier(), e); //$NON-NLS-1$ - } catch (LinkageError e) { - //catch and log unexpected errors and move onto the next factory - log("Unexpected error loading extension: " + providers[i].getUniqueIdentifier(), e); //$NON-NLS-1$ - } - return null; - } - - protected void log(String message, Throwable t) { - LogHelper.log(new Status(IStatus.ERROR, getBundleId(), message, t)); - } - - private boolean matchesFlags(RepositoryInfo info, int flags) { - if ((flags & REPOSITORIES_SYSTEM) == REPOSITORIES_SYSTEM) - if (!info.isSystem) - return false; - if ((flags & REPOSITORIES_NON_SYSTEM) == REPOSITORIES_NON_SYSTEM) - if (info.isSystem) - return false; - if ((flags & REPOSITORIES_DISABLED) == REPOSITORIES_DISABLED) { - if (info.isEnabled) - return false; - } else { - //ignore disabled repositories for all other flag types - if (!info.isEnabled) - return false; - } - if ((flags & REPOSITORIES_LOCAL) == REPOSITORIES_LOCAL) - return "file".equals(info.location.getScheme()); //$NON-NLS-1$ - return true; - } - - /*(non-Javadoc) - * @see org.eclipse.equinox.internal.provisional.p2.core.eventbus.ProvisioningListener#notify(java.util.EventObject) - */ - public void notify(EventObject o) { - if (o instanceof RepositoryEvent) { - RepositoryEvent event = (RepositoryEvent) o; - if (event.getKind() == RepositoryEvent.DISCOVERED && event.getRepositoryType() == getRepositoryType()) - addRepository(event.getRepositoryLocation(), event.isRepositoryEnabled(), true); - } - } - - /** - * Sets a preference and returns <code>true</code> if the preference - * was actually changed. - */ - protected boolean putValue(Preferences node, String key, String newValue) { - String oldValue = node.get(key, null); - if (oldValue == newValue || (oldValue != null && oldValue.equals(newValue))) - return false; - if (newValue == null) - node.remove(key); - else - node.put(key, newValue); - return true; - } - - /* - * Add the given repository object to the preferences and save. - */ - private void remember(IRepository repository, String suffix) { - boolean changed = false; - Preferences node = getPreferences(); - // Ensure we retrieved preferences - if (node == null) - return; - node = node.node(getKey(repository.getLocation())); - - try { - changed |= putValue(node, KEY_URI, repository.getLocation().toString()); - changed |= putValue(node, KEY_URL, null); - changed |= putValue(node, KEY_DESCRIPTION, repository.getDescription()); - changed |= putValue(node, KEY_NAME, repository.getName()); - changed |= putValue(node, KEY_PROVIDER, repository.getProvider()); - changed |= putValue(node, KEY_TYPE, repository.getType()); - changed |= putValue(node, KEY_VERSION, repository.getVersion()); - changed |= putValue(node, KEY_SYSTEM, (String) repository.getProperties().get(IRepository.PROP_SYSTEM)); - changed |= putValue(node, KEY_SUFFIX, suffix); - if (changed) - saveToPreferences(); - } catch (IllegalStateException e) { - //the repository was removed concurrently, so we don't need to save it - } - } - - /** - * Writes the state of the repository information into the appropriate preference node. - * - * @param info The info to write to the preference node - * @param flush <code>true</code> if the preference node should be flushed to - * disk, and <code>false</code> otherwise - */ - private boolean remember(RepositoryInfo info, boolean flush) { - boolean changed = false; - Preferences node = getPreferences(); - // Ensure we retrieved preferences - if (node == null) - return changed; - node = node.node(getKey(info.location)); - try { - changed |= putValue(node, KEY_URI, info.location.toString()); - changed |= putValue(node, KEY_URL, null); - changed |= putValue(node, KEY_SYSTEM, Boolean.toString(info.isSystem)); - changed |= putValue(node, KEY_DESCRIPTION, info.description); - changed |= putValue(node, KEY_NAME, info.name); - changed |= putValue(node, KEY_NICKNAME, info.nickname); - changed |= putValue(node, KEY_SUFFIX, info.suffix); - changed |= putValue(node, KEY_ENABLED, Boolean.toString(info.isEnabled)); - if (changed && flush) - saveToPreferences(); - return changed; - } catch (IllegalStateException e) { - //the repository was removed concurrently, so we don't need to save it - return false; - } - } - - /** - * Cache the fact that we tried to load a repository at this location and did not find anything. - */ - private void rememberNotFound(URI location) { - List badRepos; - if (unavailableRepositories != null) { - badRepos = (List) unavailableRepositories.get(); - if (badRepos != null) { - badRepos.add(location); - return; - } - } - badRepos = new ArrayList(); - badRepos.add(location); - unavailableRepositories = new SoftReference(badRepos); - } - - public boolean removeRepository(URI toRemove) { - return removeRepository(toRemove, true); - } - - private boolean removeRepository(URI toRemove, boolean signalRemove) { - Assert.isNotNull(toRemove); - final String repoKey = getKey(toRemove); - synchronized (repositoryLock) { - if (repositories == null) - restoreRepositories(); - if (repositories.remove(repoKey) == null) - return false; - } - // remove the repository from the preference store - try { - if (Tracing.DEBUG_REMOVE_REPO) { - String msg = "Removing repository: " + toRemove; //$NON-NLS-1$ - Tracing.debug(msg); - new Exception(msg).printStackTrace(); - } - Preferences node = getPreferences(); - if (node != null) { - getPreferences().node(repoKey).removeNode(); - saveToPreferences(); - } - clearNotFound(toRemove); - } catch (BackingStoreException e) { - log("Error saving preferences", e); //$NON-NLS-1$ - } - //TODO: compute and pass appropriate isEnabled flag - if (signalRemove) - broadcastChangeEvent(toRemove, getRepositoryType(), RepositoryEvent.REMOVED, true); - return true; - } - - /* - * Load the list of repositories from the preferences. - */ - private void restoreFromPreferences() { - // restore the list of repositories from the preference store - Preferences node = getPreferences(); - if (node == null) - return; - 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]); - URI location = getRepositoryLocation(child); - if (location == null) - continue; - RepositoryInfo info = new RepositoryInfo(); - info.location = location; - info.name = child.get(KEY_NAME, null); - info.nickname = child.get(KEY_NICKNAME, null); - info.description = child.get(KEY_DESCRIPTION, null); - info.isSystem = child.getBoolean(KEY_SYSTEM, false); - info.isEnabled = child.getBoolean(KEY_ENABLED, true); - info.suffix = child.get(KEY_SUFFIX, null); - repositories.put(getKey(info.location), info); - } - // now that we have loaded everything, remember them - saveToPreferences(); - } - - private void restoreFromSystemProperty() { - String locationString = Activator.getContext().getProperty(getRepositorySystemProperty()); - if (locationString != null) { - StringTokenizer tokenizer = new StringTokenizer(locationString, ","); //$NON-NLS-1$ - while (tokenizer.hasMoreTokens()) { - try { - addRepository(new URI(tokenizer.nextToken()), true, true); - } catch (URISyntaxException e) { - log("Error while restoring repository " + locationString, e); //$NON-NLS-1$ - } - } - } - } - - /** - * Restores the repository list. - */ - private void restoreRepositories() { - synchronized (repositoryLock) { - repositories = new HashMap(); - restoreSpecialRepositories(); - restoreFromSystemProperty(); - restoreFromPreferences(); - } - } - - /** - * Hook method to restore special additional repositories. - */ - protected void restoreSpecialRepositories() { - //by default no special repositories - } - - /* - * Save the list of repositories to the file-system. - */ - private void saveToPreferences() { - try { - Preferences node = getPreferences(); - if (node != null) - node.flush(); - } catch (BackingStoreException e) { - log("Error while saving repositories in preferences", e); //$NON-NLS-1$ - } - } - - /* (non-Javadoc) - * @see org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager#setEnabled(java.net.URI, boolean) - */ - public void setEnabled(URI location, boolean enablement) { - synchronized (repositoryLock) { - if (repositories == null) - restoreRepositories(); - RepositoryInfo info = (RepositoryInfo) repositories.get(getKey(location)); - if (info == null || info.isEnabled == enablement) - return; - info.isEnabled = enablement; - remember(info, true); - } - broadcastChangeEvent(location, getRepositoryType(), RepositoryEvent.ENABLEMENT, enablement); - } - - /** - * Shuts down the repository manager. - */ - public void shutdown() { - IProvisioningEventBus bus = (IProvisioningEventBus) ServiceHelper.getService(Activator.getContext(), IProvisioningEventBus.SERVICE_NAME); - if (bus != null) - bus.removeListener(this); - //ensure all repository state in memory is written to disk - boolean changed = false; - synchronized (repositoryLock) { - if (repositories != null) { - for (Iterator it = repositories.values().iterator(); it.hasNext();) { - RepositoryInfo info = (RepositoryInfo) it.next(); - changed |= remember(info, false); - } - } - } - if (changed) { - if (Tracing.DEBUG) - Tracing.debug("Unsaved preferences when shutting down " + getClass().getName()); //$NON-NLS-1$ - saveToPreferences(); - } - repositories = null; - unavailableRepositories = null; - } - - /** - * Optimize the order in which repository suffixes are searched by trying - * the last successfully loaded suffix first. - */ - private String[] sortSuffixes(String[] suffixes, URI location) { - synchronized (repositoryLock) { - if (repositories == null) - restoreRepositories(); - RepositoryInfo info = (RepositoryInfo) repositories.get(getKey(location)); - if (info == null || info.suffix == null) - return suffixes; - //move lastSuffix to the front of the list but preserve order of remaining entries - String lastSuffix = info.suffix; - for (int i = 0; i < suffixes.length; i++) { - if (lastSuffix.equals(suffixes[i])) { - System.arraycopy(suffixes, 0, suffixes, 1, i); - suffixes[0] = lastSuffix; - return suffixes; - } - } - } - return suffixes; - } - -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/Messages.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/Messages.java index 6a875f75d..8bf01043a 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/Messages.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/Messages.java @@ -25,14 +25,6 @@ class Messages extends NLS { // Do not instantiate } - public static String repoMan_adding; - public static String repoMan_exists; - public static String repoMan_failedRead; - public static String repoMan_internalError; - public static String repoMan_notExists; - public static String repoMan_save; - public static String repoMan_unknownType; - 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/internal/p2/core/helpers/messages.properties b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/messages.properties index d97e16f1e..f3cafadff 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/messages.properties +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/messages.properties @@ -9,13 +9,5 @@ # IBM Corporation - initial API and implementation ############################################################################### -repoMan_adding = Adding repository {0} -repoMan_exists=Repository already exists at {0}. -repoMan_failedRead=The repository could not be read: {0}. -repoMan_internalError=Internal error. -repoMan_notExists=No repository found at {0}. -repoMan_save=Saving repository settings -repoMan_unknownType=Unknown repository type at {0}. - 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/internal/p2/persistence/CompositeParser.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/CompositeParser.java deleted file mode 100644 index 0d654e3f5..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/CompositeParser.java +++ /dev/null @@ -1,214 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.persistence; - -import java.io.*; -import java.net.URI; -import java.util.*; -import javax.xml.parsers.ParserConfigurationException; -import org.eclipse.equinox.internal.p2.core.helpers.OrderedProperties; -import org.eclipse.equinox.internal.provisional.p2.core.Version; -import org.eclipse.equinox.internal.provisional.p2.core.VersionRange; -import org.eclipse.osgi.util.NLS; -import org.osgi.framework.BundleContext; -import org.xml.sax.*; - -/* - * Class used to read a composite repository. - */ -public class CompositeParser extends XMLParser implements XMLConstants { - - private static final Version CURRENT_VERSION = new Version(1, 0, 0); - static final VersionRange XML_TOLERANCE = new VersionRange(CURRENT_VERSION, true, new Version(2, 0, 0), false); - private static final String REQUIRED_CAPABILITY_ELEMENT = "required"; //$NON-NLS-1$ - private static final String REPOSITORY_ELEMENT = "repository"; //$NON-NLS-1$ - String repositoryType; - private CompositeRepositoryState theState; - - protected class ChildrenHandler extends AbstractHandler { - private ArrayList children; - - public ChildrenHandler(AbstractHandler parentHandler, Attributes attributes) { - super(parentHandler, CHILDREN_ELEMENT); - String size = parseOptionalAttribute(attributes, COLLECTION_SIZE_ATTRIBUTE); - children = (size != null ? new ArrayList(new Integer(size).intValue()) : new ArrayList(4)); - } - - public URI[] getChildren() { - int size = children.size(); - URI[] result = new URI[size]; - int i = 0; - for (Iterator it = children.iterator(); it.hasNext(); i++) { - result[i] = (URI) it.next(); - } - return result; - } - - public void startElement(String name, Attributes attributes) { - if (name.equals(CHILD_ELEMENT)) { - new ChildHandler(this, attributes, children); - } else { - invalidElement(name, attributes); - } - } - } - - protected class ChildHandler extends AbstractHandler { - private final String[] required = new String[] {LOCATION_ELEMENT}; - private final String[] optional = new String[] {}; - - URI currentRepo = null; - - private List repos; - - public ChildHandler(AbstractHandler parentHandler, Attributes attributes, List repos) { - super(parentHandler, CHILD_ELEMENT); - String[] values = parseAttributes(attributes, required, optional); - this.repos = repos; - //skip entire subrepository if the location is missing - if (values[0] == null) - return; - currentRepo = checkURI(REQUIRED_CAPABILITY_ELEMENT, URI_ATTRIBUTE, values[0]); - - } - - public void startElement(String name, Attributes attributes) { - checkCancel(); - } - - protected void finished() { - if (currentRepo != null) - repos.add(currentRepo); - } - } - - private final class RepositoryDocHandler extends DocHandler { - - public RepositoryDocHandler(String rootName, RootHandler rootHandler) { - super(rootName, rootHandler); - } - - public void processingInstruction(String target, String data) throws SAXException { - if (repositoryType.equals(target)) { - Version repositoryVersion = extractPIVersion(target, data); - if (!XML_TOLERANCE.isIncluded(repositoryVersion)) { - throw new SAXException(NLS.bind(Messages.io_IncompatibleVersion, repositoryVersion, XML_TOLERANCE)); - } - } - } - } - - /* - * Handler for the "repository" attribute. - */ - private final class RepositoryHandler extends RootHandler { - - private final String[] required = new String[] {NAME_ATTRIBUTE, TYPE_ATTRIBUTE, VERSION_ATTRIBUTE}; - private final String[] optional = new String[] {DESCRIPTION_ATTRIBUTE, PROVIDER_ATTRIBUTE}; - private PropertiesHandler propertiesHandler = null; - private ChildrenHandler childrenHandler = null; - private CompositeRepositoryState state; - private String[] attrValues = new String[required.length + optional.length]; - - public RepositoryHandler() { - super(); - } - - public CompositeRepositoryState getRepository() { - return state; - } - - protected void handleRootAttributes(Attributes attributes) { - attrValues = parseAttributes(attributes, required, optional); - attrValues[2] = checkVersion(REPOSITORY_ELEMENT, VERSION_ATTRIBUTE, attrValues[2]).toString(); - } - - public void startElement(String name, Attributes attributes) { - if (PROPERTIES_ELEMENT.equals(name)) { - if (propertiesHandler == null) { - propertiesHandler = new PropertiesHandler(this, attributes); - } else { - duplicateElement(this, name, attributes); - } - } else if (CHILDREN_ELEMENT.equals(name)) { - if (childrenHandler == null) { - childrenHandler = new ChildrenHandler(this, attributes); - } else { - duplicateElement(this, name, attributes); - } - } else { - invalidElement(name, attributes); - } - } - - /* - * If we parsed valid XML then fill in our repository state object with the parsed data. - */ - protected void finished() { - if (isValidXML()) { - state = new CompositeRepositoryState(); - state.setName(attrValues[0]); - state.setType(attrValues[1]); - state.setVersion(attrValues[2]); - state.setDescription(attrValues[3]); - state.setProvider(attrValues[4]); - state.setProperties((propertiesHandler == null ? new OrderedProperties(0) // - : propertiesHandler.getProperties())); - state.setChildren((childrenHandler == null ? new URI[0] // - : childrenHandler.getChildren())); - } - } - } - - public CompositeParser(BundleContext context, String bundleId, String type) { - super(context, bundleId); - this.repositoryType = type; - } - - public void parse(File file) throws IOException { - parse(new FileInputStream(file)); - } - - public synchronized void parse(InputStream stream) throws IOException { - this.status = null; - try { - // TODO: currently not caching the parser since we make no assumptions - // or restrictions on concurrent parsing - getParser(); - RepositoryHandler repositoryHandler = new RepositoryHandler(); - xmlReader.setContentHandler(new RepositoryDocHandler(REPOSITORY_ELEMENT, repositoryHandler)); - xmlReader.parse(new InputSource(stream)); - if (isValidXML()) { - theState = repositoryHandler.getRepository(); - } - } catch (SAXException e) { - throw new IOException(e.getMessage()); - } catch (ParserConfigurationException e) { - throw new IOException(e.getMessage()); - } finally { - stream.close(); - } - } - - public CompositeRepositoryState getRepositoryState() { - return theState; - } - - //TODO what? - protected Object getRootObject() { - return null; - } - - protected String getErrorMessage() { - return Messages.io_parseError; - } - -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryIO.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryIO.java deleted file mode 100644 index 02319fb52..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryIO.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.persistence; - -import java.io.*; -import java.net.URL; -import org.eclipse.core.runtime.*; -import org.eclipse.equinox.internal.p2.core.Activator; -import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; -import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.osgi.util.NLS; - -/** - * This class reads and writes repository metadata (e.g. table of contents files) - * for composite artifact and metadata repositories. - * <p> - * Note: This class is not used for reading or writing the actual composite repositories. - */ -public class CompositeRepositoryIO { - - /** - * Writes the given repository to the stream. - * This method performs buffering, and closes the stream when finished. - */ - public void write(CompositeRepositoryState repository, OutputStream output, String type) { - OutputStream bufferedOutput = null; - try { - try { - bufferedOutput = new BufferedOutputStream(output); - CompositeWriter repositoryWriter = new CompositeWriter(bufferedOutput, type); - repositoryWriter.write(repository); - } finally { - if (bufferedOutput != null) { - bufferedOutput.close(); - } - } - } catch (IOException ioe) { - // TODO shouldn't this throw a core exception? - ioe.printStackTrace(); - } - } - - /** - * Reads the composite repository from the given stream, - * and returns the contained array of abstract composite repositories. - * - * This method performs buffering, and closes the stream when finished. - */ - public CompositeRepositoryState read(URL location, InputStream input, String type, IProgressMonitor monitor) throws ProvisionException { - BufferedInputStream bufferedInput = null; - try { - try { - bufferedInput = new BufferedInputStream(input); - CompositeParser repositoryParser = new CompositeParser(Activator.getContext(), Activator.ID, type); - repositoryParser.parse(input); - IStatus result = repositoryParser.getStatus(); - switch (result.getSeverity()) { - case IStatus.CANCEL : - throw new OperationCanceledException(); - case IStatus.ERROR : - throw new ProvisionException(result); - case IStatus.WARNING : - case IStatus.INFO : - LogHelper.log(result); - } - CompositeRepositoryState repositoryState = repositoryParser.getRepositoryState(); - if (repositoryState == null) - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, Messages.io_parseError, null)); - return repositoryState; - } finally { - if (bufferedInput != null) - bufferedInput.close(); - } - } catch (IOException ioe) { - String msg = NLS.bind(Messages.io_failedRead, location); - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, ioe)); - } - } -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryState.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryState.java deleted file mode 100644 index 83f7795a6..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryState.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.persistence; - -import java.net.URI; -import java.util.Map; - -/* - * Instances of this class represent a composite repository (either metadata - * or artifact) and are used in persisting or retrieving the repository to/from disk. - */ -public class CompositeRepositoryState { - private String name; - private String type; - private String version; - private String provider; - private String description; - private URI location; - private Map properties; - private URI[] children; - - public void setName(String value) { - name = value; - } - - public String getName() { - return name; - } - - public void setType(String value) { - type = value; - } - - public String getType() { - return type; - } - - public void setVersion(String value) { - version = value; - } - - public String getVersion() { - return version; - } - - public void setProvider(String value) { - provider = value; - } - - public String getProvider() { - return provider; - } - - public void setDescription(String value) { - description = value; - } - - public String getDescription() { - return description; - } - - public void setLocation(URI value) { - location = value; - } - - public URI getLocation() { - return location; - } - - public void setProperties(Map value) { - properties = value; - } - - public Map getProperties() { - return properties; - } - - public void setChildren(URI[] value) { - children = value; - } - - public URI[] getChildren() { - return children; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/CompositeWriter.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/CompositeWriter.java deleted file mode 100644 index 26dd6707f..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/CompositeWriter.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.persistence; - -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import org.eclipse.core.runtime.URIUtil; -import org.eclipse.equinox.internal.provisional.p2.core.Version; - -/* - * Class used to persist a composite repository. - */ -public class CompositeWriter extends XMLWriter implements XMLConstants { - - private static final String REPOSITORY_ELEMENT = "repository"; //$NON-NLS-1$ - private static final Version CURRENT_VERSION = new Version(1, 0, 0); - - public CompositeWriter(OutputStream output, String type) throws UnsupportedEncodingException { - super(output, new XMLWriter.ProcessingInstruction[] {XMLWriter.ProcessingInstruction.makeTargetVersionInstruction(type, CURRENT_VERSION)}); - // TODO: add a processing instruction for the metadata version - } - - /** - * Writes a list of URIs referring to sub repositories - */ - protected void writeChildren(URI[] children) { - if (children == null || children.length == 0) - return; - start(CHILDREN_ELEMENT); - attribute(COLLECTION_SIZE_ATTRIBUTE, children.length); - for (int i = 0; i < children.length; i++) - writeChild(children[i]); - end(CHILDREN_ELEMENT); - } - - protected void writeChild(URI encodedURI) { - String unencodedString = URIUtil.toUnencodedString(encodedURI); - start(CHILD_ELEMENT); - attribute(LOCATION_ELEMENT, unencodedString); - end(CHILD_ELEMENT); - } - - /** - * Write the given composite repository to the output stream. - */ - public void write(CompositeRepositoryState repository) { - start(REPOSITORY_ELEMENT); - attribute(NAME_ATTRIBUTE, repository.getName()); - attribute(TYPE_ATTRIBUTE, repository.getType()); - attribute(VERSION_ATTRIBUTE, repository.getVersion()); - attributeOptional(PROVIDER_ATTRIBUTE, repository.getProvider()); - attributeOptional(DESCRIPTION_ATTRIBUTE, repository.getDescription()); // TODO: could be cdata? - writeProperties(repository.getProperties()); - writeChildren(repository.getChildren()); - end(REPOSITORY_ELEMENT); - flush(); - } - -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/Messages.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/Messages.java deleted file mode 100644 index 3762b39a8..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/Messages.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.persistence; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - - private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.p2.persistence.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 XMLParser_No_SAX_Parser; - public static String XMLParser_Error_At_Line; - public static String XMLParser_Error_At_Line_Column; - public static String XMLParser_Error_At_Name_Line; - public static String XMLParser_Error_At_Name_Line_Column; - public static String XMLParser_Missing_Required_Attribute; - public static String XMLParser_Illegal_Value_For_Attribute; - public static String XMLParser_Duplicate_Element; - - public static String io_failedRead; - public static String io_IncompatibleVersion; - public static String io_parseError; - -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/XMLConstants.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/XMLConstants.java deleted file mode 100644 index f7d63c58c..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/XMLConstants.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Genuitec, LLC - added license support - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.persistence; - -public interface XMLConstants { - - // Constants used in defining a default processing instruction - // including a class name and a version of the associated XML - // for some category of objects. - // e.g. <?category class='a.b.c.SomeClass' version='1.2.3'?> - // - public static final String PI_CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$ - public static final String PI_VERSION_ATTRIBUTE = "version"; //$NON-NLS-1$ - - // Element and attribute names for a standard property collection. - // e.g. <properties size='1'> - // <property name='some_name' value='some_value'/> - // </properties> - public static final String PROPERTIES_ELEMENT = "properties"; //$NON-NLS-1$ - public static final String PROPERTY_ELEMENT = "property"; //$NON-NLS-1$ - public static final String PROPERTY_NAME_ATTRIBUTE = "name"; //$NON-NLS-1$ - public static final String PROPERTY_VALUE_ATTRIBUTE = "value"; //$NON-NLS-1$ - - // Constants for the names of common general attributes - public static final String ID_ATTRIBUTE = "id"; //$NON-NLS-1$ - public static final String PARENT_ID_ATTRIBUTE = "parentId"; //$NON-NLS-1$ - public static final String TYPE_ATTRIBUTE = "type"; //$NON-NLS-1$ - public static final String NAME_ATTRIBUTE = "name"; //$NON-NLS-1$ - public static final String VERSION_ATTRIBUTE = "version"; //$NON-NLS-1$ - public static final String VERSION_RANGE_ATTRIBUTE = "range"; //$NON-NLS-1$ - public static final String NAMESPACE_ATTRIBUTE = "namespace"; //$NON-NLS-1$ - public static final String CLASSIFIER_ATTRIBUTE = "classifier"; //$NON-NLS-1$ - public static final String DESCRIPTION_ATTRIBUTE = "description"; //$NON-NLS-1$ - public static final String PROVIDER_ATTRIBUTE = "provider"; //$NON-NLS-1$ - public static final String URL_ATTRIBUTE = "url"; //$NON-NLS-1$ - public static final String URI_ATTRIBUTE = "uri"; //$NON-NLS-1$ - - // Constants for the license and copyright elements - public static final String LICENSES_ELEMENT = "licenses"; //$NON-NLS-1$ - public static final String LICENSE_ELEMENT = "license"; //$NON-NLS-1$ - public static final String COPYRIGHT_ELEMENT = "copyright"; //$NON-NLS-1$ - - // A constant for the name of an attribute of a collection or array element - // specifying the size or length - public static final String COLLECTION_SIZE_ATTRIBUTE = "size"; //$NON-NLS-1$ - - // A constant for an empty array of attribute names - public static String[] noAttributes = new String[0]; - - //Constants for attributes of a composite repository - public static final String CHILDREN_ELEMENT = "children"; //$NON-NLS-1$ - public static final String CHILD_ELEMENT = "child"; //$NON-NLS-1$ - public static final String LOCATION_ELEMENT = "location"; //$NON-NLS-1$ -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/XMLParser.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/XMLParser.java deleted file mode 100644 index d96221e40..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/XMLParser.java +++ /dev/null @@ -1,765 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.persistence; - -import java.net.*; -import java.util.List; -import java.util.StringTokenizer; -import javax.xml.parsers.*; -import org.eclipse.core.runtime.*; -import org.eclipse.equinox.internal.p2.core.Activator; -import org.eclipse.equinox.internal.p2.core.StringPool; -import org.eclipse.equinox.internal.p2.core.helpers.OrderedProperties; -import org.eclipse.equinox.internal.p2.core.helpers.Tracing; -import org.eclipse.equinox.internal.provisional.p2.core.Version; -import org.eclipse.equinox.internal.provisional.p2.core.VersionRange; -import org.eclipse.osgi.util.NLS; -import org.osgi.framework.BundleContext; -import org.osgi.util.tracker.ServiceTracker; -import org.xml.sax.*; -import org.xml.sax.ContentHandler; -import org.xml.sax.helpers.DefaultHandler; - -public abstract class XMLParser extends DefaultHandler implements XMLConstants { - - // Get the root object that is being parsed. - protected abstract Object getRootObject(); - - // Get a generic parser error message for inclusion in an error status - protected abstract String getErrorMessage(); - - protected BundleContext context; // parser class bundle context - protected String bundleId; // parser class bundle id - - protected XMLReader xmlReader; // the XML reader for the parser - - protected MultiStatus status = null; // accumulation of non-fatal errors - protected Locator locator = null; // document locator, if supported by the parser - - protected StringPool stringPool = new StringPool();//used to eliminate string duplication - private IProgressMonitor monitor; - - private static ServiceTracker xmlTracker = null; - - public XMLParser(BundleContext context, String pluginId) { - super(); - this.context = context; - this.bundleId = pluginId; - } - - /** - * Non-fatal errors accumulated during parsing. - */ - public IStatus getStatus() { - return (status != null ? status : Status.OK_STATUS); - } - - /** - * Returns the canonical form of a string. Used to eliminate duplicate equal - * strings. - */ - protected String canonicalize(String string) { - return stringPool == null ? string : stringPool.add(string); - } - - public boolean isValidXML() { - return (status == null || !status.matches(IStatus.ERROR | IStatus.CANCEL)); - } - - private static SAXParserFactory acquireXMLParsing(BundleContext context) { - if (xmlTracker == null) { - xmlTracker = new ServiceTracker(context, SAXParserFactory.class.getName(), null); - xmlTracker.open(); - } - return (SAXParserFactory) xmlTracker.getService(); - } - - protected static void releaseXMLParsing() { - if (xmlTracker != null) { - xmlTracker.close(); - } - } - - protected SAXParser getParser() throws ParserConfigurationException, SAXException { - SAXParserFactory factory = acquireXMLParsing(this.context); - if (factory == null) { - throw new SAXException(Messages.XMLParser_No_SAX_Parser); - } - factory.setNamespaceAware(true); - factory.setValidating(false); - try { - factory.setFeature("http://xml.org/sax/features/string-interning", true); //$NON-NLS-1$ - } catch (SAXException se) { - // some parsers may not support string interning - } - SAXParser theParser = factory.newSAXParser(); - if (theParser == null) { - throw new SAXException(Messages.XMLParser_No_SAX_Parser); - } - xmlReader = theParser.getXMLReader(); - return theParser; - } - - public static String makeSimpleName(String localName, String qualifiedName) { - if (localName != null && localName.length() > 0) { - return localName; - } - int nameSpaceIndex = qualifiedName.indexOf(":"); //$NON-NLS-1$ - return (nameSpaceIndex == -1 ? qualifiedName : qualifiedName.substring(nameSpaceIndex + 1)); - } - - /** - * Set the document locator for the parser - * - * @see org.xml.sax.ContentHandler#setDocumentLocator - */ - public void setDocumentLocator(Locator docLocator) { - locator = docLocator; - } - - /** - * Sets the progress monitor for the parser - */ - protected void setProgressMonitor(IProgressMonitor monitor) { - this.monitor = monitor; - } - - /** - * Abstract base class for content handlers - */ - protected abstract class AbstractHandler extends DefaultHandler { - - protected ContentHandler parentHandler = null; - protected String elementHandled = null; - - protected StringBuffer characters = null; // character data inside an element - - public AbstractHandler() { - // Empty constructor for a root handler - } - - public AbstractHandler(ContentHandler parentHandler) { - this.parentHandler = parentHandler; - xmlReader.setContentHandler(this); - } - - public AbstractHandler(ContentHandler parentHandler, String elementHandled) { - this.parentHandler = parentHandler; - xmlReader.setContentHandler(this); - this.elementHandled = elementHandled; - } - - /** - * Set the document locator for the parser - * - * @see org.xml.sax.ContentHandler#setDocumentLocator - */ - public void setDocumentLocator(Locator docLocator) { - locator = docLocator; - } - - public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { - finishCharacters(); - String name = makeSimpleName(localName, qName); - trace(name, attributes); - startElement(name, attributes); - } - - public abstract void startElement(String name, Attributes attributes) throws SAXException; - - public void invalidElement(String name, Attributes attributes) { - unexpectedElement(this, name, attributes); - new IgnoringHandler(this); - } - - public void endElement(String namespaceURI, String localName, String qName) { - // TODO: throw a bad state error if makeSimpleName(localName, qName) != elementHandled - finishCharacters(); - finished(); - // Restore the parent content handler - xmlReader.setContentHandler(parentHandler); - } - - /** - * An implementation for startElement when there are no sub-elements - */ - protected void noSubElements(String name, Attributes attributes) { - unexpectedElement(this, name, attributes); - // Create a new handler to ignore subsequent nested elements - new IgnoringHandler(this); - } - - /* - * Save up character data until endElement or nested startElement - * - * @see org.xml.sax.ContentHandler#characters - */ - public void characters(char[] chars, int start, int length) { - if (this.characters == null) { - this.characters = new StringBuffer(); - } - this.characters.append(chars, start, length); - } - - // Consume the characters accumulated in this.characters. - // Called before startElement or endElement - private String finishCharacters() { - // common case -- no characters or only whitespace - if (this.characters == null || this.characters.length() == 0) { - return null; - } - if (allWhiteSpace(this.characters)) { - this.characters.setLength(0); - return null; - } - - // process the characters - try { - String trimmedChars = this.characters.toString().trim(); - if (trimmedChars.length() == 0) { - // this shouldn't happen due to the test for allWhiteSpace above - System.err.println("Unexpected non-whitespace characters: " //$NON-NLS-1$ - + trimmedChars); - return null; - } - processCharacters(trimmedChars); - return trimmedChars; - } finally { - this.characters.setLength(0); - } - } - - // Method to override in the handler of an element with CDATA. - protected void processCharacters(String data) { - if (data.length() > 0) { - unexpectedCharacterData(this, data); - } - } - - private boolean allWhiteSpace(StringBuffer sb) { - int length = sb.length(); - for (int i = 0; i < length; i += 1) { - if (!Character.isWhitespace(sb.charAt(i))) { - return false; - } - } - return true; - } - - /** - * Called when this element and all elements nested into it have been - * handled. - */ - protected void finished() { - // Do nothing by default - } - - /* - * A name used to identify the handler. - */ - public String getName() { - return (elementHandled != null ? elementHandled : "NoName"); //$NON-NLS-1$ - } - - /** - * In p2 1.0 we stored URLs, in 1.1 and later we store URIs. This method will - * first check for a URI, and then resort to looking for a URL attribute for - * backwards compatibility. - * @param attributes The attributes to parse - * @param required If true, an exception is thrown if no URI or URL attribute is present - */ - protected URI parseURIAttribute(Attributes attributes, boolean required) { - String location = parseOptionalAttribute(attributes, URI_ATTRIBUTE); - try { - if (location != null) - return new URI(location); - if (required) - location = parseRequiredAttributes(attributes, new String[] {URL_ATTRIBUTE})[0]; - else - location = parseOptionalAttribute(attributes, URL_ATTRIBUTE); - if (location == null) - return null; - return URIUtil.toURI(new URL(location)); - } catch (MalformedURLException e) { - invalidAttributeValue(elementHandled, URL_ATTRIBUTE, location, e); - } catch (URISyntaxException e) { - invalidAttributeValue(elementHandled, URL_ATTRIBUTE, location, e); - } - return null; - } - - /** - * Parse the attributes of an element with two required attributes. - */ - protected String[] parseRequiredAttributes(Attributes attributes, String name1, String name2) { - return parseRequiredAttributes(attributes, new String[] {name1, name2}); - } - - /** - * Parse the attributes of an element with only required attributes. - */ - protected String[] parseRequiredAttributes(Attributes attributes, String[] required) { - return parseAttributes(attributes, required, noAttributes); - } - - /** - * Parse the attributes of an element with a single optional attribute. - */ - protected String parseOptionalAttribute(Attributes attributes, String name) { - return parseAttributes(attributes, noAttributes, new String[] {name})[0]; - } - - /** - * Parse the attributes of an element, given the list of required and optional ones. - * Return values in same order, null for those not present. - * Log warnings for extra attributes or missing required attributes. - */ - protected String[] parseAttributes(Attributes attributes, String[] required, String[] optional) { - String[] result = new String[required.length + optional.length]; - for (int i = 0; i < attributes.getLength(); i += 1) { - String name = attributes.getLocalName(i); - String value = canonicalize(attributes.getValue(i).trim()); - int j; - if ((j = indexOf(required, name)) >= 0) { - result[j] = value; - } else if ((j = indexOf(optional, name)) >= 0) { - result[required.length + j] = value; - } else { - unexpectedAttribute(elementHandled, name, value); - } - } - for (int i = 0; i < required.length; i += 1) { - checkRequiredAttribute(elementHandled, required[i], result[i]); - } - return result; - } - - } - - /** - * Handler for an XML document. - * - * Using the inelegant name 'DocHandler' to clearly distinguish - * this class from the deprecated org.xml.sax.DocumentHandler. - */ - protected class DocHandler extends AbstractHandler { - - RootHandler rootHandler; - - public DocHandler(String rootName, RootHandler rootHandler) { - super(null, rootName); - this.rootHandler = rootHandler; - } - - public void startElement(String name, Attributes attributes) { - if (name.equals(elementHandled)) { - rootHandler.initialize(this, name, attributes); - xmlReader.setContentHandler(rootHandler); - } else { - this.noSubElements(name, attributes); - } - } - - } - - /** - * Abstract handler for the root element. - */ - protected abstract class RootHandler extends AbstractHandler { - - public RootHandler() { - super(); - } - - public void initialize(DocHandler document, String rootName, Attributes attributes) { - this.parentHandler = document; - this.elementHandled = rootName; - handleRootAttributes(attributes); - } - - protected abstract void handleRootAttributes(Attributes attributes); - - } - - /** - * Handler for an ordered properties collection. - */ - protected class PropertiesHandler extends AbstractHandler { - - private OrderedProperties properties; - - public PropertiesHandler(ContentHandler parentHandler, Attributes attributes) { - super(parentHandler, PROPERTIES_ELEMENT); - String size = parseOptionalAttribute(attributes, COLLECTION_SIZE_ATTRIBUTE); - properties = (size != null ? new OrderedProperties(new Integer(size).intValue()) : new OrderedProperties()); - } - - public OrderedProperties getProperties() { - return properties; - } - - public void startElement(String name, Attributes attributes) { - if (name.equals(PROPERTY_ELEMENT)) { - new PropertyHandler(this, attributes, properties); - } else { - invalidElement(name, attributes); - } - } - - } - - /** - * Handler for a property in an ordered properties collection. - */ - protected class PropertyHandler extends AbstractHandler { - - public PropertyHandler(ContentHandler parentHandler, Attributes attributes, OrderedProperties properties) { - super(parentHandler, PROPERTY_ELEMENT); - String[] property = parseProperty(attributes); - if (isValidProperty(property)) { - properties.setProperty(property[0], property[1]); - } - } - - public void startElement(String name, Attributes attributes) { - invalidElement(name, attributes); - } - - private String[] parseProperty(Attributes attributes) { - return parseRequiredAttributes(attributes, PROPERTY_NAME_ATTRIBUTE, PROPERTY_VALUE_ATTRIBUTE); - } - - private boolean isValidProperty(String[] property) { - return (property.length == 2 && property[0] != null && property[1] != null); - } - } - - /** - * Handler for an element with only cdata and no sub-elements. - */ - protected class TextHandler extends AbstractHandler { - - private String text = null; - - private List texts = null; - - // Constructor for a subclass that processes the attributes - public TextHandler(AbstractHandler parent, String elementName) { - super(parent, elementName); - } - - // Constructor for a subclass with no attributes - public TextHandler(AbstractHandler parent, String elementName, Attributes attributes) { - super(parent, elementName); - parseAttributes(attributes, noAttributes, noAttributes); - } - - public TextHandler(AbstractHandler parent, String elementName, Attributes attributes, List texts) { - super(parent, elementName); - parseAttributes(attributes, noAttributes, noAttributes); - this.texts = texts; - } - - public String getText() { - return (text != null ? text : ""); //$NON-NLS-1$ - } - - public void startElement(String name, Attributes attributes) { - invalidElement(name, attributes); - } - - protected void processCharacters(String data) { - this.text = canonicalize(data); - if (texts != null) { - texts.add(getText()); - } - } - - } - - /** - * Handler for ignoring content. - */ - protected class IgnoringHandler extends AbstractHandler { - - public IgnoringHandler(AbstractHandler parent) { - super(parent); - this.elementHandled = "IgnoringAll"; //$NON-NLS-1$ - } - - public void startElement(String name, Attributes attributes) { - noSubElements(name, attributes); - } - - } - - // Helper for processing instructions that include a Version. - public Version extractPIVersion(String target, String data) { - return checkVersion(target, PI_VERSION_ATTRIBUTE, extractPIAttribute(data, PI_VERSION_ATTRIBUTE)); - } - - private String extractPIAttribute(String data, String key) { - StringTokenizer piTokenizer = new StringTokenizer(data, " \'\""); //$NON-NLS-1$ - String[] tokens = new String[piTokenizer.countTokens()]; - int index = 0; - int valueIndex = -1; - while (piTokenizer.hasMoreTokens() && index < tokens.length) { - tokens[index] = piTokenizer.nextToken(); - if (tokens[index].equals(key + '=') && index < tokens.length) { - valueIndex = index + 1; - } - index++; - } - return (valueIndex >= 0 ? tokens[valueIndex] : ""); //$NON-NLS-1$ - } - - public void error(SAXParseException ex) { - addError(IStatus.WARNING, ex.getMessage(), ex); - } - - public void fatalError(SAXParseException ex) { - addError(IStatus.ERROR, ex.getMessage(), ex); - } - - protected String getErrorPrefix() { - return null; - } - - protected String getErrorSuffix() { - return null; - } - - /** - * Collects an error or warning that occurred during parsing. - */ - public final void addError(int severity, String msg, Throwable exception) { - int line = 0; - int column = 0; - String key = msg; - Object[] args = new Object[] {}; - String root = (getRootObject() == null ? "" //$NON-NLS-1$ - : " (" + getRootObject() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ - if (this.locator != null) { - String name = this.locator.getSystemId(); - line = this.locator.getLineNumber(); - column = this.locator.getColumnNumber(); - if (line > 0) { - args = new Object[] {msg, root, name, new Integer(line), new Integer(column)}; - if (column > 0) { - key = (name != null ? Messages.XMLParser_Error_At_Name_Line_Column // - : Messages.XMLParser_Error_At_Line_Column); - } else { - key = (name != null ? Messages.XMLParser_Error_At_Name_Line // - : Messages.XMLParser_Error_At_Line); - } - } - } - String errMsg = NLS.bind(key, args); - String prefix = getErrorPrefix(); - String suffix = getErrorSuffix(); - if (prefix != null) { - errMsg = prefix + errMsg; - } - if (suffix != null) { - errMsg = errMsg + suffix; - } - IStatus currStatus = new Status(severity, Activator.ID, errMsg, exception); - if (this.status == null) { - this.status = new MultiStatus(bundleId, IStatus.OK, new IStatus[] {currStatus}, getErrorMessage(), null); - } else { - this.status.add(currStatus); - } - } - - public void trace(String element, Attributes attributes) { - // TODO: support logging - // if (!getLogger().isDebugLoggable()) { - // return; - // } - // int indentSize = (this.stateStack != null ? this.stateStack.size() - 1 : 1); - // if (attributes == null) { - // indentSize -= 1; - // } - // char[] indent = new char[2 * indentSize]; - // Arrays.fill(indent, ' '); - // StringBuffer sb = new StringBuffer(); - // sb.append(indent); - // sb.append('<'); - // if (attributes != null) { - // sb.append(element); - // toString(sb, attributes); - // } else { - // sb.append('/').append(element); - // } - // sb.append('>'); - // getLogger().debug(sb.toString()); - } - - private static String toString(Attributes attributes) { - StringBuffer result = new StringBuffer(); - toString(result, attributes); - return result.toString(); - } - - private static void toString(StringBuffer sb, Attributes attributes) { - for (int i = 0; i < attributes.getLength(); i += 1) { - String name = attributes.getLocalName(i); - String value = attributes.getValue(i).trim(); - sb.append(' ').append(name); - sb.append('=').append('"'); - sb.append(value); - sb.append('"'); - } - } - - public void checkRequiredAttribute(String element, String name, Object value) { - if (value == null) { - addError(IStatus.WARNING, NLS.bind(Messages.XMLParser_Missing_Required_Attribute, element, name), null); - } - } - - // Check the format of a required boolean attribute - public Boolean checkBoolean(String element, String attribute, String value) { - try { - return Boolean.valueOf(value); - } catch (IllegalArgumentException iae) { - invalidAttributeValue(element, attribute, value); - } catch (NullPointerException npe) { - invalidAttributeValue(element, attribute, null); - } - return Boolean.FALSE; - } - - // Check the format of an optional boolean attribute - public Boolean checkBoolean(String element, String attribute, String value, boolean defaultValue) { - Boolean result = (defaultValue ? Boolean.TRUE : Boolean.FALSE); - if (value != null) { - try { - return Boolean.valueOf(value); - } catch (IllegalArgumentException iae) { - invalidAttributeValue(element, attribute, value); - } - } - return result; - } - - // Check the format of a required integer attribute - public int checkInteger(String element, String attribute, String value) { - try { - return Integer.parseInt(value); - } catch (IllegalArgumentException iae) { - invalidAttributeValue(element, attribute, value); - } - return 0; - } - - // Check the format of a required URI attribute - public URI checkURI(String element, String attribute, String value) { - try { - return URIUtil.fromString(value); - } catch (URISyntaxException e) { - invalidAttributeValue(element, attribute, value); - } - //TODO ok to return null? - return null; - } - - public void checkCancel() { - if (monitor != null && monitor.isCanceled()) - throw new OperationCanceledException(); - } - - /** - * Converts a version string to a Version object. Returns the version object, - * or {@link Version#emptyVersion} if the value was not a valid version. - */ - public Version checkVersion(String element, String attribute, String value) { - try { - if (value != null) - return new Version(value); - } catch (IllegalArgumentException iae) { - invalidAttributeValue(element, attribute, value); - } catch (NullPointerException npe) { - invalidAttributeValue(element, attribute, null); - } - return Version.emptyVersion; - } - - public VersionRange checkVersionRange(String element, String attribute, String value) { - try { - return new VersionRange(value); - } catch (IllegalArgumentException iae) { - invalidAttributeValue(element, attribute, value); - } catch (NullPointerException npe) { - invalidAttributeValue(element, attribute, null); - } - return VersionRange.emptyRange; - } - - public void unexpectedAttribute(String element, String attribute, String value) { - if (Tracing.DEBUG_PARSE_PROBLEMS) - Tracing.debug("Unexpected attribute for element " + element + ": " + attribute + '=' + value); //$NON-NLS-1$ //$NON-NLS-2$ - } - - public void invalidAttributeValue(String element, String attribute, String value) { - invalidAttributeValue(element, attribute, value, null); - } - - public void invalidAttributeValue(String element, String attribute, String value, Throwable exception) { - addError(IStatus.WARNING, NLS.bind(Messages.XMLParser_Illegal_Value_For_Attribute, new Object[] {attribute, element, value}), exception); - } - - public void unexpectedElement(AbstractHandler handler, String element, Attributes attributes) { - if (Tracing.DEBUG_PARSE_PROBLEMS) - Tracing.debug("Unexpected element in element " + handler.getName() + ": <" + element + toString(attributes) + '>'); //$NON-NLS-1$ //$NON-NLS-2$ - } - - public void duplicateElement(AbstractHandler handler, String element, Attributes attributes) { - addError(IStatus.WARNING, NLS.bind(Messages.XMLParser_Duplicate_Element, new Object[] {handler.getName(), element, toString(attributes)}), null); - //ignore the duplicate element entirely because we have already logged it - new IgnoringHandler(handler); - } - - public void unexpectedCharacterData(AbstractHandler handler, String cdata) { - if (Tracing.DEBUG_PARSE_PROBLEMS) - Tracing.debug("Unexpected character data in element " + handler.getName() + ": " + cdata.trim()); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * Find the index of the first occurrence of object in array, or -1. - * Use Arrays.binarySearch if array is big and sorted. - */ - protected static int indexOf(String[] array, String value) { - for (int i = 0; i < array.length; i += 1) { - if (value == null ? array[i] == null : value.equals(array[i])) { - return i; - } - } - return -1; - } - - // public class BadStateError extends AssertionError { - // private static final long serialVersionUID = 1L; // not serialized - // - // public BadStateError() { - // super("unexpected state" + //$NON-NLS-1$ - // (XMLParser.this.stateStack != null ? ": " + XMLParser.this.stateStack //$NON-NLS-1$ - // : "")); //$NON-NLS-1$ - // } - // - // public BadStateError(String element) { - // super("unexpected state for " + element + //$NON-NLS-1$ - // (XMLParser.this.stateStack != null ? ": " + XMLParser.this.stateStack //$NON-NLS-1$ - // : "")); //$NON-NLS-1$ - // } - // } - -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/XMLWriter.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/XMLWriter.java deleted file mode 100644 index d3998e49a..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/XMLWriter.java +++ /dev/null @@ -1,307 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.persistence; - -import java.io.*; -import java.util.*; -import org.eclipse.equinox.internal.provisional.p2.core.Version; - -public class XMLWriter implements XMLConstants { - - public static class ProcessingInstruction { - - private String target; - private String[] data; - - // The standard UTF-8 processing instruction - public static final String XML_UTF8 = "<?xml version='1.0' encoding='UTF-8'?>"; //$NON-NLS-1$ - - public ProcessingInstruction(String target, String[] attrs, String[] values) { - // Lengths of attributes and values must be the same - this.target = target; - this.data = new String[attrs.length]; - for (int i = 0; i < attrs.length; i++) { - data[i] = attributeImage(attrs[i], values[i]); - } - } - - public static ProcessingInstruction makeTargetVersionInstruction(String target, Version version) { - return new ProcessingInstruction(target, new String[] {PI_VERSION_ATTRIBUTE}, new String[] {version.toString()}); - } - - public String toString() { - StringBuffer sb = new StringBuffer("<?"); //$NON-NLS-1$ - sb.append(this.target).append(' '); - for (int i = 0; i < data.length; i++) { - sb.append(this.data[i]); - if (i < data.length - 1) { - sb.append(' '); - } - } - sb.append("?>"); //$NON-NLS-1$ - return sb.toString(); - } - } - - private Stack elements; // XML elements that have not yet been closed - private boolean open; // Can attributes be added to the current element? - private String indent; // used for each level of indentation - - private PrintWriter pw; - - public XMLWriter(OutputStream output, ProcessingInstruction[] piElements) throws UnsupportedEncodingException { - this.pw = new PrintWriter(new OutputStreamWriter(output, "UTF8"), false); //$NON-NLS-1$ - println(ProcessingInstruction.XML_UTF8); - this.elements = new Stack(); - this.open = false; - this.indent = " "; //$NON-NLS-1$ - if (piElements != null) { - for (int i = 0; i < piElements.length; i++) { - println(piElements[i].toString()); - } - } - } - - // start a new element - public void start(String name) { - if (this.open) { - println('>'); - } - indent(); - print('<'); - print(name); - this.elements.push(name); - this.open = true; - } - - // end the most recent element with this name - public void end(String name) { - if (this.elements.empty()) { - throw new EndWithoutStartError(); - } - int index = this.elements.search(name); - if (index == -1) { - throw new EndWithoutStartError(name); - } - for (int i = 0; i < index; i += 1) { - end(); - } - } - - // end the current element - public void end() { - if (this.elements.empty()) { - throw new EndWithoutStartError(); - } - String name = (String) this.elements.pop(); - if (this.open) { - println("/>"); //$NON-NLS-1$ - } else { - printlnIndented("</" + name + '>', false); //$NON-NLS-1$ - } - this.open = false; - } - - public static String escape(String txt) { - StringBuffer buffer = null; - for (int i = 0; i < txt.length(); ++i) { - String replace; - char c = txt.charAt(i); - switch (c) { - case '<' : - replace = "<"; //$NON-NLS-1$ - break; - case '>' : - replace = ">"; //$NON-NLS-1$ - break; - case '"' : - replace = """; //$NON-NLS-1$ - break; - case '\'' : - replace = "'"; //$NON-NLS-1$ - break; - case '&' : - replace = "&"; //$NON-NLS-1$ - break; - case '\t' : - replace = "	"; //$NON-NLS-1$ - break; - case '\n' : - replace = "
"; //$NON-NLS-1$ - break; - case '\r' : - replace = "
"; //$NON-NLS-1$ - break; - default : - // this is the set of legal xml scharacters in unicode excluding high surrogates since they cannot be represented with a char - // see http://www.w3.org/TR/REC-xml/#charsets - if ((c >= '\u0020' && c <= '\uD7FF') || (c >= '\uE000' && c <= '\uFFFD')) { - if (buffer != null) - buffer.append(c); - continue; - } - replace = Character.isWhitespace(c) ? " " : null; //$NON-NLS-1$ - } - if (buffer == null) { - buffer = new StringBuffer(txt.length() + 16); - buffer.append(txt.substring(0, i)); - } - if (replace != null) - buffer.append(replace); - } - - if (buffer == null) - return txt; - - return buffer.toString(); - } - - // write a boolean attribute if it doesn't have the default value - public void attribute(String name, boolean value, boolean defaultValue) { - if (value != defaultValue) { - attribute(name, value); - } - } - - public void attribute(String name, boolean value) { - attribute(name, Boolean.toString(value)); - } - - public void attribute(String name, int value) { - attribute(name, Integer.toString(value)); - } - - public void attributeOptional(String name, String value) { - if (value != null && value.length() > 0) { - attribute(name, value); - } - } - - public void attribute(String name, Object value) { - if (!this.open) { - throw new AttributeAfterNestedContentError(); - } - if (value == null) { - return; // optional attribute with no value - } - print(' '); - print(name); - print("='"); //$NON-NLS-1$ - print(escape(value.toString())); - print('\''); - } - - public void cdata(String data) { - cdata(data, true); - } - - public void cdata(String data, boolean escape) { - if (this.open) { - println('>'); - this.open = false; - } - if (data != null) { - printlnIndented(data, escape); - } - } - - public void flush() { - this.pw.flush(); - } - - public void writeProperties(Map properties) { - writeProperties(PROPERTIES_ELEMENT, properties); - } - - public void writeProperties(String propertiesElement, Map properties) { - if (properties != null && properties.size() > 0) { - start(propertiesElement); - attribute(COLLECTION_SIZE_ATTRIBUTE, properties.size()); - for (Iterator iter = properties.keySet().iterator(); iter.hasNext();) { - String name = (String) iter.next(); - writeProperty(name, (String) properties.get(name)); - } - end(propertiesElement); - } - } - - public void writeProperty(String name, String value) { - start(PROPERTY_ELEMENT); - attribute(PROPERTY_NAME_ATTRIBUTE, name); - attribute(PROPERTY_VALUE_ATTRIBUTE, value); - end(); - } - - protected static String attributeImage(String name, String value) { - if (value == null) { - return ""; // optional attribute with no value - } - return name + "='" + escape(value) + '\''; //$NON-NLS-1$ - } - - private void println(char c) { - this.pw.println(c); - } - - private void println(String s) { - this.pw.println(s); - } - - private void println() { - this.pw.println(); - } - - private void print(char c) { - this.pw.print(c); - } - - private void print(String s) { - this.pw.print(s); - } - - private void printlnIndented(String s, boolean escape) { - if (s.length() == 0) { - println(); - } else { - indent(); - println(escape ? escape(s) : s); - } - } - - private void indent() { - for (int i = this.elements.size(); i > 0; i -= 1) { - print(this.indent); - } - } - - public static class AttributeAfterNestedContentError extends Error { - private static final long serialVersionUID = 1L; // not serialized - } - - public static class EndWithoutStartError extends Error { - private static final long serialVersionUID = 1L; // not serialized - private String name; - - public EndWithoutStartError() { - super(); - } - - public EndWithoutStartError(String name) { - super(); - this.name = name; - } - - public String getName() { - return this.name; - } - } - -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/messages.properties b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/messages.properties deleted file mode 100644 index 473a1d1fb..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/persistence/messages.properties +++ /dev/null @@ -1,27 +0,0 @@ -############################################################################### -# Copyright (c) 2007, 2008 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -# All these errors are bound to 5 args: 0-msg, 1-root, 2-name, 3-line, 4-column -XMLParser_Error_At_Line=Error at line {3}{1}: {0} -XMLParser_Error_At_Line_Column=Error at line {3}, column {4}{1}: {0} -XMLParser_Error_At_Name_Line=Error in {2} at line {3}: {0} -XMLParser_Error_At_Name_Line_Column=Error in {2} at line {3}, column {4}: {0} - -XMLParser_No_SAX_Parser=Unable to acquire a SAX parser service. -XMLParser_Missing_Required_Attribute=Missing required attribute in "{0}": {1} -XMLParser_Illegal_Value_For_Attribute=Illegal value for attribute "{0}" of element "{1}": {2} -XMLParser_Duplicate_Element=Duplicate singleton element in element "{0}": <{1}{2}> - -io_failedRead=Unable to read repository at {0} -io_IncompatibleVersion=\ -Metadata repository has incompatible version {0}; expected {1} -io_parseError=\ -Error parsing composite repository
\ No newline at end of file diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/ICompositeRepository.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/ICompositeRepository.java deleted file mode 100644 index b6f6a1bf1..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/ICompositeRepository.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.provisional.p2.core.repository; - -import java.net.URI; -import java.util.List; - -public interface ICompositeRepository extends IRepository { - /** - * - * @return a list of URIs containing the locations of the children repositories - */ - public abstract List getChildren(); - - /** - * Removes all child repositories - */ - public abstract void removeAllChildren(); - - /** - * Removes specified URI from list of child repositories. - * Does nothing if specified URI is not a child repository - * @param child - */ - public abstract void removeChild(URI child); - - /** - * Adds a specified URI to list of child repositories. - * Does nothing if URI is a duplicate of an existing child repository. - * @param child - */ - public abstract void addChild(URI child); -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepository.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepository.java deleted file mode 100644 index dde7cc3de..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepository.java +++ /dev/null @@ -1,188 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.provisional.p2.core.repository; - -import java.net.URI; -import java.util.Map; -import org.eclipse.core.runtime.IAdaptable; - -/** - * Base interface that defines common properties that may be provided by - * various kinds of repositories. - * - * @noimplement This interface is not intended to be implemented by clients. - */ -public interface IRepository extends IAdaptable { - /** - * The key for a boolean property indicating that the repository - * is a system repository. System repositories are implementation details - * that are not subject to general access, hidden from the typical user, etc. - */ - public static final String PROP_SYSTEM = "p2.system"; //$NON-NLS-1$ - - /** - * The key for a boolean property indicating that repository metadata is - * stored in compressed form. A compressed repository will have lower - * bandwidth cost to read when remote, but higher processing cost to - * uncompress when reading. - */ - public static final String PROP_COMPRESSED = "p2.compressed"; //$NON-NLS-1$ - - /** - * The key for a string property providing a human-readable name for the repository. - */ - public static final String PROP_NAME = "name"; //$NON-NLS-1$ - - /** - * The key for a string property providing a user-defined name for the repository. - * This property is never stored in the repository itself, but is instead tracked and managed - * by an {@link IRepositoryManager}. - */ - public static final String PROP_NICKNAME = "p2.nickname"; //$NON-NLS-1$ - - /** - * The key for a string property providing a human-readable description for the repository. - */ - public static final String PROP_DESCRIPTION = "description"; //$NON-NLS-1$ - - /** - * The key for a string property providing the common base URL that should - * be replaced with the mirror URL. - */ - public static final String PROP_MIRRORS_BASE_URL = "p2.mirrorsBaseURL"; //$NON-NLS-1$ - - /** - * The key for a string property providing a URL that can return mirrors of this - * repository. - */ - public static final String PROP_MIRRORS_URL = "p2.mirrorsURL"; //$NON-NLS-1$ - - /** - * The key for a string property containing the time when the repository was last modified. - */ - public static final String PROP_TIMESTAMP = "p2.timestamp"; //$NON-NLS-1$ - - /** - * The key for a string property providing the user name to an authenticated - * URL. This key is used in the secure preference store for repository data. - * @see #PREFERENCE_NODE - */ - public static final String PROP_USERNAME = "username"; //$NON-NLS-1$ - - /** - * The key for a string property providing the password to an authenticated - * URL. This key is used in the secure preference store for repository data. - * @see #PREFERENCE_NODE - */ - public static final String PROP_PASSWORD = "password"; //$NON-NLS-1$ - - /** - * The node identifier for repository secure preference store. - */ - public static final String PREFERENCE_NODE = "org.eclipse.equinox.p2.repository"; //$NON-NLS-1$ - - /** - * A repository type constant (value 0) representing a metadata repository. - */ - public static final int TYPE_METADATA = 0; - - /** - * A repository type constant (value 1) representing an artifact repository. - */ - public static final int TYPE_ARTIFACT = 1; - - /** - * General purpose zero-valued bit mask constant. Useful whenever you need to - * supply a bit mask with no bits set. - */ - public static final int NONE = 0; - - /** - * An option flag constant (value 1) indicating an enabled repository. - */ - public static final int ENABLED = 1; - - /** - * 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 URI 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 Map getProperties(); - - /** - * Returns <code>true</code> if this repository can be modified. - * @return whether or not this repository can be modified - */ - public boolean isModifiable(); - - /** - * Set the name of the repository. - */ - public void setName(String name); - - /** - * Sets the description of the repository. - */ - public void setDescription(String description); - - /** - * Sets the value of the property with the given key. Returns the old property - * associated with that key, if any. Setting a value of <code>null</code> will - * remove the corresponding key from the properties of this repository. - * - * @param key The property key - * @param value The new property value, or <code>null</code> to remove the key - * @return The old property value, or <code>null</code> if there was no old value - */ - public String setProperty(String key, String value); - - /** - * Sets the name of the provider of the repository. - */ - public void setProvider(String provider); -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepositoryManager.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepositoryManager.java deleted file mode 100644 index 16adfbc93..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepositoryManager.java +++ /dev/null @@ -1,207 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.provisional.p2.core.repository; - -import java.net.URI; - -/** - * The common base class for metadata and artifact repository managers. - * <p> - * A repository manager keeps track of a set of known repositories, and provides - * caching of these known repositories to avoid unnecessary loading of repositories - * from the disk or network. The manager fires {@link RepositoryEvent}s when the - * set of known repositories changes. - * - * @noimplement This interface is not intended to be implemented by clients. - */ -public interface IRepositoryManager { - /** - * Constant used to indicate that all enabled repositories are of interest. - */ - public static final int REPOSITORIES_ALL = 0; - - /** - * Constant used to indicate that disabled repositories are of interest. - * @see #getKnownRepositories(int) - */ - public static final int REPOSITORIES_DISABLED = 1 << 3; - - /** - * Constant used to indicate that local repositories are of interest. - * @see #getKnownRepositories(int) - */ - public static final int REPOSITORIES_LOCAL = 1 << 2; - - /** - * Constant used to indicate that non-system repositories are of interest. - * @see IRepository#PROP_SYSTEM - * @see #getKnownRepositories(int) - */ - public static final int REPOSITORIES_NON_SYSTEM = 1 << 1; - - /** - * Constant used to indicate that system repositories are of interest. - * @see IRepository#PROP_SYSTEM - * @see #getKnownRepositories(int) - */ - public static final int REPOSITORIES_SYSTEM = 1 << 0; - - /** - * Constant used to indicate that a repository manager should only load the - * repository if the repository is modifiable. - * @see IRepository#isModifiable() - */ - public static final int REPOSITORY_HINT_MODIFIABLE = 1 << 0; - - /** - * Adds the repository at the given location to the list of repositories tracked by - * this repository manager. - * <p> - * If there is a known disabled repository at the given location, it will become - * enabled as a result of this method. Thus the caller can be guaranteed that - * there is a known, enabled repository at the given location when this method returns. - * - * @param location The location of the repository to add - * @see #isEnabled(URI) - */ - public void addRepository(URI location); - - /** - * Returns whether a repository at the given location is in the list of repositories - * tracked by this repository manager. - * - * @param location The location of the repository to look for - * @return <code>true</code> if the repository is known to this manager, - * and <code>false</code> otherwise - */ - public boolean contains(URI location); - - /** - * Returns the artifact repository locations known to the repository manager. - * <p> - * Note that the repository manager does not guarantee that a valid repository - * exists at any of the returned locations at any particular moment in time. - * A subsequent attempt to load a repository at any of the given locations may - * or may not succeed. - * - * @param flags an integer bit-mask indicating which repositories should be - * returned. <code>REPOSITORIES_ALL</code> can be used as the mask when - * all enabled repositories should be returned. - * @return the locations of the repositories managed by this repository manager. - * - * @see #REPOSITORIES_ALL - * @see #REPOSITORIES_SYSTEM - * @see #REPOSITORIES_NON_SYSTEM - * @see #REPOSITORIES_LOCAL - * @see #REPOSITORIES_DISABLED - */ - public URI[] getKnownRepositories(int flags); - - /** - * Returns the property associated with the repository at the given URI, - * without loading the repository. - * <p> - * Note that some properties for a repository can only be - * determined when that repository is loaded. This method will return <code>null</code> - * for such properties. Only values for the properties that are already - * known by a repository manager will be returned. - * <p> - * If a client wishes to retrieve a property value from a repository - * regardless of the cost of retrieving it, the client should load the - * repository and then retrieve the property from the repository itself. - * - * @param location the URI of the repository in question - * @param key the String key of the property desired - * @return the value of the property, or <code>null</code> if the repository - * does not exist, the value does not exist, or the property value - * could not be determined without loading the repository. - * - * @see IRepository#getProperties() - * @see #setRepositoryProperty(URI, String, String) - */ - public String getRepositoryProperty(URI location, String key); - - /** - * Sets the property associated with the repository at the given URI, - * without loading the repository. - * <p> - * This method stores properties in a cache in the repository manager and does - * not write the property to the backing repository. This is useful for making - * repository properties available without incurring the cost of loading the repository. - * When the repository is loaded, it will overwrite any conflicting properties that - * have been set using this method. - * </p> - * <p> - * To persistently set a property on a repository, clients must load - * the repository and call {@link IRepository#setProperty(String, String)}. - * </p> - * - * @param location the URI of the repository in question - * @param key the String key of the property desired - * @param value the value to set the property to - * @see #getRepositoryProperty(URI, String) - * @see IRepository#setProperty(String, String) - */ - public void setRepositoryProperty(URI location, String key, String value); - - /** - * Returns the enablement value of a repository. Disabled repositories are known - * to the repository manager, but are never used in the context of provisioning - * operations. Disabled repositories are useful as a form of bookmark to indicate that a - * repository location is of interest, but not currently used. - * <p> - * Note that enablement is a property of the repository manager and not a property - * of the affected repository. The enablement of the repository is discarded when - * a repository is removed from the repository manager. - * - * @param location The location of the repository whose enablement is requested - * @return <code>true</code> if the repository is enabled, and - * <code>false</code> if it is not enabled, or if the repository location - * is not known to the repository manager. - * @see #REPOSITORIES_DISABLED - * @see #setEnabled(URI, boolean) - */ - public boolean isEnabled(URI location); - - /** - * Removes the repository at the given location from the list of - * repositories known to this repository manager. The underlying - * repository is not deleted. This method has no effect if the given - * repository is not already known to this repository manager. - * - * @param location The location of the repository to remove - * @return <code>true</code> if a repository was removed, and - * <code>false</code> otherwise. - */ - public boolean removeRepository(URI location); - - /** - * Sets the enablement of a repository. Disabled repositories are known - * to the repository manager, but are never used in the context of provisioning - * operation. Disabled repositories are useful as a form of bookmark to indicate that a - * repository location is of interest, but not currently used. - * <p> - * Note that enablement is a property of the repository manager and not a property - * of the affected repository. The enablement of the repository is discarded when - * a repository is removed from the repository manager. - * <p> - * This method has no effect if the given repository location is not known to the - * repository manager. - * - * @param location The location of the repository to enable or disable - * @param enablement <code>true</code>to enable the repository, and - * <code>false</code> to disable the repository - * @see #REPOSITORIES_DISABLED - * @see #isEnabled(URI) - */ - public void setEnabled(URI location, boolean enablement); - -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryCreationException.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryCreationException.java deleted file mode 100644 index 31b5a6bf6..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryCreationException.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.provisional.p2.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.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryEvent.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryEvent.java deleted file mode 100644 index 4052177cc..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryEvent.java +++ /dev/null @@ -1,149 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.provisional.p2.core.repository; - -import java.net.URI; -import java.util.EventObject; - -/** - * An event indicating a repository was added, removed, changed, - * or discovered. - * - * @noextend This class is not intended to be subclassed by clients. - */ -public class RepositoryEvent extends EventObject { - private static final long serialVersionUID = 3082402920617281765L; - - /** - * A change kind constant (value 0), indicating a repository was added to the - * list of repositories known to a repository manager. - */ - public static final int ADDED = 0; - - /** - * A change kind constant (value 1), indicating a repository was removed from - * the list of repositories known to a repository manager. - */ - public static final int REMOVED = 1; - - /** - * A change kind constant (value 2), indicating a repository known to a - * repository manager was modified. - */ - public static final int CHANGED = 2; - - /** - * A change kind constant (value 4), indicating a new repository was discovered. - * This event is a way to notify repository managers in a generic way about - * a newly discovered repository. The repository manager will typically receive - * this event, add the repository to its list of known repositories, and issue - * a subsequent {@link #ADDED} event. Other clients should not typically - * listen for this kind of event. - */ - public static final int DISCOVERED = 4; - - /** - * A change kind constant (value 8), indicating the repository's enablement - * was changed. The {{@link #isRepositoryEnabled()} method can be used - * to find out the new enablement state of the repository, and to deduce - * the previous enablement state. - */ - public static final int ENABLEMENT = 8; - - private final int kind, type; - private boolean isEnabled; - private String nickname; - - /** - * Creates and returns a new repository discovery event. - * @param location the location of the repository that changed. - * @param nickname the repository nickname - * @param repositoryType the type of repository that was changed - * @param enabled whether the repository is enabled - * @return A new repository discovery event - * @see IRepository#PROP_NICKNAME - */ - public static RepositoryEvent newDiscoveryEvent(URI location, String nickname, int repositoryType, boolean enabled) { - RepositoryEvent event = new RepositoryEvent(location, repositoryType, DISCOVERED, enabled); - event.nickname = nickname; - return event; - } - - /** - * Creates a new repository event. - * - * @param location the location of the repository that changed. - * @param repositoryType the type of repository that was changed - * @param kind the kind of change that occurred. - * @param enabled whether the repository is enabled - */ - public RepositoryEvent(URI location, int repositoryType, int kind, boolean enabled) { - super(location); - this.kind = kind; - this.type = repositoryType; - isEnabled = enabled; - } - - /** - * Returns the kind of change that occurred. - * - * @return the kind of change that occurred. - * @see #ADDED - * @see #REMOVED - * @see #CHANGED - * @see #DISCOVERED - * @see #ENABLEMENT - */ - public int getKind() { - return kind; - } - - /** - * Returns the nickname of the repository. This method is only applicable - * for the {@link #DISCOVERED} event type. For other event types this - * method returns <code>null</code>. - */ - public String getRepositoryNickname() { - return nickname; - } - - /** - * Returns the location of the repository associated with this event. - * - * @return the location of the repository associated with this event. - */ - public URI getRepositoryLocation() { - return (URI) getSource(); - } - - /** - * Returns the type of repository associated with this event. Clients - * should not assume that the set of possible repository types is closed; - * clients should ignore events from repository types they don't know about. - * - * @return the type of repository associated with this event. - * ({@link IRepository#TYPE_METADATA} or {@link IRepository#TYPE_ARTIFACT}). - */ - public int getRepositoryType() { - return type; - } - - /** - * Returns whether the affected repository is enabled. - * - * @return <code>true</code> if the repository is enabled, - * and <code>false</code> otherwise. - */ - public boolean isRepositoryEnabled() { - return isEnabled; - } - -} diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/spi/p2/core/repository/AbstractRepository.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/spi/p2/core/repository/AbstractRepository.java deleted file mode 100644 index 793c0bbc3..000000000 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/spi/p2/core/repository/AbstractRepository.java +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.provisional.spi.p2.core.repository; - -import java.net.URI; -import java.util.Map; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.equinox.internal.p2.core.helpers.OrderedProperties; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; - -/** -* AbstractRepository defines common properties that may be provided by various kinds -* of repositories. -* <p> -* Clients may extend this class. -* </p> -*/ -public abstract class AbstractRepository extends PlatformObject implements IRepository { - protected String description; - protected transient URI location; - protected String name; - protected Map properties = new OrderedProperties(); - protected String provider; - protected String type; - protected String version; - - protected AbstractRepository(String name, String type, String version, URI location, String description, String provider, Map properties) { - this.name = name; - this.type = type; - this.version = version; - this.location = location; - this.description = description == null ? "" : description; //$NON-NLS-1$ - this.provider = provider == null ? "" : provider; //$NON-NLS-1$ - if (properties != null) - this.properties.putAll(properties); - } - - /** - * Asserts that this repository is modifiable, throwing a runtime exception if - * it is not. This is suitable for use by subclasses when an attempt is made - * to write to a repository. - */ - protected void assertModifiable() { - if (!isModifiable()) - throw new UnsupportedOperationException("Repository not modifiable: " + location); //$NON-NLS-1$ - } - - /** - * Returns a brief description of the repository. - * @return the description of the repository. - */ - public synchronized String getDescription() { - return description; - } - - /** - * 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 synchronized URI getLocation() { - return location; - } - - /** - * Returns the name of the repository. - * @return the name of the repository. - */ - public synchronized String getName() { - return name; - } - - /** - * Returns a read-only collection of the properties of the repository. - * @return the properties of this repository. - */ - public synchronized Map getProperties() { - return OrderedProperties.unmodifiableProperties(properties); - } - - /** - * Returns the name of the provider of the repository. - * @return the provider of this repository. - */ - public synchronized String getProvider() { - return provider; - } - - /** - * Returns a string representing the type of the repository. - * @return the type of the repository. - */ - public synchronized String getType() { - return type; - } - - /** - * Returns a string representing the version for the repository type. - * @return the version of the type of the repository. - */ - public synchronized String getVersion() { - return version; - } - - public boolean isModifiable() { - return false; - } - - public synchronized void setDescription(String description) { - this.description = description; - } - - public synchronized void setName(String value) { - this.name = value; - } - - public synchronized String setProperty(String key, String value) { - assertModifiable(); - return (String) (value == null ? properties.remove(key) : properties.put(key, value)); - } - - public synchronized void setProvider(String provider) { - this.provider = provider; - } -} 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 index 4498dd268..f137e1c57 100644 --- a/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF @@ -12,7 +12,7 @@ Import-Package: org.eclipse.equinox.app, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.location, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.director, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.engine.phases, diff --git a/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF index c98553d3a..ea38b50c9 100644 --- a/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF @@ -9,7 +9,7 @@ Import-Package: org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, org.eclipse.equinox.internal.provisional.p2.core.location, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.internal.provisional.p2.metadata.query, diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java index b4f1dbf04..0dc4aea4f 100644 --- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java +++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java @@ -17,7 +17,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.*; import org.eclipse.equinox.internal.p2.resolution.ResolutionHelper; import org.eclipse.equinox.internal.p2.rollback.FormerState; import org.eclipse.equinox.internal.provisional.p2.core.*; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.director.*; import org.eclipse.equinox.internal.provisional.p2.engine.*; import org.eclipse.equinox.internal.provisional.p2.metadata.*; @@ -27,6 +26,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.query.UpdateQuery; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.query.*; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; public class SimplePlanner implements IPlanner { private static boolean DEBUG = Tracing.DEBUG_PLANNER_OPERANDS; diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF index 6359e21fd..ec1f7c0d2 100644 --- a/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF @@ -11,7 +11,7 @@ Import-Package: org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.internal.provisional.p2.metadata.query, org.eclipse.equinox.internal.provisional.p2.metadata.repository, diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java index 2492395b5..3383fadce 100644 --- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java +++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java @@ -10,6 +10,8 @@ ******************************************************************************/ package org.eclipse.equinox.internal.provisional.p2.directorywatcher; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.io.File; import java.net.URI; import java.util.*; @@ -18,7 +20,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; import org.eclipse.equinox.internal.p2.update.Site; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; diff --git a/bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF index e729e2c33..ca1e44c8d 100644 --- a/bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF @@ -36,13 +36,13 @@ Import-Package: javax.xml.parsers, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, org.eclipse.equinox.internal.provisional.p2.core.location, - org.eclipse.equinox.internal.provisional.p2.core.repository, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.internal.provisional.p2.metadata.query, org.eclipse.equinox.internal.provisional.p2.metadata.repository, org.eclipse.equinox.internal.provisional.p2.query, - org.eclipse.equinox.internal.provisional.spi.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository, + org.eclipse.equinox.internal.provisional.spi.p2.repository, org.eclipse.osgi.service.datalocation;version="1.0.0", org.eclipse.osgi.service.resolver;version="1.1.0", org.eclipse.osgi.signedcontent;version="1.0.0", diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java index 61ad11339..0030f835b 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java @@ -11,13 +11,14 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.engine; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningContext; public class DownloadManager { diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java index 6c6a76988..2d561594d 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java @@ -1,5 +1,8 @@ package org.eclipse.equinox.internal.p2.engine; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; + import java.io.File; import java.net.URI; import java.net.URISyntaxException; @@ -10,8 +13,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.p2.metadata.repository.Activator; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; import org.eclipse.equinox.internal.provisional.p2.engine.IProfile; import org.eclipse.equinox.internal.provisional.p2.query.Collector; import org.eclipse.equinox.internal.provisional.p2.query.Query; diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepositoryFactory.java index 644faf202..52d25bff3 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepositoryFactory.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepositoryFactory.java @@ -10,11 +10,12 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.engine; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.util.Map; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.MetadataRepositoryFactory; diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/provisional/p2/engine/phases/Sizing.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/provisional/p2/engine/phases/Sizing.java index 5391f37cd..b518313cb 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/provisional/p2/engine/phases/Sizing.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/provisional/p2/engine/phases/Sizing.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.provisional.p2.engine.phases; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.util.*; import org.eclipse.core.runtime.*; @@ -17,7 +19,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.p2.engine.EngineActivator; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.engine.*; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.ITouchpointType; diff --git a/bundles/org.eclipse.equinox.p2.exemplarysetup/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.exemplarysetup/META-INF/MANIFEST.MF index 5f282de21..7e590a38d 100644 --- a/bundles/org.eclipse.equinox.p2.exemplarysetup/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.exemplarysetup/META-INF/MANIFEST.MF @@ -6,10 +6,12 @@ Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-Version: 1.0.0.qualifier Import-Package: org.eclipse.equinox.internal.p2.core, + org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.p2.director, org.eclipse.equinox.internal.p2.engine, org.eclipse.equinox.internal.p2.garbagecollector, org.eclipse.equinox.internal.p2.metadata.repository, + org.eclipse.equinox.internal.p2.repository.helpers, org.eclipse.equinox.internal.provisional.p2.core.eventbus, org.eclipse.equinox.internal.provisional.p2.core.location, org.eclipse.equinox.internal.provisional.p2.director, diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF index f928e9357..694c7fbec 100644 --- a/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF @@ -15,15 +15,15 @@ Import-Package: org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.p2.update, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core, - org.eclipse.equinox.internal.provisional.p2.core.repository, org.eclipse.equinox.internal.provisional.p2.directorywatcher, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.internal.provisional.p2.metadata.repository, org.eclipse.equinox.internal.provisional.p2.query, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository, - org.eclipse.equinox.internal.provisional.spi.p2.core.repository, org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository, + org.eclipse.equinox.internal.provisional.spi.p2.repository, org.eclipse.equinox.p2.publisher.eclipse, org.eclipse.osgi.service.datalocation;version="1.1.0", org.eclipse.osgi.service.resolver;version="1.2.0", diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java index 130f339b1..c54470cc6 100644 --- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java @@ -18,7 +18,7 @@ import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; -import org.eclipse.equinox.internal.provisional.spi.p2.core.repository.AbstractRepository; +import org.eclipse.equinox.internal.provisional.spi.p2.repository.AbstractRepository; import org.eclipse.osgi.util.NLS; import org.osgi.framework.BundleContext; diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java index 55b88dca3..a0357125b 100644 --- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java +++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java @@ -10,13 +10,14 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.extensionlocation; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.util.Map; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IFileArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.ArtifactRepositoryFactory; import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.SimpleArtifactRepositoryFactory; import org.eclipse.osgi.util.NLS; diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java index 44572db3e..0432c39aa 100644 --- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java +++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java @@ -172,7 +172,7 @@ public class ExtensionLocationMetadataRepository extends AbstractMetadataReposit } /* (non-Javadoc) - * @see org.eclipse.equinox.internal.provisional.spi.p2.core.repository.AbstractRepository#getProperties() + * @see org.eclipse.equinox.internal.provisional.spi.p2.repository.AbstractRepository#getProperties() */ public Map getProperties() { ensureInitialized(); diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java index 77e3ad0cc..37d155731 100644 --- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java +++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java @@ -10,11 +10,12 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.extensionlocation; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.util.Map; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.MetadataRepositoryFactory; import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.SimpleMetadataRepositoryFactory; diff --git a/bundles/org.eclipse.equinox.p2.installer/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.installer/META-INF/MANIFEST.MF index 8f584cb11..1fb38b30f 100644 --- a/bundles/org.eclipse.equinox.p2.installer/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.installer/META-INF/MANIFEST.MF @@ -17,7 +17,8 @@ Require-Bundle: org.eclipse.osgi, org.eclipse.equinox.p2.core, org.eclipse.equinox.p2.artifact.repository, org.eclipse.swt, - org.eclipse.core.net;bundle-version="1.1.0" + org.eclipse.core.net;bundle-version="1.1.0", + org.eclipse.equinox.p2.repository;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1, J2SE-1.4 Export-Package: org.eclipse.equinox.internal.p2.installer;x-internal:=true, diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.metadata.generator/META-INF/MANIFEST.MF index e08be7af8..ba56346da 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.generator/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.metadata.generator/META-INF/MANIFEST.MF @@ -18,6 +18,7 @@ Import-Package: javax.xml.parsers, org.eclipse.equinox.internal.provisional.frameworkadmin, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.internal.provisional.p2.metadata.query, org.eclipse.equinox.internal.provisional.p2.metadata.repository, diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java index 1c1d6a108..050564927 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java +++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.metadata.generator; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.io.File; import java.net.URI; import java.net.URISyntaxException; @@ -27,7 +29,6 @@ import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifact import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.generator.EclipseInstallGeneratorInfoProvider; import org.eclipse.equinox.internal.provisional.p2.metadata.generator.Generator; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java index a3e119408..8f3a5c081 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java +++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java @@ -25,7 +25,6 @@ import org.eclipse.equinox.internal.provisional.frameworkadmin.*; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.*; import org.eclipse.equinox.internal.provisional.p2.core.VersionRange; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.*; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitFragmentDescription; @@ -33,6 +32,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUni import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.query.Collector; import org.eclipse.equinox.internal.provisional.p2.query.Query; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.eclipse.osgi.service.environment.Constants; import org.eclipse.osgi.service.resolver.*; import org.eclipse.osgi.util.NLS; diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF index 5662d2968..e349d3344 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF @@ -39,14 +39,16 @@ Import-Package: javax.xml.parsers, org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.p2.metadata, org.eclipse.equinox.internal.p2.persistence, + org.eclipse.equinox.internal.p2.repository, + org.eclipse.equinox.internal.p2.repository.helpers, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, org.eclipse.equinox.internal.provisional.p2.core.location, - org.eclipse.equinox.internal.provisional.p2.core.repository, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.internal.provisional.p2.metadata.query, org.eclipse.equinox.internal.provisional.p2.query, - org.eclipse.equinox.internal.provisional.spi.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, + org.eclipse.equinox.internal.provisional.spi.p2.repository, org.eclipse.equinox.security.storage, org.eclipse.osgi.service.resolver;version="1.1.0", org.eclipse.osgi.util;version="1.1.0", diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/plugin.properties b/bundles/org.eclipse.equinox.p2.metadata.repository/plugin.properties index 50e0545c0..b1e8fc84c 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/plugin.properties +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/plugin.properties @@ -6,7 +6,7 @@ # http://www.eclipse.org/legal/epl-v10.html # # Contributors: -# IBM Corporation - initial API and implementation +# henrik.lindberg@cloudsmith.com ############################################################################### pluginName = Equinox Provisioning Metadata Repository providerName = Eclipse.org - Equinox diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/mirror/MirrorApplication.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/mirror/MirrorApplication.java index 5281c956b..721348088 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/mirror/MirrorApplication.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/mirror/MirrorApplication.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.metadata.mirror; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.net.URISyntaxException; import java.util.*; @@ -20,7 +22,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.p2.metadata.repository.Activator; import org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java index 6ef3f858e..1b79fff30 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java @@ -15,13 +15,17 @@ import java.net.URI; import java.net.URL; import java.util.*; import org.eclipse.core.runtime.*; +import org.eclipse.ecf.filetransfer.UserCancelledException; import org.eclipse.equinox.internal.p2.core.helpers.*; +import org.eclipse.equinox.internal.p2.repository.AuthenticationFailedException; +import org.eclipse.equinox.internal.p2.repository.RepositoryTransport; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.SynchronousProvisioningListener; import org.eclipse.equinox.internal.provisional.p2.core.location.AgentLocation; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; +import org.eclipse.osgi.util.NLS; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; @@ -38,22 +42,6 @@ public class CacheManager { private static final String JAR_EXTENSION = ".jar"; //$NON-NLS-1$ private static final String XML_EXTENSION = ".xml"; //$NON-NLS-1$ - /** - * Could not find a remote file corresponding to the cache. - */ - private static final int CACHE_MISSING_REMOTE = 0; - /** - * The local cache is stale or missing. - */ - private static final int CACHE_STALE = 1; - /** - * A remote JAR file exists, and is newer than the cache. - */ - private static final int CACHE_STALE_REMOTE_JAR = 2; - /** - * The remote file exists, and the local cache is up to date. - */ - private static final int CACHE_OK = 3; private final HashSet knownPrefixes = new HashSet(5); /** @@ -72,60 +60,107 @@ public class CacheManager { * @param monitor a progress monitor * @return A {@link File} object pointing to the cache file or <code>null</code> * if the location is not a repository. - * @throws IOException - * @throws ProvisionException + * @throws FileNotFound exception if neither jar nor xml index file exists at given location + * @throws AuthenticationFailedException if jar not available and xml causes authentication fail + * @throws IOException on general IO errors + * @throws ProvisionException on any error (e.g. user cancellation, unknown host, malformed address, connection refused, etc.) */ public File createCache(URI repositoryLocation, String prefix, IProgressMonitor monitor) throws IOException, ProvisionException { - knownPrefixes.add(prefix); - File cacheFile = getCache(repositoryLocation, prefix); - URI jarLocation = URIUtil.append(repositoryLocation, prefix + JAR_EXTENSION); - URI xmlLocation = URIUtil.append(repositoryLocation, prefix + XML_EXTENSION); - AgentLocation agentLocation = (AgentLocation) ServiceHelper.getService(Activator.getContext(), AgentLocation.class.getName()); - URL dataArea = agentLocation.getDataArea(Activator.ID + "/cache/"); //$NON-NLS-1$ - File dataAreaFile = URLUtil.toFile(dataArea); - int hashCode = computeHash(repositoryLocation); - int state = getCacheState(repositoryLocation, prefix, cacheFile); - URI remoteFile; - switch (state) { - case CACHE_OK : - return cacheFile; - case CACHE_MISSING_REMOTE : - return null; - case CACHE_STALE_REMOTE_JAR : - //we know there is a remote jar at this point - cacheFile = new File(dataAreaFile, prefix + hashCode + JAR_EXTENSION); - remoteFile = jarLocation; - break; - case CACHE_STALE : - default : - //find the best available remote file - long lastModifiedRemote = getTransport().getLastModified(jarLocation); - if (lastModifiedRemote > 0) { - cacheFile = new File(dataAreaFile, prefix + hashCode + JAR_EXTENSION); - remoteFile = jarLocation; - } else { - lastModifiedRemote = getTransport().getLastModified(xmlLocation); - if (lastModifiedRemote <= 0) - // no jar or xml file found - return null; - cacheFile = new File(dataAreaFile, prefix + hashCode + XML_EXTENSION); - remoteFile = xmlLocation; - } - } - cacheFile.getParentFile().mkdirs(); - OutputStream metadata = new BufferedOutputStream(new FileOutputStream(cacheFile)); - IStatus result; + + SubMonitor submonitor = SubMonitor.convert(monitor, 1000); try { - result = getTransport().download(remoteFile.toString(), metadata, monitor); + knownPrefixes.add(prefix); + File cacheFile = getCache(repositoryLocation, prefix); + URI jarLocation = URIUtil.append(repositoryLocation, prefix + JAR_EXTENSION); + URI xmlLocation = URIUtil.append(repositoryLocation, prefix + XML_EXTENSION); + AgentLocation agentLocation = (AgentLocation) ServiceHelper.getService(Activator.getContext(), AgentLocation.class.getName()); + URL dataArea = agentLocation.getDataArea(Activator.ID + "/cache/"); //$NON-NLS-1$ + File dataAreaFile = URLUtil.toFile(dataArea); + int hashCode = computeHash(repositoryLocation); + + // Knowing if cache is stale is complicated by the fact that a jar could have been + // produced after an xml index (and vice versa), and by the need to capture any + // errors, as these needs to be reported to the user as something meaningful - instead of + // just a general "can't read repository". + // (Previous impl of stale checking ignored errors, and caused multiple round-trips) + boolean stale = true; + long lastModified = 0L; + String name = null; + String useExtension = JAR_EXTENSION; + URI remoteFile = jarLocation; + + if (cacheFile != null) { + cacheFile.lastModified(); + name = cacheFile.getName(); + } + // get last modified on jar + long lastModifiedRemote = 0L; + try { + lastModifiedRemote = getTransport().getLastModified(jarLocation, submonitor.newChild(1)); + } catch (Exception e) { + // just set to 0 and test if xml exists, report general error for the xml file + lastModifiedRemote = 0; + } + if (monitor.isCanceled()) + throw new ProvisionException(Status.CANCEL_STATUS); + + if (lastModifiedRemote != 0) { + // There is a jar, and it should be used - cache is stale if it is xml based or + // if older (irrespective of jar or xml). + stale = lastModifiedRemote > lastModified || (name != null && name.endsWith(XML_EXTENSION)); + } else { + // Also need to check remote XML file, and handle cancel, and errors + // (Status is reported based on finding the XML file as giving up on certain errors + // when checking for the jar may not be correct). + try { + lastModifiedRemote = getTransport().getLastModified(xmlLocation, submonitor.newChild(1)); + // if lastModifiedRemote is 0 - something is wrong in the communication stack, as + // a FileNotFound exception should have been thrown. + if (lastModifiedRemote == 0) + throw new FileNotFoundException(); + } catch (UserCancelledException e) { + throw new ProvisionException(Status.CANCEL_STATUS); + } catch (FileNotFoundException e) { + throw new FileNotFoundException(NLS.bind(Messages.CacheManager_Neither_0_nor_1_found, jarLocation, xmlLocation)); + } catch (AuthenticationFailedException e) { + throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, NLS.bind(Messages.CacheManager_AuthenticationFaileFor_0, repositoryLocation), e)); + } catch (CoreException e) { + throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, NLS.bind(Messages.CacheManager_FailedCommunicationWithRepo_0, repositoryLocation), e)); + + } + // There is an xml, and it should be used - cache is stale if it is jar based or + // if older (irrespective of jar or xml). + stale = lastModifiedRemote > lastModified || (name != null && name.endsWith(JAR_EXTENSION)); + useExtension = XML_EXTENSION; + remoteFile = xmlLocation; + } + + if (!stale) + return cacheFile; + + // Need to update cache + cacheFile = new File(dataAreaFile, prefix + hashCode + useExtension); + cacheFile.getParentFile().mkdirs(); + OutputStream metadata = new BufferedOutputStream(new FileOutputStream(cacheFile)); + IStatus result; + try { + submonitor.setWorkRemaining(1000); + result = getTransport().download(remoteFile, metadata, submonitor.newChild(1000)); + } finally { + metadata.close(); + } + if (!result.isOK()) { + //don't leave a partial cache file lying around + // TODO: HENRIK Handle resume + cacheFile.delete(); + throw new ProvisionException(result); + } + return cacheFile; + } finally { - metadata.close(); - } - if (!result.isOK()) { - //don't leave a partial cache file lying around - cacheFile.delete(); - throw new ProvisionException(result); + if (monitor != null) + monitor.done(); } - return cacheFile; } /** @@ -171,43 +206,8 @@ public class CacheManager { return result; } - private ECFMetadataTransport getTransport() { - return ECFMetadataTransport.getInstance(); - } - - /** - * Checks if the repository's local cache file is out of date. - * @param repositoryLocation The remote location of the file - * @param prefix The prefix to use when creating the cache file - * @param cacheFile The current local cache of the remote location - * @return One of the CACHE_* constants - */ - private int getCacheState(URI repositoryLocation, String prefix, File cacheFile) { - if (cacheFile == null) - return CACHE_STALE; - long lastModified = cacheFile.lastModified(); - String name = cacheFile.getName(); - URI metadataLocation = null; - - if (name.endsWith(XML_EXTENSION)) { - metadataLocation = URIUtil.append(repositoryLocation, prefix + XML_EXTENSION); - } else if (name.endsWith(JAR_EXTENSION)) { - metadataLocation = URIUtil.append(repositoryLocation, prefix + JAR_EXTENSION); - } else { - return CACHE_STALE; - } - long lastModifiedRemote = 0; - try { - lastModifiedRemote = getTransport().getLastModified(metadataLocation); - } catch (ProvisionException e) { - // cache is stale - return CACHE_MISSING_REMOTE; - } - if (lastModifiedRemote <= 0) - return CACHE_MISSING_REMOTE; - if (lastModifiedRemote > lastModified) - return name.endsWith(XML_EXTENSION) ? CACHE_STALE : CACHE_STALE_REMOTE_JAR; - return CACHE_OK; + private RepositoryTransport getTransport() { + return RepositoryTransport.getInstance(); } /** diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java index 1740f30b8..98dce0085 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java @@ -11,6 +11,9 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.metadata.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.ICompositeRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.io.*; import java.net.URI; import java.net.URISyntaxException; @@ -23,8 +26,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryIO; import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.ICompositeRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java index ec6afc1be..3d22658e9 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.metadata.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.io.*; import java.net.URI; import java.util.Map; @@ -20,7 +22,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.Tracing; import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryIO; import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.MetadataRepositoryFactory; import org.eclipse.osgi.util.NLS; diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/ECFMetadataTransport.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/ECFMetadataTransport.java index 66cb46e24..d42838a3a 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/ECFMetadataTransport.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/ECFMetadataTransport.java @@ -10,411 +10,12 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.metadata.repository; -import java.io.*; -import java.net.*; -import org.eclipse.core.runtime.*; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.ecf.core.*; -import org.eclipse.ecf.core.security.ConnectContextFactory; -import org.eclipse.ecf.core.security.IConnectContext; -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.internal.p2.core.helpers.LogHelper; -import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; -import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI; -import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI.AuthenticationInfo; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.security.storage.*; -import org.eclipse.osgi.util.NLS; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleException; -import org.osgi.service.packageadmin.PackageAdmin; -import org.osgi.util.tracker.ServiceTracker; +import org.eclipse.equinox.internal.p2.repository.RepositoryTransport; +/** + * @deprecated + * PLEASE REMOVE THIS CLASS - It is replaced by {@link RepositoryTransport}. + */ public class ECFMetadataTransport { - private static final String SERVER_REDIRECT = "Server redirected too many times"; //$NON-NLS-1$ - /** - * The number of password retry attempts allowed before failing. - */ - private static final int LOGIN_RETRIES = 3; - private static final ProtocolException ERROR_401 = new ProtocolException(); - - /** - * A job that waits on a barrier. - */ - static class WaitJob extends Job { - private final Object[] barrier; - - /** - * Creates a wait job. - * @param location A location string that is used in the job name - * @param barrier The job will wait until the first entry in the barrier is non-null - */ - WaitJob(String location, Object[] barrier) { - super(NLS.bind(Messages.repo_loading, location)); - this.barrier = barrier; - setSystem(true); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) - */ - protected IStatus run(IProgressMonitor monitor) { - synchronized (barrier) { - while (barrier[0] == null) { - try { - barrier.wait(); - } catch (InterruptedException e) { - //ignore - } - } - } - return Status.OK_STATUS; - } - } - - /** - * The singleton transport instance. - */ - private static ECFMetadataTransport instance; - - private final ServiceTracker retrievalFactoryTracker; - - public static synchronized ECFMetadataTransport getInstance() { - if (instance == null) { - instance = new ECFMetadataTransport(); - } - return instance; - } - - private ECFMetadataTransport() { - retrievalFactoryTracker = new ServiceTracker(Activator.getContext(), IRetrieveFileTransferFactory.class.getName(), null); - retrievalFactoryTracker.open(); - startBundle("org.eclipse.ecf.provider.filetransfer"); //$NON-NLS-1$ - } - - private boolean startBundle(String bundleId) { - PackageAdmin packageAdmin = (PackageAdmin) ServiceHelper.getService(Activator.getContext(), PackageAdmin.class.getName()); - if (packageAdmin == null) - return false; - - Bundle[] bundles = packageAdmin.getBundles(bundleId, null); - if (bundles != null && bundles.length > 0) { - for (int i = 0; i < bundles.length; i++) { - try { - if ((bundles[0].getState() & Bundle.INSTALLED) == 0) { - bundles[0].start(); - return true; - } - } catch (BundleException e) { - // failed, try next bundle - } - } - } - return false; - } - - public IStatus download(String url, OutputStream destination, IProgressMonitor monitor) { - try { - IConnectContext context = getConnectionContext(url, false); - for (int i = 0; i < LOGIN_RETRIES; i++) { - try { - return performDownload(url, destination, context, monitor); - } catch (ProtocolException e) { - if (e == ERROR_401) - context = getConnectionContext(url, true); - } - } - } catch (UserCancelledException e) { - return Status.CANCEL_STATUS; - } catch (ProvisionException e) { - return e.getStatus(); - } - //reached maximum number of retries without success - return new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, NLS.bind(Messages.io_failedRead, url), null); - } - - public IStatus performDownload(String toDownload, OutputStream target, IConnectContext context, IProgressMonitor monitor) throws ProtocolException { - IRetrieveFileTransferFactory factory = (IRetrieveFileTransferFactory) retrievalFactoryTracker.getService(); - if (factory == null) - return new Status(IStatus.ERROR, Activator.ID, Messages.ecf_configuration_error); - return transfer(factory.newInstance(), toDownload, target, context, monitor); - } - - /** - * Gets the last modified date for the specified file. - * @param location - The URL location of the file. - * @return A <code>long</code> representing the date. Returns <code>0</code> if the file is not found or an error occurred. - * @exception OperationCanceledException if the request was canceled. - */ - public long getLastModified(URI location) throws ProvisionException { - String locationString = location.toString(); - try { - IConnectContext context = getConnectionContext(locationString, false); - for (int i = 0; i < LOGIN_RETRIES; i++) { - try { - return doGetLastModified(locationString, context); - } catch (ProtocolException e) { - if (ERROR_401 == e) - context = getConnectionContext(locationString, true); - } catch (Exception e) { - e.getMessage(); - } - } - } catch (UserCancelledException e) { - throw new OperationCanceledException(); - } - //too many retries, so report as failure - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, NLS.bind(Messages.io_failedRead, locationString), null)); - } - - /** - * Perform the ECF call to get the last modified time, failing if there is any - * protocol failure such as an authentication failure. - */ - private long doGetLastModified(String location, IConnectContext context) throws ProtocolException { - IContainer container; - try { - container = ContainerFactory.getDefault().createContainer(); - } catch (ContainerCreateException e) { - return 0; - } - IRemoteFileSystemBrowserContainerAdapter adapter = (IRemoteFileSystemBrowserContainerAdapter) container.getAdapter(IRemoteFileSystemBrowserContainerAdapter.class); - if (adapter == null) { - return 0; - } - IRemoteFile remoteFile = checkFile(adapter, location, context); - if (remoteFile == null) { - return 0; - } - return remoteFile.getInfo().getLastModified(); - } - - /** - * Returns the connection context for the given URL. This may prompt the - * user for user name and password as required. - * - * @param xmlLocation - the file location requiring login details - * @param prompt - use <code>true</code> to prompt the user instead of - * looking at the secure preference store for login, use <code>false</code> - * to only try the secure preference store - * @throws UserCancelledException when the user cancels the login prompt - * @throws ProvisionException if the password cannot be read or saved - * @return The connection context - */ - public IConnectContext getConnectionContext(String xmlLocation, boolean prompt) throws UserCancelledException, ProvisionException { - ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault(); - IPath hostLocation = new Path(xmlLocation).removeLastSegments(1); - String nodeKey; - try { - nodeKey = URLEncoder.encode(hostLocation.toString(), "UTF-8"); //$NON-NLS-1$ - } catch (UnsupportedEncodingException e2) { - //fall back to default platform encoding - nodeKey = URLEncoder.encode(hostLocation.toString()); - } - String nodeName = IRepository.PREFERENCE_NODE + '/' + nodeKey; - ISecurePreferences prefNode = null; - if (securePreferences.nodeExists(nodeName)) - prefNode = securePreferences.node(nodeName); - if (!prompt) { - if (prefNode == null) - return null; - try { - String username = prefNode.get(IRepository.PROP_USERNAME, null); - String password = prefNode.get(IRepository.PROP_PASSWORD, null); - //if we don't have stored connection data just return a null connection context - if (username == null || password == null) - return null; - return ConnectContextFactory.createUsernamePasswordConnectContext(username, password); - } catch (StorageException e) { - String msg = NLS.bind(Messages.repoMan_internalError, xmlLocation.toString()); - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.INTERNAL_ERROR, msg, null)); - } - } - //need to prompt user for user name and password - ServiceTracker adminUITracker = new ServiceTracker(Activator.getContext(), IServiceUI.class.getName(), null); - adminUITracker.open(); - IServiceUI adminUIService = (IServiceUI) adminUITracker.getService(); - AuthenticationInfo loginDetails = null; - if (adminUIService != null) - loginDetails = adminUIService.getUsernamePassword(hostLocation.toString()); - //null result means user canceled password dialog - if (loginDetails == null) - throw new UserCancelledException(); - //save user name and password if requested by user - if (loginDetails.saveResult()) { - if (prefNode == null) - prefNode = securePreferences.node(nodeName); - try { - prefNode.put(IRepository.PROP_USERNAME, loginDetails.getUserName(), true); - prefNode.put(IRepository.PROP_PASSWORD, loginDetails.getPassword(), true); - prefNode.flush(); - } catch (StorageException e1) { - String msg = NLS.bind(Messages.repoMan_internalError, xmlLocation.toString()); - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.INTERNAL_ERROR, msg, null)); - } catch (IOException e) { - String msg = NLS.bind(Messages.repoMan_internalError, xmlLocation.toString()); - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.INTERNAL_ERROR, msg, null)); - } - } - return ConnectContextFactory.createUsernamePasswordConnectContext(loginDetails.getUserName(), loginDetails.getPassword()); - } - - private IRemoteFile checkFile(final IRemoteFileSystemBrowserContainerAdapter retrievalContainer, final String location, IConnectContext context) throws ProtocolException { - final Object[] result = new Object[2]; - final Object FAIL = new Object(); - IRemoteFileSystemListener listener = new IRemoteFileSystemListener() { - public void handleRemoteFileEvent(IRemoteFileSystemEvent event) { - Exception exception = event.getException(); - if (exception != null) { - synchronized (result) { - result[0] = FAIL; - result[1] = exception; - result.notify(); - } - } else if (event instanceof IRemoteFileSystemBrowseEvent) { - IRemoteFileSystemBrowseEvent fsbe = (IRemoteFileSystemBrowseEvent) event; - IRemoteFile[] remoteFiles = fsbe.getRemoteFiles(); - if (remoteFiles != null && remoteFiles.length > 0 && remoteFiles[0] != null) { - synchronized (result) { - result[0] = remoteFiles[0]; - result.notify(); - } - } else { - synchronized (result) { - result[0] = FAIL; - result.notify(); - } - } - } - } - }; - try { - retrievalContainer.setConnectContextForAuthentication(context); - retrievalContainer.sendBrowseRequest(FileIDFactory.getDefault().createFileID(retrievalContainer.getBrowseNamespace(), location), listener); - } catch (RemoteFileSystemException e) { - return null; - } catch (FileCreateException e) { - return null; - } - waitFor(location, result); - if (result[0] == FAIL && result[1] instanceof IOException) { - IOException ioException = (IOException) result[1]; - //throw a special exception for authentication failure so we know to prompt for username/password - String message = ioException.getMessage(); - if (message != null && (message.indexOf(" 401 ") != -1 || message.indexOf(SERVER_REDIRECT) != -1)) //$NON-NLS-1$ - throw ERROR_401; - } - if (result[0] instanceof IRemoteFile) - return (IRemoteFile) result[0]; - return null; - } - - /** - * Check if the given exception represents a permission failure (401 for HTTP), - * and throw a special marker exception if a permission failure was encountered. - */ - private void checkPermissionDenied(Throwable t) throws ProtocolException { - if (!(t instanceof IncomingFileTransferException)) - return; - IncomingFileTransferException e = (IncomingFileTransferException) t; - if (e.getErrorCode() == 401) - throw ERROR_401; - //try to figure out if we have a 401 by parsing the exception message - IStatus status = e.getStatus(); - Throwable exception = status.getException(); - if (exception instanceof IOException) - if (exception.getMessage() != null && (exception.getMessage().indexOf(" 401 ") != -1 || exception.getMessage().indexOf(SERVER_REDIRECT) != -1)) //$NON-NLS-1$ - throw ERROR_401; - } - - /** - * Waits until the first entry in the given array is non-null. - */ - private void waitFor(String location, Object[] barrier) { - WaitJob wait = new WaitJob(location, barrier); - wait.schedule(); - while (barrier[0] == null) { - boolean logged = false; - try { - wait.join(); - } catch (InterruptedException e) { - if (!logged) - LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "Unexpected interrupt while waiting on ECF transfer", e)); //$NON-NLS-1$ - } - } - } - - private IStatus transfer(final IRetrieveFileTransferContainerAdapter retrievalContainer, final String toDownload, final OutputStream target, IConnectContext context, final IProgressMonitor monitor) throws ProtocolException { - final IStatus[] result = new IStatus[1]; - IFileTransferListener listener = new IFileTransferListener() { - - public void handleTransferEvent(IFileTransferEvent event) { - if (event instanceof IFileTransferConnectStartEvent) { - IFileTransferConnectStartEvent cse = (IFileTransferConnectStartEvent) event; - FileTransferJob connectJob = cse.prepareConnectJob(null); - cse.connectUsingJob(connectJob); - } else if (event instanceof IIncomingFileTransferReceiveStartEvent) { - IIncomingFileTransferReceiveStartEvent rse = (IIncomingFileTransferReceiveStartEvent) event; - if (target != null) { - try { - rse.receive(target); - } catch (IOException e) { - IStatus status = convertToStatus(e); - synchronized (result) { - result[0] = status; - result.notify(); - } - } - } - } - if (event instanceof IIncomingFileTransferReceiveDataEvent) { - IIncomingFileTransfer source = ((IIncomingFileTransferReceiveDataEvent) event).getSource(); - if (monitor != null) { - if (monitor.isCanceled()) - source.cancel(); - } - } - if (event instanceof IIncomingFileTransferReceiveDoneEvent) { - IStatus status = convertToStatus(((IIncomingFileTransferReceiveDoneEvent) event).getException()); - synchronized (result) { - result[0] = status; - result.notify(); - } - } - } - }; - - try { - retrievalContainer.setConnectContextForAuthentication(context); - retrievalContainer.sendRetrieveRequest(FileIDFactory.getDefault().createFileID(retrievalContainer.getRetrieveNamespace(), toDownload), listener, null); - } catch (IncomingFileTransferException e) { - checkPermissionDenied(e); - return e.getStatus(); - } catch (FileCreateException e) { - return e.getStatus(); - } - waitFor(toDownload, result); - final Throwable exception = result[0].getException(); - checkPermissionDenied(exception); - //if the transfer failed, return the underlying exception status, otherwise return top level DownloadStatus - if (exception instanceof IncomingFileTransferException) { - IStatus cause = ((IncomingFileTransferException) exception).getStatus(); - if (!cause.isOK()) - return cause; - } - return result[0]; - } - - protected IStatus convertToStatus(Exception e) { - if (e == null) - return Status.OK_STATUS; - if (e instanceof UserCancelledException) - return new Status(IStatus.CANCEL, Activator.ID, e.getMessage(), e); - return new Status(IStatus.ERROR, Activator.ID, e.getMessage(), e); - } + // TODO: remove this class } diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java index 82d45155a..155c4aae9 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java @@ -11,6 +11,9 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.metadata.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; + import java.io.*; import java.net.URI; import java.util.*; @@ -21,8 +24,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.query.Collector; diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/Messages.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/Messages.java index e86d9f777..8682c8527 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/Messages.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/Messages.java @@ -22,6 +22,9 @@ public class Messages extends NLS { // Do not instantiate } + public static String CacheManager_AuthenticationFaileFor_0; + public static String CacheManager_FailedCommunicationWithRepo_0; + public static String CacheManager_Neither_0_nor_1_found; public static String io_failedRead; public static String io_failedWrite; public static String ecf_configuration_error; diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java index 6ba9f8288..939ee6469 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java @@ -11,12 +11,14 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.metadata.repository; +import org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager; + +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import java.util.*; import org.eclipse.core.runtime.*; -import org.eclipse.equinox.internal.p2.core.helpers.AbstractRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.query.*; diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java index 59eab610d..2cf200ea4 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java @@ -10,9 +10,10 @@ *******************************************************************************/ package org.eclipse.equinox.internal.provisional.p2.metadata.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.query.IQueryable; import org.eclipse.equinox.internal.provisional.p2.query.Query; diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java index 8bc7a15a9..d18b812c5 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java @@ -10,12 +10,13 @@ *******************************************************************************/ package org.eclipse.equinox.internal.provisional.p2.metadata.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.util.Map; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.query.IQueryable; /** diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java index 0028203d0..9f396a368 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository; +import org.eclipse.equinox.internal.provisional.spi.p2.repository.AbstractRepository; + import java.net.URI; import java.util.Map; import org.eclipse.core.runtime.IProgressMonitor; @@ -17,7 +19,6 @@ import org.eclipse.equinox.internal.provisional.p2.core.Version; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.query.Query; -import org.eclipse.equinox.internal.provisional.spi.p2.core.repository.AbstractRepository; /** * The common base class for all metadata repositories. diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/MetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/MetadataRepositoryFactory.java index 40a5f0a1a..5c58923b5 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/MetadataRepositoryFactory.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/MetadataRepositoryFactory.java @@ -10,12 +10,13 @@ *******************************************************************************/ package org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.util.Map; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; /** diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/SimpleMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/SimpleMetadataRepositoryFactory.java index bbbbb4c90..f280f9c47 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/SimpleMetadataRepositoryFactory.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/SimpleMetadataRepositoryFactory.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.io.*; import java.net.URI; import java.util.Map; @@ -19,7 +21,6 @@ import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.core.helpers.Tracing; import org.eclipse.equinox.internal.p2.metadata.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.osgi.util.NLS; @@ -60,6 +61,7 @@ public class SimpleMetadataRepositoryFactory extends MetadataRepositoryFactory { localFile = Activator.getCacheManager().createCache(location, URLMetadataRepository.CONTENT_FILENAME, monitor); if (localFile == null) { //there is no remote file in either form + // TODO HENRIK: Cause of problem is unknown (can be Unknown Host, etc.) - this must be communicated. String msg = NLS.bind(Messages.io_failedRead, location); throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null)); } diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src_ant/org/eclipse/equinox/internal/p2/metadata/repository/ant/CreateCompositeMetadataRepositoryTask.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src_ant/org/eclipse/equinox/internal/p2/metadata/repository/ant/CreateCompositeMetadataRepositoryTask.java index c4d74fe6b..b6558259f 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src_ant/org/eclipse/equinox/internal/p2/metadata/repository/ant/CreateCompositeMetadataRepositoryTask.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src_ant/org/eclipse/equinox/internal/p2/metadata/repository/ant/CreateCompositeMetadataRepositoryTask.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.metadata.repository.ant; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import java.net.URISyntaxException; import java.util.HashMap; @@ -21,7 +23,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.p2.metadata.repository.Activator; import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; diff --git a/bundles/org.eclipse.equinox.p2.publisher/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.publisher/META-INF/MANIFEST.MF index 62476d636..7b41d2560 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.publisher/META-INF/MANIFEST.MF @@ -20,7 +20,7 @@ Import-Package: javax.xml.parsers, org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.internal.provisional.p2.metadata.query, org.eclipse.equinox.internal.provisional.p2.metadata.repository, diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java index 9487995e3..ea999692e 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java @@ -10,6 +10,9 @@ ******************************************************************************/ package org.eclipse.equinox.p2.publisher; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.util.Collection; import org.eclipse.core.runtime.*; @@ -18,8 +21,6 @@ import org.eclipse.equinox.internal.p2.publisher.Activator; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java index 7c53a2f6e..5bc551343 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java @@ -10,6 +10,8 @@ ******************************************************************************/ package org.eclipse.equinox.p2.publisher.eclipse; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.io.*; import java.net.URI; import java.net.URISyntaxException; @@ -27,7 +29,6 @@ import org.eclipse.equinox.internal.provisional.p2.artifact.repository.ArtifactD import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactDescriptor; import org.eclipse.equinox.internal.provisional.p2.core.Version; import org.eclipse.equinox.internal.provisional.p2.core.VersionRange; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.*; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitPatchDescription; diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF index 0679803a9..f687f9528 100644 --- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF @@ -9,15 +9,15 @@ Bundle-Activator: org.eclipse.equinox.internal.p2.reconciler.dropins.Activator Bundle-RequiredExecutionEnvironment: J2SE-1.4, CDC-1.1/Foundation-1.1 Import-Package: org.eclipse.equinox.app;version="1.0.0", + org.eclipse.equinox.internal.p2.artifact.repository, org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.p2.extensionlocation, - org.eclipse.equinox.internal.p2.artifact.repository, org.eclipse.equinox.internal.p2.metadata.repository, org.eclipse.equinox.internal.p2.update, org.eclipse.equinox.internal.provisional.configurator, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.director, org.eclipse.equinox.internal.provisional.p2.directorywatcher, org.eclipse.equinox.internal.provisional.p2.engine, @@ -26,8 +26,8 @@ Import-Package: org.eclipse.equinox.app;version="1.0.0", org.eclipse.equinox.internal.provisional.p2.metadata.repository, org.eclipse.equinox.internal.provisional.p2.query, org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository, - org.eclipse.equinox.internal.provisional.spi.p2.core.repository, org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository, + org.eclipse.equinox.internal.provisional.spi.p2.repository, org.eclipse.osgi.service.datalocation;version="1.0.0", org.eclipse.osgi.service.environment;version="1.1.0", org.eclipse.osgi.util;version="1.1.0", diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java index a8ac4abf4..6636bea3d 100644 --- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java +++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java @@ -23,12 +23,12 @@ import org.eclipse.equinox.internal.p2.update.PathUtil; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWatcher; import org.eclipse.equinox.internal.provisional.p2.engine.IProfile; import org.eclipse.equinox.internal.provisional.p2.engine.IProfileRegistry; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.eclipse.osgi.service.datalocation.Location; import org.osgi.framework.*; import org.osgi.service.packageadmin.PackageAdmin; diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java index d2fe079c9..5eba158e5 100644 --- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java +++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java @@ -11,6 +11,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.reconciler.dropins; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.io.*; import java.net.URI; import java.net.URISyntaxException; @@ -24,7 +26,6 @@ import org.eclipse.equinox.internal.p2.update.Site; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java index aa4088a95..7c7c4ca9e 100644 --- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java +++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java @@ -21,13 +21,13 @@ import org.eclipse.equinox.internal.provisional.configurator.Configurator; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IFileArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.director.*; import org.eclipse.equinox.internal.provisional.p2.engine.*; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.query.Collector; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.eclipse.osgi.service.environment.EnvironmentInfo; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.repository.tools/META-INF/MANIFEST.MF index 3acb7f226..84fc38c11 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.repository.tools/META-INF/MANIFEST.MF @@ -19,7 +19,7 @@ Import-Package: org.apache.tools.ant, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing, org.eclipse.equinox.internal.provisional.p2.core, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.engine.phases, org.eclipse.equinox.internal.provisional.p2.metadata, diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/AbstractApplication.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/AbstractApplication.java index e8f0db80b..ea60cceec 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/AbstractApplication.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/AbstractApplication.java @@ -10,6 +10,9 @@ *******************************************************************************/ package org.eclipse.equinox.p2.internal.repository.tools; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.net.URISyntaxException; import java.util.*; @@ -19,8 +22,6 @@ import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepo import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java index 1d826de79..8f9926860 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java @@ -11,6 +11,9 @@ package org.eclipse.equinox.p2.internal.repository.tools; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.io.File; import java.io.IOException; import java.net.URI; @@ -20,8 +23,6 @@ import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifact import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepDescriptor; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; import org.eclipse.osgi.util.NLS; diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RepositoryDescriptor.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RepositoryDescriptor.java index d0e6193d0..a93f05f85 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RepositoryDescriptor.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RepositoryDescriptor.java @@ -10,8 +10,9 @@ *******************************************************************************/ package org.eclipse.equinox.p2.internal.repository.tools; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; public class RepositoryDescriptor { diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java index 6ef3f858e..1b79fff30 100644 --- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java +++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java @@ -15,13 +15,17 @@ import java.net.URI; import java.net.URL; import java.util.*; import org.eclipse.core.runtime.*; +import org.eclipse.ecf.filetransfer.UserCancelledException; import org.eclipse.equinox.internal.p2.core.helpers.*; +import org.eclipse.equinox.internal.p2.repository.AuthenticationFailedException; +import org.eclipse.equinox.internal.p2.repository.RepositoryTransport; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.SynchronousProvisioningListener; import org.eclipse.equinox.internal.provisional.p2.core.location.AgentLocation; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; +import org.eclipse.osgi.util.NLS; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; @@ -38,22 +42,6 @@ public class CacheManager { private static final String JAR_EXTENSION = ".jar"; //$NON-NLS-1$ private static final String XML_EXTENSION = ".xml"; //$NON-NLS-1$ - /** - * Could not find a remote file corresponding to the cache. - */ - private static final int CACHE_MISSING_REMOTE = 0; - /** - * The local cache is stale or missing. - */ - private static final int CACHE_STALE = 1; - /** - * A remote JAR file exists, and is newer than the cache. - */ - private static final int CACHE_STALE_REMOTE_JAR = 2; - /** - * The remote file exists, and the local cache is up to date. - */ - private static final int CACHE_OK = 3; private final HashSet knownPrefixes = new HashSet(5); /** @@ -72,60 +60,107 @@ public class CacheManager { * @param monitor a progress monitor * @return A {@link File} object pointing to the cache file or <code>null</code> * if the location is not a repository. - * @throws IOException - * @throws ProvisionException + * @throws FileNotFound exception if neither jar nor xml index file exists at given location + * @throws AuthenticationFailedException if jar not available and xml causes authentication fail + * @throws IOException on general IO errors + * @throws ProvisionException on any error (e.g. user cancellation, unknown host, malformed address, connection refused, etc.) */ public File createCache(URI repositoryLocation, String prefix, IProgressMonitor monitor) throws IOException, ProvisionException { - knownPrefixes.add(prefix); - File cacheFile = getCache(repositoryLocation, prefix); - URI jarLocation = URIUtil.append(repositoryLocation, prefix + JAR_EXTENSION); - URI xmlLocation = URIUtil.append(repositoryLocation, prefix + XML_EXTENSION); - AgentLocation agentLocation = (AgentLocation) ServiceHelper.getService(Activator.getContext(), AgentLocation.class.getName()); - URL dataArea = agentLocation.getDataArea(Activator.ID + "/cache/"); //$NON-NLS-1$ - File dataAreaFile = URLUtil.toFile(dataArea); - int hashCode = computeHash(repositoryLocation); - int state = getCacheState(repositoryLocation, prefix, cacheFile); - URI remoteFile; - switch (state) { - case CACHE_OK : - return cacheFile; - case CACHE_MISSING_REMOTE : - return null; - case CACHE_STALE_REMOTE_JAR : - //we know there is a remote jar at this point - cacheFile = new File(dataAreaFile, prefix + hashCode + JAR_EXTENSION); - remoteFile = jarLocation; - break; - case CACHE_STALE : - default : - //find the best available remote file - long lastModifiedRemote = getTransport().getLastModified(jarLocation); - if (lastModifiedRemote > 0) { - cacheFile = new File(dataAreaFile, prefix + hashCode + JAR_EXTENSION); - remoteFile = jarLocation; - } else { - lastModifiedRemote = getTransport().getLastModified(xmlLocation); - if (lastModifiedRemote <= 0) - // no jar or xml file found - return null; - cacheFile = new File(dataAreaFile, prefix + hashCode + XML_EXTENSION); - remoteFile = xmlLocation; - } - } - cacheFile.getParentFile().mkdirs(); - OutputStream metadata = new BufferedOutputStream(new FileOutputStream(cacheFile)); - IStatus result; + + SubMonitor submonitor = SubMonitor.convert(monitor, 1000); try { - result = getTransport().download(remoteFile.toString(), metadata, monitor); + knownPrefixes.add(prefix); + File cacheFile = getCache(repositoryLocation, prefix); + URI jarLocation = URIUtil.append(repositoryLocation, prefix + JAR_EXTENSION); + URI xmlLocation = URIUtil.append(repositoryLocation, prefix + XML_EXTENSION); + AgentLocation agentLocation = (AgentLocation) ServiceHelper.getService(Activator.getContext(), AgentLocation.class.getName()); + URL dataArea = agentLocation.getDataArea(Activator.ID + "/cache/"); //$NON-NLS-1$ + File dataAreaFile = URLUtil.toFile(dataArea); + int hashCode = computeHash(repositoryLocation); + + // Knowing if cache is stale is complicated by the fact that a jar could have been + // produced after an xml index (and vice versa), and by the need to capture any + // errors, as these needs to be reported to the user as something meaningful - instead of + // just a general "can't read repository". + // (Previous impl of stale checking ignored errors, and caused multiple round-trips) + boolean stale = true; + long lastModified = 0L; + String name = null; + String useExtension = JAR_EXTENSION; + URI remoteFile = jarLocation; + + if (cacheFile != null) { + cacheFile.lastModified(); + name = cacheFile.getName(); + } + // get last modified on jar + long lastModifiedRemote = 0L; + try { + lastModifiedRemote = getTransport().getLastModified(jarLocation, submonitor.newChild(1)); + } catch (Exception e) { + // just set to 0 and test if xml exists, report general error for the xml file + lastModifiedRemote = 0; + } + if (monitor.isCanceled()) + throw new ProvisionException(Status.CANCEL_STATUS); + + if (lastModifiedRemote != 0) { + // There is a jar, and it should be used - cache is stale if it is xml based or + // if older (irrespective of jar or xml). + stale = lastModifiedRemote > lastModified || (name != null && name.endsWith(XML_EXTENSION)); + } else { + // Also need to check remote XML file, and handle cancel, and errors + // (Status is reported based on finding the XML file as giving up on certain errors + // when checking for the jar may not be correct). + try { + lastModifiedRemote = getTransport().getLastModified(xmlLocation, submonitor.newChild(1)); + // if lastModifiedRemote is 0 - something is wrong in the communication stack, as + // a FileNotFound exception should have been thrown. + if (lastModifiedRemote == 0) + throw new FileNotFoundException(); + } catch (UserCancelledException e) { + throw new ProvisionException(Status.CANCEL_STATUS); + } catch (FileNotFoundException e) { + throw new FileNotFoundException(NLS.bind(Messages.CacheManager_Neither_0_nor_1_found, jarLocation, xmlLocation)); + } catch (AuthenticationFailedException e) { + throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, NLS.bind(Messages.CacheManager_AuthenticationFaileFor_0, repositoryLocation), e)); + } catch (CoreException e) { + throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, NLS.bind(Messages.CacheManager_FailedCommunicationWithRepo_0, repositoryLocation), e)); + + } + // There is an xml, and it should be used - cache is stale if it is jar based or + // if older (irrespective of jar or xml). + stale = lastModifiedRemote > lastModified || (name != null && name.endsWith(JAR_EXTENSION)); + useExtension = XML_EXTENSION; + remoteFile = xmlLocation; + } + + if (!stale) + return cacheFile; + + // Need to update cache + cacheFile = new File(dataAreaFile, prefix + hashCode + useExtension); + cacheFile.getParentFile().mkdirs(); + OutputStream metadata = new BufferedOutputStream(new FileOutputStream(cacheFile)); + IStatus result; + try { + submonitor.setWorkRemaining(1000); + result = getTransport().download(remoteFile, metadata, submonitor.newChild(1000)); + } finally { + metadata.close(); + } + if (!result.isOK()) { + //don't leave a partial cache file lying around + // TODO: HENRIK Handle resume + cacheFile.delete(); + throw new ProvisionException(result); + } + return cacheFile; + } finally { - metadata.close(); - } - if (!result.isOK()) { - //don't leave a partial cache file lying around - cacheFile.delete(); - throw new ProvisionException(result); + if (monitor != null) + monitor.done(); } - return cacheFile; } /** @@ -171,43 +206,8 @@ public class CacheManager { return result; } - private ECFMetadataTransport getTransport() { - return ECFMetadataTransport.getInstance(); - } - - /** - * Checks if the repository's local cache file is out of date. - * @param repositoryLocation The remote location of the file - * @param prefix The prefix to use when creating the cache file - * @param cacheFile The current local cache of the remote location - * @return One of the CACHE_* constants - */ - private int getCacheState(URI repositoryLocation, String prefix, File cacheFile) { - if (cacheFile == null) - return CACHE_STALE; - long lastModified = cacheFile.lastModified(); - String name = cacheFile.getName(); - URI metadataLocation = null; - - if (name.endsWith(XML_EXTENSION)) { - metadataLocation = URIUtil.append(repositoryLocation, prefix + XML_EXTENSION); - } else if (name.endsWith(JAR_EXTENSION)) { - metadataLocation = URIUtil.append(repositoryLocation, prefix + JAR_EXTENSION); - } else { - return CACHE_STALE; - } - long lastModifiedRemote = 0; - try { - lastModifiedRemote = getTransport().getLastModified(metadataLocation); - } catch (ProvisionException e) { - // cache is stale - return CACHE_MISSING_REMOTE; - } - if (lastModifiedRemote <= 0) - return CACHE_MISSING_REMOTE; - if (lastModifiedRemote > lastModified) - return name.endsWith(XML_EXTENSION) ? CACHE_STALE : CACHE_STALE_REMOTE_JAR; - return CACHE_OK; + private RepositoryTransport getTransport() { + return RepositoryTransport.getInstance(); } /** diff --git a/bundles/org.eclipse.equinox.p2.tests.optimizers/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests.optimizers/META-INF/MANIFEST.MF index d5ebaecff..b453b2380 100644 --- a/bundles/org.eclipse.equinox.p2.tests.optimizers/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.tests.optimizers/META-INF/MANIFEST.MF @@ -24,6 +24,7 @@ Import-Package: ie.wombat.jbdiff, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing, org.eclipse.equinox.internal.provisional.p2.metadata, + org.eclipse.equinox.internal.provisional.p2.repository, org.osgi.framework;version="1.4.0" Bundle-ActivationPolicy: lazy Bundle-Activator: org.eclipse.equinox.p2.tests.optimizers.TestActivator diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests.ui/META-INF/MANIFEST.MF index 2229f74d4..954aff719 100644 --- a/bundles/org.eclipse.equinox.p2.tests.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.tests.ui/META-INF/MANIFEST.MF @@ -17,4 +17,5 @@ Require-Bundle: org.eclipse.equinox.p2.tests;bundle-version="1.1.0", org.eclipse.equinox.p2.engine;bundle-version="1.0.100", org.eclipse.equinox.p2.director;bundle-version="1.0.100", org.eclipse.equinox.p2.artifact.repository;bundle-version="1.0.100", - org.junit;bundle-version="[3.8.0,4.0.0)" + org.junit;bundle-version="[3.8.0,4.0.0)", + org.eclipse.equinox.p2.repository;bundle-version="1.0.0" diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java index 8d754a792..938d7d04a 100644 --- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java +++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.ui; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.io.File; import java.net.URI; import org.eclipse.core.runtime.*; @@ -17,7 +19,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.Version; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest; import org.eclipse.equinox.internal.provisional.p2.director.ProvisioningPlan; import org.eclipse.equinox.internal.provisional.p2.engine.*; diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/ProvisioningUtilTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/ProvisioningUtilTest.java index d4be5641b..57ebbbcf7 100644 --- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/ProvisioningUtilTest.java +++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/ProvisioningUtilTest.java @@ -10,10 +10,11 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.ui.operations; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil; import org.eclipse.equinox.p2.tests.ui.AbstractProvisioningUITest; diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java index 4d06a04f3..01f4b4750 100644 --- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java @@ -10,7 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.ui.query; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import org.eclipse.equinox.internal.provisional.p2.query.MatchQuery; import org.eclipse.equinox.internal.provisional.p2.query.Query; import org.eclipse.equinox.internal.provisional.p2.ui.policy.IUViewQueryContext; diff --git a/bundles/org.eclipse.equinox.p2.tests/All p2 Tests.launch b/bundles/org.eclipse.equinox.p2.tests/All p2 Tests.launch index 6c0d7eea6..103bddbd9 100644 --- a/bundles/org.eclipse.equinox.p2.tests/All p2 Tests.launch +++ b/bundles/org.eclipse.equinox.p2.tests/All p2 Tests.launch @@ -6,6 +6,7 @@ <booleanAttribute key="automaticAdd" value="true"/> <booleanAttribute key="automaticValidate" value="false"/> <stringAttribute key="bootstrap" value=""/> +<stringAttribute key="checked" value="[NONE]"/> <booleanAttribute key="clearConfig" value="true"/> <booleanAttribute key="clearws" value="true"/> <booleanAttribute key="clearwslog" value="false"/> @@ -41,7 +42,7 @@ <stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/> <booleanAttribute key="default" value="true"/> <booleanAttribute key="includeOptional" value="true"/> -<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/> +<stringAttribute key="location" value="${workspace_loc}/../junit2-workspace"/> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> <listEntry value="/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AutomatedTests.java"/> </listAttribute> diff --git a/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF index ced4ef803..c050bd2a1 100644 --- a/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF @@ -5,7 +5,7 @@ Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-Version: 1.1.0.qualifier -Import-Package: javax.xml.parsers, +Import-Package: javax.xml.parsers, org.eclipse.equinox.internal.p2.artifact.mirror, org.eclipse.equinox.internal.p2.artifact.processors.md5, org.eclipse.equinox.internal.p2.artifact.processors.pack200, @@ -38,7 +38,7 @@ Import-Package: javax.xml.parsers, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, org.eclipse.equinox.internal.provisional.p2.core.location, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.director, org.eclipse.equinox.internal.provisional.p2.directorywatcher, org.eclipse.equinox.internal.provisional.p2.engine, @@ -48,8 +48,8 @@ Import-Package: javax.xml.parsers, org.eclipse.equinox.internal.provisional.p2.metadata.repository, org.eclipse.equinox.internal.provisional.p2.query, org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository, - org.eclipse.equinox.internal.provisional.spi.p2.core.repository, org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository, + org.eclipse.equinox.internal.provisional.spi.p2.repository, org.eclipse.equinox.spi.p2.publisher, org.eclipse.internal.provisional.equinox.p2.jarprocessor, org.eclipse.osgi.service.datalocation, @@ -75,9 +75,10 @@ Require-Bundle: org.eclipse.equinox.p2.metadata.generator, org.sat4j.core;bundle-version="2.0.0", org.sat4j.pb;bundle-version="2.0.0", org.eclipse.equinox.p2.installer;bundle-version="[1.0.0,2.0.0)", - org.eclipse.equinox.simpleconfigurator;bundle-version="1.0.100", + org.eclipse.equinox.simpleconfigurator;bundle-version="1.0.100", org.eclipse.equinox.p2.updatechecker;bundle-version="1.0.0", - org.eclipse.equinox.simpleconfigurator.manipulator;bundle-version="1.0.100" + org.eclipse.equinox.simpleconfigurator.manipulator;bundle-version="1.0.100", + org.eclipse.equinox.p2.repository;bundle-version="1.0.0" Bundle-ActivationPolicy: lazy Eclipse-RegisterBuddy: org.eclipse.equinox.p2.artifact.repository Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java index 4fdd015cd..02e691b86 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java @@ -8,6 +8,8 @@ ******************************************************************************/ package org.eclipse.equinox.p2.tests; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.io.*; import java.net.URI; import java.net.URL; @@ -21,7 +23,6 @@ import org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryMan import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.*; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.director.*; import org.eclipse.equinox.internal.provisional.p2.engine.*; import org.eclipse.equinox.internal.provisional.p2.metadata.*; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java index 37b622895..9f55eabbe 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java @@ -17,11 +17,11 @@ import java.util.*; import junit.framework.Assert; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRequest; -import org.eclipse.equinox.internal.p2.artifact.repository.Transport; +import org.eclipse.equinox.internal.p2.repository.Transport; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryCreationException; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryCreationException; import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.AbstractArtifactRepository; /** @@ -51,6 +51,7 @@ public class TestArtifactRepository extends AbstractArtifactRepository { Set artifactDescriptors = new HashSet(); Transport testhandler = new Transport() { + @Deprecated public IStatus download(String toDownload, OutputStream target, IProgressMonitor pm) { byte[] contents = (byte[]) locationsToContents.get(toDownload); if (contents == null) @@ -63,6 +64,10 @@ public class TestArtifactRepository extends AbstractArtifactRepository { } return Status.OK_STATUS; } + + public IStatus download(URI toDownload, OutputStream target, IProgressMonitor pm) { + return download(toDownload.toString(), target, pm); + } }; public TestArtifactRepository() { diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java index 6e4b1e999..6bef4909e 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java @@ -8,13 +8,14 @@ ******************************************************************************/ package org.eclipse.equinox.p2.tests; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import java.net.URISyntaxException; import java.util.*; import junit.framework.Assert; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.equinox.internal.provisional.p2.core.Version; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestRepositoryListener.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestRepositoryListener.java index 4c4987e53..1a95e278e 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestRepositoryListener.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestRepositoryListener.java @@ -10,11 +10,12 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; + import java.net.URI; import java.util.EventObject; import junit.framework.Assert; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.SynchronousProvisioningListener; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; /** * A provisioning event listener used for testing purposes. If a location is provided, diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java index 08e664862..a504addd4 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java @@ -17,10 +17,12 @@ import org.eclipse.core.runtime.Status; import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository; import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.ArtifactOutputStream; import org.eclipse.equinox.internal.p2.metadata.ArtifactKey; -import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; +import org.eclipse.equinox.internal.provisional.p2.artifact.repository.ArtifactDescriptor; +import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactDescriptor; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStep; import org.eclipse.equinox.internal.provisional.p2.core.Version; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; +import org.eclipse.equinox.internal.provisional.p2.repository.IStateful; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; public class ArtifactOutputStreamTest extends TestCase { diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java index 3ba5208d8..5f8206240 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java @@ -22,7 +22,7 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.*; +import org.eclipse.equinox.internal.provisional.p2.repository.*; import org.eclipse.equinox.p2.tests.*; import org.osgi.framework.BundleException; import org.osgi.service.prefs.BackingStoreException; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java index 4ce6b59fb..abd6d687a 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.artifact.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.io.*; import java.net.URI; import java.net.URISyntaxException; @@ -25,7 +27,6 @@ import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.Version; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; import org.eclipse.equinox.spi.p2.publisher.PublisherHelper; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java index c2f387965..8a6fe8c73 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java @@ -15,9 +15,9 @@ import org.eclipse.equinox.internal.p2.metadata.ArtifactKey; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.Version; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; -import org.eclipse.equinox.internal.provisional.spi.p2.core.repository.AbstractRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.spi.p2.repository.AbstractRepository; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; import org.w3c.dom.*; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java index a4c8de9f0..3b9c44874 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java @@ -11,6 +11,9 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.artifact.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.io.File; import java.net.URI; import java.net.URISyntaxException; @@ -21,8 +24,6 @@ import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifact import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.Version; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.SimpleArtifactRepositoryFactory; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferExceptionsTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferExceptionsTest.java new file mode 100644 index 000000000..dc20f5779 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferExceptionsTest.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2009 Cloudsmith Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cloudsmith Inc. - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.p2.tests.artifact.repository; + +import java.io.*; +import java.net.URI; +import java.net.URISyntaxException; +import org.eclipse.core.runtime.*; +import org.eclipse.equinox.internal.p2.repository.RepositoryTransport; +import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; +import org.osgi.framework.BundleException; + +/** + * Test supposed to be used interactivly to monitor the error message output. + * @author henrik.lindberg@cloudsmith.com + * + */ +public class TransferExceptionsTest extends AbstractProvisioningTest { + + public void testErrorMessages() { + FileOutputStream fos = null; + File f = null; + try { + f = File.createTempFile("TransferTest", "dummy.txt"); + fos = new FileOutputStream(f); + Platform.getBundle("org.eclipse.ecf.provider.filetransfer").start(); + } catch (IOException e) { + fail("1.0", e); + } catch (BundleException e) { + fail("1.5", e); + } + try { + IStatus s = RepositoryTransport.getInstance().download(new URI("bogus!bogus"), fos, new NullProgressMonitor()); + assertNotOK(s); + printStatus("1", s); + s = RepositoryTransport.getInstance().download(new URI("bogus://somewhere.else"), fos, new NullProgressMonitor()); + assertNotOK(s); + printStatus("2", s); + s = RepositoryTransport.getInstance().download(new URI("http:bogusURL"), fos, new NullProgressMonitor()); + assertNotOK(s); + printStatus("3", s); + s = RepositoryTransport.getInstance().download(new URI("http://bogusURL:80/"), fos, new NullProgressMonitor()); + assertNotOK(s); + printStatus("4", s); + s = RepositoryTransport.getInstance().download(new URI("http:/bogusURL:999999999999/"), fos, new NullProgressMonitor()); + assertNotOK(s); + printStatus("5", s); + s = RepositoryTransport.getInstance().download(new URI("http://bogus.nowhere"), fos, new NullProgressMonitor()); + assertNotOK(s); + printStatus("6", s); + s = RepositoryTransport.getInstance().download(new URI("http://www.eclipse.org/AFileThatDoesNotExist.foo"), fos, new NullProgressMonitor()); + assertNotOK(s); + printStatus("7", s); + } catch (URISyntaxException e) { + fail("URI syntax exception where none was expected: " + e.getMessage()); + } + } + + private static void printStatus(String msg, IStatus s) { + System.err.print("TEST OUTPUT: " + msg + "\n"); + System.err.print(" "); + System.err.print("Message [" + s.getMessage() + "] Exception Class[" + s.getException().getClass().getName() + "] ExceptionMessage[ "); + System.err.print(s.getException().getMessage() + "]\n"); + + } + +} diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java index 2530e26bc..0679b3956 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java @@ -13,7 +13,7 @@ package org.eclipse.equinox.p2.tests.artifact.repository; import java.io.*; import java.net.*; import org.eclipse.core.runtime.*; -import org.eclipse.equinox.internal.p2.artifact.repository.ECFTransport; +import org.eclipse.equinox.internal.p2.repository.RepositoryTransport; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; import org.osgi.framework.Bundle; import org.osgi.framework.BundleException; @@ -32,7 +32,7 @@ public class TransferTest extends AbstractProvisioningTest { } catch (BundleException e) { fail("1.5", e); } - IStatus s = ECFTransport.getInstance().download("http://download.eclipse.org/eclipse/updates/3.4/plugins/javax.servlet.jsp_2.0.0.v200806031607.jar.pack.gz", fos, new NullProgressMonitor()); + IStatus s = RepositoryTransport.getInstance().download("http://download.eclipse.org/eclipse/updates/3.4/plugins/javax.servlet.jsp_2.0.0.v200806031607.jar.pack.gz", fos, new NullProgressMonitor()); assertOK("2.0", s); int httpSize = -1; URL u; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/DirectorAppTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/DirectorAppTest.java index 67e274584..9f41c9f1f 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/DirectorAppTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/DirectorAppTest.java @@ -8,6 +8,8 @@ ******************************************************************************/ package org.eclipse.equinox.p2.tests.director; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.io.*; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -22,7 +24,6 @@ import org.eclipse.equinox.internal.p2.director.app.Activator; import org.eclipse.equinox.internal.p2.director.app.Application; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.query.*; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java index 749f74268..181db77e0 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.extensionlocation; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.io.File; import java.io.IOException; import java.net.*; @@ -18,7 +20,6 @@ import org.eclipse.equinox.internal.p2.extensionlocation.Constants; import org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationArtifactRepositoryFactory; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; import org.eclipse.equinox.p2.tests.TestActivator; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java index 9478939f1..fd4cc536e 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java @@ -10,13 +10,14 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.extensionlocation; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.io.File; import java.io.IOException; import java.net.*; import org.eclipse.equinox.internal.p2.extensionlocation.Constants; import org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationMetadataRepositoryFactory; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.query.Collector; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java index f2e6d3aa2..623d13d1a 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java @@ -12,6 +12,8 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.metadata.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.io.File; import java.net.URI; import java.net.URISyntaxException; @@ -22,7 +24,6 @@ import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepo import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.Version; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java index b9667ee3f..840c0860d 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java @@ -11,6 +11,8 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.metadata.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.io.File; import java.net.URI; import java.net.URISyntaxException; @@ -20,7 +22,6 @@ import junit.framework.TestCase; import org.eclipse.equinox.internal.p2.core.helpers.FileUtils; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.Version; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java index 1f6854ab6..1cf8263d4 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java @@ -11,6 +11,9 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.metadata.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; + import java.io.File; import java.net.URI; import java.util.*; @@ -18,8 +21,6 @@ import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.Version; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.ProvisioningListener; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.SynchronousProvisioningListener; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerExceptionsTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerExceptionsTest.java new file mode 100644 index 000000000..e4e6addbc --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerExceptionsTest.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * Copyright (c) 2007, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.p2.tests.metadata.repository; + +import java.io.File; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.*; +import junit.framework.Test; +import junit.framework.TestSuite; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; +import org.eclipse.equinox.internal.p2.updatesite.metadata.UpdateSiteMetadataRepositoryFactory; +import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; +import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; +import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.MetadataRepositoryFactory; +import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.SimpleMetadataRepositoryFactory; +import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; +import org.eclipse.equinox.p2.tests.TestActivator; + +/** + * Tests for API of {@link IMetadataRepositoryManager}. + */ +public class MetadataRepositoryManagerExceptionsTest extends AbstractProvisioningTest { + protected IMetadataRepositoryManager manager; + /** + * Contains temp File handles that should be deleted at the end of the test. + */ + private final List toDelete = new ArrayList(); + + public static Test suite() { + return new TestSuite(MetadataRepositoryManagerExceptionsTest.class); + } + + protected void setUp() throws Exception { + super.setUp(); + manager = (IMetadataRepositoryManager) ServiceHelper.getService(TestActivator.context, IMetadataRepositoryManager.class.getName()); + } + + protected void tearDown() throws Exception { + super.tearDown(); + for (Iterator it = toDelete.iterator(); it.hasNext();) + delete((File) it.next()); + toDelete.clear(); + } + + /** + * Adds a repository for a non existing site, should + * return REPOSITORY_NOT_FOUND, since any other status code gets logged. + * + * @throws URISyntaxException + */ + public void testFailedConnection() throws URISyntaxException { + // URI location = new URI("invalid://example"); + URI location = new URI("http://bogus.nowhere"); + MetadataRepositoryFactory factory; + + factory = new SimpleMetadataRepositoryFactory(); + try { + factory.load(location, 0, new NullProgressMonitor()); + } catch (ProvisionException e) { + assertEquals(ProvisionException.REPOSITORY_NOT_FOUND, e.getStatus().getCode()); + } + factory = new UpdateSiteMetadataRepositoryFactory(); + try { + factory.load(location, 0, new NullProgressMonitor()); + } catch (ProvisionException e) { + assertEquals(ProvisionException.REPOSITORY_NOT_FOUND, e.getStatus().getCode()); + } + } + +} diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java index 96a0c9e46..70c07fa8f 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java @@ -25,11 +25,11 @@ import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.ProvisioningListener; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.SynchronousProvisioningListener; import org.eclipse.equinox.internal.provisional.p2.core.location.AgentLocation; -import org.eclipse.equinox.internal.provisional.p2.core.repository.*; import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.query.Collector; +import org.eclipse.equinox.internal.provisional.p2.repository.*; import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.MetadataRepositoryFactory; import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.SimpleMetadataRepositoryFactory; import org.eclipse.equinox.p2.tests.*; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java index 55254d9a4..55fe9a876 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java @@ -9,6 +9,8 @@ ******************************************************************************/ package org.eclipse.equinox.p2.tests.metadata.repository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import org.eclipse.equinox.internal.p2.metadata.ProvidedCapability; import org.eclipse.equinox.internal.p2.metadata.RequiredCapability; @@ -23,7 +25,6 @@ import java.util.*; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.equinox.internal.p2.metadata.InstallableUnit; import org.eclipse.equinox.internal.provisional.p2.core.*; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.*; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitPatchDescription; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java index 391868290..f22064f7f 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.mirror; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.io.*; import java.net.*; import java.util.*; @@ -24,7 +26,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.Version; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; import org.eclipse.equinox.p2.tests.TestActivator; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java index defcc5f56..a9f4237df 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.mirror; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.io.File; import java.net.*; import java.util.HashMap; @@ -18,7 +20,6 @@ import org.eclipse.equinox.app.IApplicationContext; import org.eclipse.equinox.internal.p2.metadata.mirror.MirrorApplication; import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java index bd9676ca5..3603a32a2 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java @@ -21,6 +21,7 @@ import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; +import org.eclipse.equinox.internal.provisional.p2.repository.IStateful; import org.eclipse.equinox.p2.tests.TestActivator; import org.eclipse.osgi.util.NLS; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java index 369819403..d5079f7d0 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.touchpoint.eclipse; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import java.net.URISyntaxException; import java.util.HashMap; @@ -24,7 +26,6 @@ import org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.AddRepositoryA import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.Version; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest; import org.eclipse.equinox.internal.provisional.p2.engine.IProfile; import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningContext; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveRepositoryActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveRepositoryActionTest.java index e1f600d4a..c2436d876 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveRepositoryActionTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveRepositoryActionTest.java @@ -10,12 +10,13 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.touchpoint.eclipse; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.IStatus; import org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.RemoveRepositoryAction; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; /** diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java index 2546bbb41..7b69d8466 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java @@ -17,11 +17,11 @@ import java.util.Iterator; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.URIUtil; import org.eclipse.equinox.internal.p2.updatesite.SiteXMLAction; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.query.IUPropertyQuery; import org.eclipse.equinox.internal.provisional.p2.query.Collector; import org.eclipse.equinox.internal.provisional.p2.query.Query; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.RepositoryReference; import org.eclipse.equinox.p2.publisher.*; import org.eclipse.equinox.p2.publisher.eclipse.FeaturesAction; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java index 8f17ff5ef..25018bc29 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.updatesite; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.io.ByteArrayOutputStream; import java.io.File; import java.net.URI; @@ -24,7 +26,6 @@ import org.eclipse.equinox.internal.p2.updatesite.UpdateSite; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.*; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.*; import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; diff --git a/bundles/org.eclipse.equinox.p2.tools/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tools/META-INF/MANIFEST.MF index 2552f5a91..684bfaa77 100644 --- a/bundles/org.eclipse.equinox.p2.tools/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.tools/META-INF/MANIFEST.MF @@ -16,15 +16,16 @@ Import-Package: javax.servlet;version="2.4.0", org.eclipse.equinox.internal.p2.engine, org.eclipse.equinox.internal.p2.metadata, org.eclipse.equinox.internal.p2.metadata.repository, + org.eclipse.equinox.internal.p2.repository.helpers, org.eclipse.equinox.internal.p2.updatechecker, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, - org.eclipse.equinox.internal.provisional.p2.core.repository, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.internal.provisional.p2.metadata.query, org.eclipse.equinox.internal.provisional.p2.metadata.repository, org.eclipse.equinox.internal.provisional.p2.query, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.updatechecker, org.eclipse.osgi.service.resolver, org.osgi.framework;version="1.4.0", diff --git a/bundles/org.eclipse.equinox.p2.tools/src/org/eclipse/equinox/internal/p2/tools/mirror/RepositoryMirroring.java b/bundles/org.eclipse.equinox.p2.tools/src/org/eclipse/equinox/internal/p2/tools/mirror/RepositoryMirroring.java index 83610aa4c..5b9c457d3 100644 --- a/bundles/org.eclipse.equinox.p2.tools/src/org/eclipse/equinox/internal/p2/tools/mirror/RepositoryMirroring.java +++ b/bundles/org.eclipse.equinox.p2.tools/src/org/eclipse/equinox/internal/p2/tools/mirror/RepositoryMirroring.java @@ -11,6 +11,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.tools.mirror; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.io.IOException; import java.io.OutputStream; import java.net.URI; @@ -24,7 +26,6 @@ import org.eclipse.equinox.internal.p2.metadata.ArtifactKey; import org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF index 56956e961..d290e9ef5 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF @@ -15,7 +15,7 @@ Import-Package: javax.xml.parsers, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, org.eclipse.equinox.internal.provisional.p2.core.location, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.internal.provisional.p2.metadata.query, diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java index b3773e667..1dabbccb5 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java @@ -21,9 +21,9 @@ import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.location.AgentLocation; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.engine.IProfile; import org.eclipse.equinox.internal.provisional.p2.metadata.*; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.eclipse.osgi.service.datalocation.Location; import org.eclipse.osgi.service.environment.EnvironmentInfo; import org.eclipse.osgi.util.ManifestElement; diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java index 9dca39aad..d24a2b37a 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java @@ -10,10 +10,11 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; + import java.util.Map; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.engine.Profile; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; /** * An action that adds a repository to the list of known repositories. diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RemoveRepositoryAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RemoveRepositoryAction.java index d1116fe98..1a4b52257 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RemoveRepositoryAction.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RemoveRepositoryAction.java @@ -10,10 +10,11 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; + import java.util.Map; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.engine.Profile; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; /** * An action that adds a repository to the list of known repositories. diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RepositoryAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RepositoryAction.java index 1818e6088..2a7ee4754 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RepositoryAction.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RepositoryAction.java @@ -20,9 +20,9 @@ import org.eclipse.equinox.internal.p2.engine.Profile; import org.eclipse.equinox.internal.p2.touchpoint.eclipse.Activator; import org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; -import org.eclipse.equinox.internal.provisional.p2.core.repository.*; import org.eclipse.equinox.internal.provisional.p2.engine.*; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; +import org.eclipse.equinox.internal.provisional.p2.repository.*; import org.eclipse.osgi.util.NLS; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF index 3f2f37760..18aa02c47 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF @@ -11,7 +11,7 @@ Import-Package: org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.location, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.osgi.service.datalocation;version="1.0.0", diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java index ce42a53f7..59c3f06f5 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java @@ -1,5 +1,7 @@ package org.eclipse.equinox.internal.p2.touchpoint.natives; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import java.util.HashMap; import java.util.Map; @@ -10,7 +12,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.location.AgentLocation; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.engine.IProfile; import org.eclipse.osgi.util.NLS; diff --git a/bundles/org.eclipse.equinox.p2.ui.admin.rcp/ProvAdminUI.launch b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/ProvAdminUI.launch index 1adcd2298..e334798f2 100644 --- a/bundles/org.eclipse.equinox.p2.ui.admin.rcp/ProvAdminUI.launch +++ b/bundles/org.eclipse.equinox.p2.ui.admin.rcp/ProvAdminUI.launch @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<?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"/> @@ -18,289 +18,289 @@ <booleanAttribute key="restart" value="false"/> <stringAttribute key="selectedPlugin" value="org.eclipse.equinox.p2.core"/> <booleanAttribute key="show_selected_only" value="false"/> -<stringAttribute key="target_bundles" value="org.eclipse.core.net@default:default,org.eclipse.jface@default:default,org.eclipse.core.databinding@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.osgi@:,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.security@default:default,org.eclipse.swt.win32.win32.x86@default:false,org.eclipse.core.runtime@default:true,org.eclipse.core.jobs@default:default,org.eclipse.core.expressions@default:default,org.eclipse.equinox.common@default:default,org.eclipse.help@default:default,org.eclipse.osgi.services@default:default,org.eclipse.swt@default:default,org.eclipse.core.variables@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.commands@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.equinox.security.win32.x86@default:false,org.eclipse.equinox.registry@default:default,com.ibm.icu@default:default,org.eclipse.ui@default:default,org.eclipse.core.net.win32.x86@default:false,org.eclipse.ui.workbench@default:default"/> +<stringAttribute key="target_bundles" value="org.eclipse.ant.core@default:default,org.eclipse.help@default:default,org.eclipse.osgi.services@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net@default:default,com.ibm.icu@default:default,org.eclipse.ui.cocoa@default:false,org.eclipse.equinox.security@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.core.runtime@default:true,org.eclipse.swt.cocoa.macosx@default:false,org.eclipse.core.contenttype@default:default,org.eclipse.jface@default:default,org.eclipse.core.variables@default:default,org.eclipse.equinox.common@2:true,org.eclipse.osgi@:,org.eclipse.swt@default:default,org.eclipse.core.databinding@default:default,org.eclipse.equinox.security.macosx@default:false,org.eclipse.jface.databinding@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.ui@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.expressions@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.core.commands@default:default"/> <booleanAttribute key="tracing" value="true"/> <mapAttribute key="tracingOptions"> -<mapEntry key="org.eclipse.core.runtime/debug/context" value="false"/> -<mapEntry key="org.eclipse.core.jobs/jobs/beginend" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/completion" value="false"/> -<mapEntry key="org.eclipse.ui/trace/sources" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/indexmanager" value="false"/> -<mapEntry key="org.eclipse.ltk.core.refactoring/perf/participants/checkConditions" value="300"/> -<mapEntry key="org.eclipse.jface.text.source/debug/RevisionRulerColumn" value="false"/> -<mapEntry key="org.eclipse.ui/trace/contexts" value="false"/> -<mapEntry key="org.eclipse.debug.ui/debug/viewers/updateSequence" value="false"/> -<mapEntry key="org.eclipse.osgi/trace/filename" value="runtime.traces"/> -<mapEntry key="org.eclipse.jdt.core/debug" value="true"/> +<mapEntry key="org.eclipse.team.cvs.core/syncchangeevents" value="false"/> +<mapEntry key="org.eclipse.equinox.registry/debug" value="false"/> +<mapEntry key="org.eclipse.ecf/debug/methods/entering" value="false"/> +<mapEntry key="org.eclipse.core.resources/perf/listeners" value="500"/> <mapEntry key="org.eclipse.debug.ui/debug/contextlaunching" value="false"/> -<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug" value="false"/> -<mapEntry key="org.eclipse.team.cvs.core/dirtycaching" value="false"/> +<mapEntry key="org.eclipse.core.resources/build/needbuild" value="false"/> +<mapEntry key="org.eclipse.debug.ui/debug/viewers/viewer" value="false"/> +<mapEntry key="org.eclipse.update.configurator/debug" value="false"/> +<mapEntry key="org.eclipse.osgi/monitor/activation" value="false"/> +<mapEntry key="org.eclipse.jdt.ui/perf/content_assist/extensions" value="1000"/> +<mapEntry key="org.eclipse.ui.ide/debug/gc" value="false"/> +<mapEntry key="org.eclipse.core.resources/contenttype/cache" value="false"/> +<mapEntry key="org.eclipse.ecf.filetransfer/debug/exceptions/catching" value="false"/> +<mapEntry key="org.eclipse.core.jobs/jobs/shutdown" value="false"/> +<mapEntry key="org.eclipse.core.runtime/url/debug" value="false"/> +<mapEntry key="org.eclipse.debug.ui/debug/viewers/updateSequence" value="false"/> +<mapEntry key="org.eclipse.osgi/monitor/classes" value="false"/> +<mapEntry key="org.eclipse.equinox.preferences/get" value="false"/> +<mapEntry key="org.eclipse.jdt.apt.core/debug/generatedFileMaps" value="false"/> +<mapEntry key="org.eclipse.update.core/debug" value="true"/> +<mapEntry key="org.eclipse.core.runtime/debug/context" value="false"/> +<mapEntry key="org.eclipse.core.jobs/jobs/locks" value="false"/> +<mapEntry key="org.eclipse.ui/debug/swtdebug" value="false"/> +<mapEntry key="org.eclipse.equinox.p2.core/core/parseproblems" value="false"/> <mapEntry key="org.eclipse.jdt.core/debug/javamodel" value="false"/> +<mapEntry key="org.eclipse.osgi/resolver/uses" value="false"/> +<mapEntry key="org.eclipse.ui.intro.universal/trace/logInfo" value="true"/> +<mapEntry key="org.eclipse.ecf/debug" value="true"/> +<mapEntry key="org.eclipse.debug.core/debug/events" value="false"/> <mapEntry key="org.eclipse.ui.intro/trace/printHTML" value="false"/> -<mapEntry key="org.eclipse.ltk.core.refactoring/perf/participants/createChanges" value="300"/> -<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPerspectiveListener" value="false"/> -<mapEntry key="org.eclipse.osgi/resolver/debug" value="false"/> -<mapEntry key="org.eclipse.team.core/refreshjob" value="false"/> -<mapEntry key="org.eclipse.jface.text/debug/AbstractInformationControlManager" value="false"/> -<mapEntry key="org.eclipse.update.core/debug/installhandler" value="false"/> -<mapEntry key="org.eclipse.ui/debug" value="false"/> +<mapEntry key="org.eclipse.equinox.registry/debug/events" value="false"/> +<mapEntry key="org.eclipse.jdt.core/debug/javadelta/verbose" value="false"/> +<mapEntry key="org.eclipse.jdt.core/debug" value="true"/> +<mapEntry key="org.eclipse.pde.core/validation" value="false"/> +<mapEntry key="org.eclipse.core.expressions/tracePropertyResolving" value="false"/> +<mapEntry key="org.eclipse.core.resources/restore" value="false"/> +<mapEntry key="org.eclipse.ltk.core.refactoring/perf/participants/checkConditions" value="300"/> +<mapEntry key="org.eclipse.ui/perf/perspective.listeners" value="200"/> +<mapEntry key="org.eclipse.ecf/debug/filter" value="*"/> +<mapEntry key="org.eclipse.jdt.core/perf/containerinitializer" value="5000"/> +<mapEntry key="org.eclipse.osgi/trace/filename" value="runtime.traces"/> +<mapEntry key="org.eclipse.update.core/debug/web" value="false"/> +<mapEntry key="org.eclipse.osgi/debug" value="false"/> +<mapEntry key="org.eclipse.osgi/trace/activation" value="false"/> +<mapEntry key="org.eclipse.ui/perf/perspective.switch" value="800"/> +<mapEntry key="org.eclipse.ui/perf/part.input" value="200"/> +<mapEntry key="org.eclipse.ecf/debug/exceptions/catching" value="false"/> +<mapEntry key="org.eclipse.jface.text/debug/AnnotationPainter" value="false"/> +<mapEntry key="org.eclipse.ecf.filetransfer/debug/filter" value="*"/> +<mapEntry key="org.eclipse.osgi/resolver/imports" value="false"/> +<mapEntry key="org.eclipse.osgi/trace/filters" value="trace.properties"/> +<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/platformadmin/resolver" value="false"/> <mapEntry key="org.eclipse.help.ui/debug/infopop" value="false"/> -<mapEntry key="org.eclipse.pde.core/classpath" value="false"/> -<mapEntry key="org.eclipse.team.cvs.core/threading" value="false"/> <mapEntry key="org.eclipse.equinox.preferences/general" value="false"/> -<mapEntry key="org.eclipse.ui/trace/handlers.performance" value="false"/> -<mapEntry key="org.eclipse.ui/trace/operations.verbose" value="false"/> -<mapEntry key="org.eclipse.osgi/trace/activation" value="false"/> -<mapEntry key="org.eclipse.debug.core/debug/commands" value="false"/> -<mapEntry key="org.eclipse.team.core/threading" value="false"/> -<mapEntry key="org.eclipse.ui/perf/workbench.restore" value="30000"/> -<mapEntry key="org.eclipse.update.core/debug/parsing" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/postaction" value="false"/> -<mapEntry key="org.eclipse.jdt.apt.core/debug/generatedFileMaps" value="false"/> -<mapEntry key="org.eclipse.ui/trace/graphics" value="false"/> -<mapEntry key="org.eclipse.osgi/defaultprofile/logsynchronously" value="false"/> -<mapEntry key="org.eclipse.ecf.identity/debug/methods/exiting" value="false"/> -<mapEntry key="org.eclipse.ui/debug/workingSets" value="false"/> -<mapEntry key="org.eclipse.osgi/monitor/activation" value="false"/> -<mapEntry key="org.eclipse.ecf.identity/debug" value="true"/> -<mapEntry key="org.eclipse.debug.ui/debug" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/buffermanager" value="false"/> -<mapEntry key="org.eclipse.help.base/debug/search" value="false"/> -<mapEntry key="org.eclipse.pde.build/debug" value="false"/> -<mapEntry key="org.eclipse.jface.text/debug/ContentAssistSubjectAdapters" value="false"/> +<mapEntry key="org.eclipse.team.cvs.core/debug" value="false"/> +<mapEntry key="org.eclipse.team.cvs.core/threading" value="false"/> +<mapEntry key="org.eclipse.jdt.apt.pluggable.core/debug" value="false"/> <mapEntry key="org.eclipse.jdt.ui/perf/search/participants" value="300"/> -<mapEntry key="org.eclipse.ecf.filetransfer/debug/exceptions/throwing" value="false"/> -<mapEntry key="org.eclipse.ui/perf/perspective.create" value="800"/> -<mapEntry key="org.eclipse.update.core/debug/type" value="false"/> -<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/platformadmin" value="false"/> -<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPropertyChangeListener" value="false"/> -<mapEntry key="org.eclipse.osgi/resolver/generics" value="false"/> -<mapEntry key="org.eclipse.ecf.filetransfer/debug/methods/entering" value="false"/> -<mapEntry key="org.eclipse.osgi/resolver/requires" value="false"/> -<mapEntry key="org.eclipse.core.resources/refresh" value="false"/> -<mapEntry key="org.eclipse.jdt.core/perf/containerinitializer" value="5000"/> +<mapEntry key="org.eclipse.ui/perf/part.listeners" value="200"/> +<mapEntry key="org.eclipse.osgi/resolver/debug" value="false"/> +<mapEntry key="org.eclipse.update.core/debug/install" value="false"/> +<mapEntry key="org.eclipse.core.resources/debug" value="false"/> +<mapEntry key="org.eclipse.help.ui/debug/embeddedBrowser/inprocess" value="false"/> +<mapEntry key="org.eclipse.ui/perf/part.control" value="800"/> +<mapEntry key="org.eclipse.osgi/profile/impl" value="org.eclipse.osgi.internal.profile.DefaultProfileLogger"/> <mapEntry key="org.eclipse.osgi/profile/benchmark" value="false"/> -<mapEntry key="org.eclipse.help.webapp/debug" value="true"/> -<mapEntry key="org.eclipse.jdt.ui/debug/ASTProvider" value="false"/> -<mapEntry key="org.eclipse.osgi/debug" value="false"/> -<mapEntry key="org.eclipse.ecf.filetransfer/debug/exceptions/catching" value="false"/> -<mapEntry key="org.eclipse.ui/trace/handlers" value="false"/> -<mapEntry key="org.eclipse.ui/trace/contexts.performance" value="false"/> -<mapEntry key="org.eclipse.team.cvs.core/metafiles" value="false"/> -<mapEntry key="org.eclipse.jdt.core/perf/completion" value="300"/> -<mapEntry key="org.eclipse.osgi/profile/startup" value="false"/> -<mapEntry key="org.eclipse.core.jobs/jobs" value="false"/> -<mapEntry key="org.eclipse.core.resources/perf/save.participants" value="500"/> -<mapEntry key="org.eclipse.ecf/debug/exceptions/catching" value="false"/> -<mapEntry key="org.eclipse.help.base/debug" value="true"/> -<mapEntry key="org.eclipse.core.jobs/jobs/timing" value="false"/> -<mapEntry key="org.eclipse.jdt.core/perf/reconcile" value="1000"/> -<mapEntry key="org.eclipse.ecf.identity/debug/exceptions/throwing" value="false"/> -<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPageListener" value="false"/> -<mapEntry key="org.eclipse.core.resources/contenttype/cache" value="false"/> -<mapEntry key="org.eclipse.core.jobs/jobs/locks" value="false"/> -<mapEntry key="org.eclipse.update.core/debug/configuration" value="false"/> -<mapEntry key="org.eclipse.ecf/debug" value="true"/> -<mapEntry key="org.eclipse.core.runtime/url/debug/connect" value="false"/> -<mapEntry key="org.eclipse.ui/trace/handlers.verbose.commandId" value=""/> -<mapEntry key="org.eclipse.ui.ide/debug" value="false"/> -<mapEntry key="org.eclipse.osgi/profile/debug" value="false"/> -<mapEntry key="org.eclipse.pde.core/debug" value="true"/> -<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPartReference" value="false"/> -<mapEntry key="org.eclipse.ui/debug/job.stale" value="false"/> -<mapEntry key="org.eclipse.jdt.ui/perf/explorer/createPartControl" value="1300"/> -<mapEntry key="org.eclipse.jdt.core/debug/hierarchy" value="false"/> -<mapEntry key="org.eclipse.jdt.core/perf/variableinitializer" value="5000"/> -<mapEntry key="org.eclipse.ui.ide/debug/internalerror/openDialog" value="false"/> -<mapEntry key="org.eclipse.core.resources/strings" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/sourcemapper" value="false"/> -<mapEntry key="org.eclipse.core.resources/save/mastertable" value="false"/> -<mapEntry key="org.eclipse.core.expressions/tracePropertyResolving" value="false"/> -<mapEntry key="org.eclipse.ui/perf/showHeapStatus" value="true"/> +<mapEntry key="org.eclipse.jdt.core/debug/cpresolution/advanced" value="false"/> +<mapEntry key="org.eclipse.team.cvs.core/cvsprotocol" value="true"/> +<mapEntry key="org.eclipse.jdt.core/debug/postaction" value="false"/> +<mapEntry key="org.eclipse.ecf/debug/exceptions/throwing" value="false"/> +<mapEntry key="org.eclipse.osgi/debug/manifest" value="false"/> +<mapEntry key="org.eclipse.jdt.core/perf/selection" value="300"/> +<mapEntry key="org.eclipse.help/debug/context" value="false"/> +<mapEntry key="org.eclipse.jdt.ui/perf/content_assist_sorters/extensions" value=""/> +<mapEntry key="org.eclipse.jdt.core/debug/builder" value="false"/> +<mapEntry key="org.eclipse.osgi/resolver/requires" value="false"/> +<mapEntry key="org.eclipse.team.cvs.ssh/debug" value="false"/> +<mapEntry key="org.eclipse.ui/trace/handlers.verbose" value="false"/> +<mapEntry key="org.eclipse.osgi/debug/startlevel" value="false"/> +<mapEntry key="org.eclipse.update.core/debug/installhandler" value="false"/> <mapEntry key="org.eclipse.jdt.core/debug/javadelta" value="false"/> +<mapEntry key="org.eclipse.core.resources/restore/tree" value="false"/> <mapEntry key="org.eclipse.core.resources/preferences" value="false"/> -<mapEntry key="org.eclipse.ecf/debug/flag" value="true"/> -<mapEntry key="org.eclipse.jdt.core/debug/selection" value="false"/> -<mapEntry key="org.eclipse.jdt.apt.core/debug" value="false"/> -<mapEntry key="org.eclipse.ecf.filetransfer/debug/flag" value="true"/> -<mapEntry key="org.eclipse.jdt.ui/perf/content_assist_sorters/extensions" value=""/> -<mapEntry key="org.eclipse.jdt.core/debug/javamodel/cache" value="false"/> -<mapEntry key="org.eclipse.ecf/debug/filter" value="*"/> -<mapEntry key="org.eclipse.osgi/defaultprofile/logfilename" value=""/> -<mapEntry key="org.eclipse.team.core/backgroundevents" value="false"/> -<mapEntry key="org.eclipse.ui/trace/keyBindings" value="false"/> -<mapEntry key="org.eclipse.equinox.p2.core/artifacts/mirrors" value="true"/> -<mapEntry key="org.eclipse.ui/perf/part.activate" value="200"/> -<mapEntry key="org.eclipse.ecf.filetransfer/debug/methods/exiting" value="false"/> -<mapEntry key="org.eclipse.update.core/debug" value="true"/> -<mapEntry key="org.eclipse.osgi/debug/security" value="false"/> -<mapEntry key="org.eclipse.core.resources/build/needbuild" value="false"/> -<mapEntry key="org.eclipse.core.resources/restore/metainfo" value="false"/> -<mapEntry key="org.eclipse.ui/debug/swtdebugglobal" value="false"/> -<mapEntry key="org.eclipse.core.resources/perf/builders" value="10000"/> -<mapEntry key="org.eclipse.ui/perf/perspective.listeners" value="200"/> +<mapEntry key="org.eclipse.ui.intro/flags/noBrowser" value="false"/> +<mapEntry key="org.eclipse.core.resources/perf/save.participants" value="500"/> +<mapEntry key="org.eclipse.core.resources/natures" value="false"/> +<mapEntry key="org.eclipse.help.base/debug/search" value="false"/> +<mapEntry key="org.eclipse.equinox.p2.core/metadata/parsing" value="true"/> +<mapEntry key="org.eclipse.osgi/defaultprofile/buffersize" value="256"/> +<mapEntry key="org.eclipse.osgi/resolver/cycles" value="false"/> +<mapEntry key="org.eclipse.jdt.core/perf/variableinitializer" value="5000"/> +<mapEntry key="org.eclipse.ui/trace/keyBindings.verbose" value="false"/> +<mapEntry key="org.eclipse.debug.ui/debug/viewers/model" value="false"/> +<mapEntry key="org.eclipse.core.runtime/perf/success" value="false"/> +<mapEntry key="org.eclipse.ui/trace/contexts.performance" value="false"/> +<mapEntry key="org.eclipse.core.runtime/compatibility/debug" value="false"/> +<mapEntry key="org.eclipse.ui/debug/declaredImages" value="false"/> +<mapEntry key="org.eclipse.pde.build/debug" value="false"/> +<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/location" value="false"/> +<mapEntry key="org.eclipse.ui/trace/contexts.verbose" value="false"/> +<mapEntry key="org.eclipse.help.base/debug" value="true"/> <mapEntry key="org.eclipse.ui/debug/showAllJobs" value="false"/> -<mapEntry key="org.eclipse.core.resources/history" value="false"/> <mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPartListener" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/search" value="false"/> -<mapEntry key="org.eclipse.pde.core/validation" value="false"/> -<mapEntry key="org.eclipse.team.cvs.core/cvsprotocol" value="true"/> -<mapEntry key="org.eclipse.jface.text/debug/AnnotationPainter" value="false"/> -<mapEntry key="org.eclipse.core.resources/restore/mastertable" value="false"/> +<mapEntry key="org.eclipse.equinox.p2.core/artifacts/mirrors" value="true"/> +<mapEntry key="org.eclipse.core.jobs/jobs" value="false"/> +<mapEntry key="org.eclipse.ui/perf/perspective.create" value="800"/> +<mapEntry key="org.eclipse.ui/trace/sources" value="false"/> +<mapEntry key="org.eclipse.debug.core/debug/commands" value="false"/> +<mapEntry key="org.eclipse.core.resources/strings" value="false"/> +<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPartReference" value="false"/> +<mapEntry key="org.eclipse.ui.ide/debug/undomonitor" value="false"/> +<mapEntry key="org.eclipse.core.resources/save/metainfo" value="false"/> +<mapEntry key="org.eclipse.ui/perf/part.activate" value="200"/> +<mapEntry key="org.eclipse.ui.intro.universal/debug" value="true"/> +<mapEntry key="org.eclipse.core.runtime/perf" value="false"/> +<mapEntry key="org.eclipse.core.resources/contenttype" value="false"/> +<mapEntry key="org.eclipse.ui/debug/contributions" value="false"/> +<mapEntry key="org.eclipse.ui/debug/job.stale" value="false"/> +<mapEntry key="org.eclipse.ui/perf/workbench.start" value="45000"/> +<mapEntry key="org.eclipse.jdt.core/debug/completion" value="false"/> +<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug" value="false"/> +<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPartListener" value="false"/> +<mapEntry key="org.eclipse.jdt.core/debug/indexmanager" value="false"/> +<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPerspectiveListener" value="false"/> +<mapEntry key="org.eclipse.osgi/debug/loader" value="false"/> +<mapEntry key="org.eclipse.ui.workbench/debug" value="false"/> +<mapEntry key="org.eclipse.debug.ui/debug/launchhistory" value="false"/> +<mapEntry key="org.eclipse.osgi/defaultprofile/logsynchronously" value="false"/> +<mapEntry key="org.eclipse.osgi/trace/classLoading" value="false"/> +<mapEntry key="org.eclipse.jface.text/debug/FastPartitioner/PositionCache" value="false"/> +<mapEntry key="org.eclipse.debug.ui/debug" value="false"/> +<mapEntry key="org.eclipse.ui/trace/handlers.performance" value="false"/> <mapEntry key="org.eclipse.core.runtime/debug" value="false"/> -<mapEntry key="org.eclipse.equinox.preferences/set" value="false"/> -<mapEntry key="org.eclipse.core.resources/restore/snapshots" value="false"/> -<mapEntry key="org.eclipse.ecf.filetransfer/debug" value="true"/> -<mapEntry key="org.eclipse.ui/perf/perspective.switch" value="800"/> +<mapEntry key="org.eclipse.ecf.filetransfer/debug/methods/entering" value="false"/> +<mapEntry key="org.eclipse.ui/trace/handlers.verbose.commandId" value=""/> +<mapEntry key="org.eclipse.osgi/debug/filter" value="false"/> +<mapEntry key="org.eclipse.jdt.apt.core/debug/compilationEnv" value="false"/> +<mapEntry key="org.eclipse.jdt.ui/debug/ASTProvider" value="false"/> <mapEntry key="org.eclipse.help.webapp/debug/workingsets" value="false"/> -<mapEntry key="org.eclipse.osgi/debug/bundleTime" value="false"/> -<mapEntry key="org.eclipse.osgi/resolver/uses" value="false"/> +<mapEntry key="org.eclipse.osgi/defaultprofile/logfilename" value=""/> +<mapEntry key="org.eclipse.core.runtime/url/debug/connect" value="false"/> +<mapEntry key="org.eclipse.jface.text/debug/ContentAssistSubjectAdapters" value="false"/> <mapEntry key="org.eclipse.core.resources/restore/markers" value="false"/> -<mapEntry key="org.eclipse.ui/perf/workbench.start" value="45000"/> -<mapEntry key="org.eclipse.core.runtime/url/debug/cachecopy" value="false"/> -<mapEntry key="org.eclipse.core.runtime/perf/success" value="false"/> -<mapEntry key="org.eclipse.ecf/debug/methods/entering" value="false"/> -<mapEntry key="org.eclipse.ecf/debug/methods/exiting" value="false"/> -<mapEntry key="org.eclipse.jdt.core/perf/selection" value="300"/> -<mapEntry key="org.eclipse.osgi/debug/startlevel" value="false"/> -<mapEntry key="org.eclipse.core.resources/restore" value="false"/> -<mapEntry key="org.eclipse.osgi/resolver/wiring" value="false"/> +<mapEntry key="org.eclipse.ecf.filetransfer/debug" value="true"/> +<mapEntry key="org.eclipse.ui/trace/graphics" value="false"/> +<mapEntry key="org.eclipse.jdt.core/debug/resolution" value="false"/> +<mapEntry key="org.eclipse.team.cvs.ssh/ssh_protocol" value="false"/> <mapEntry key="org.eclipse.core.resources/perf/snapshot" value="1000"/> +<mapEntry key="org.eclipse.help/debug/search" value="false"/> +<mapEntry key="org.eclipse.core.resources/build/needbuildstack" value="false"/> +<mapEntry key="org.eclipse.ui/perf/part.init" value="800"/> +<mapEntry key="org.eclipse.ecf.identity/debug/exceptions/throwing" value="false"/> <mapEntry key="org.eclipse.ui.intro/trace/logPerformance" value="false"/> -<mapEntry key="org.eclipse.osgi/debug/loader" value="false"/> -<mapEntry key="org.eclipse.ui/trace/contexts.verbose" value="false"/> -<mapEntry key="org.eclipse.jdt.ui/perf/explorer/makeActions" value="1000"/> -<mapEntry key="org.eclipse.core.resources/save/markers" value="false"/> -<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/platformadmin/resolver" value="false"/> -<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPartListener2" value="false"/> -<mapEntry key="org.eclipse.ui/trace/operations" value="false"/> -<mapEntry key="org.eclipse.ui.ide/debug/markers" value="false"/> -<mapEntry key="org.eclipse.update.core/debug/install" value="false"/> -<mapEntry key="org.eclipse.equinox.registry/debug/events" value="false"/> -<mapEntry key="org.eclipse.equinox.p2.garbagecollector/debug" value="false"/> -<mapEntry key="org.eclipse.core.resources/save/metainfo" value="false"/> -<mapEntry key="org.eclipse.equinox.p2.core/generator/parsing" value="false"/> +<mapEntry key="org.eclipse.osgi/eclipseadaptor/converter/debug" value="false"/> +<mapEntry key="org.eclipse.ui/perf/part.create" value="800"/> +<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/platformadmin" value="false"/> +<mapEntry key="org.eclipse.help.ui/debug/embeddedBrowser" value="false"/> +<mapEntry key="org.eclipse.equinox.preferences/set" value="false"/> +<mapEntry key="org.eclipse.team.core/streams" value="false"/> +<mapEntry key="org.eclipse.core.resources/build/stacktrace" value="false"/> +<mapEntry key="org.eclipse.ui/trace/keyBindings" value="false"/> +<mapEntry key="org.eclipse.jdt.ui/debug/TypeConstraints" value="false"/> +<mapEntry key="org.eclipse.core.jobs/jobs/beginend" value="false"/> +<mapEntry key="org.eclipse.core.resources/build/interrupt" value="false"/> +<mapEntry key="org.eclipse.ui/perf/showHeapStatus" value="true"/> <mapEntry key="org.eclipse.ui/perf/contentTypes" value="200"/> -<mapEntry key="org.eclipse.help.ui/debug/embeddedBrowser/inprocess" value="false"/> -<mapEntry key="org.eclipse.jdt.core/perf/javadeltalistener" value="500"/> -<mapEntry key="org.eclipse.core.resources/perf/listeners" value="500"/> -<mapEntry key="org.eclipse.ui.intro/flags/noBrowser" value="false"/> -<mapEntry key="org.eclipse.ui/perf/part.init" value="800"/> -<mapEntry key="org.eclipse.core.contenttype/debug" value="false"/> -<mapEntry key="org.eclipse.osgi/resolver/imports" value="false"/> -<mapEntry key="org.eclipse.core.resources/restore/tree" value="false"/> -<mapEntry key="org.eclipse.ui.intro.universal/trace/logPerformance" value="false"/> -<mapEntry key="org.eclipse.help/debug/context" value="false"/> -<mapEntry key="org.eclipse.osgi/debug/manifest" value="false"/> -<mapEntry key="org.eclipse.ui/trace/multipageeditor" value="false"/> -<mapEntry key="org.eclipse.jdt.apt.core/debug/generatedFiles" value="false"/> -<mapEntry key="org.eclipse.core.resources/build/needbuildstack" value="false"/> -<mapEntry key="org.eclipse.ui/debug/swtdebug" value="false"/> -<mapEntry key="org.eclipse.core.resources/save/syncinfo" value="false"/> -<mapEntry key="org.eclipse.team.cvs.ssh/debug" value="false"/> -<mapEntry key="org.eclipse.core.resources/build/failure" value="false"/> -<mapEntry key="org.eclipse.team.core/debug" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/builder" value="false"/> -<mapEntry key="org.eclipse.osgi/trace/classLoading" value="false"/> -<mapEntry key="org.eclipse.core.resources/save" value="false"/> -<mapEntry key="org.eclipse.core.jobs/jobs/errorondeadlock" value="false"/> -<mapEntry key="org.eclipse.core.resources/contenttype" value="false"/> -<mapEntry key="org.eclipse.jface.text/debug/FastPartitioner/PositionCache" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/compiler" value="false"/> -<mapEntry key="org.eclipse.osgi/debug/events" value="false"/> <mapEntry key="org.eclipse.ui/trace/commands" value="false"/> -<mapEntry key="org.eclipse.equinox.preferences/get" value="false"/> -<mapEntry key="org.eclipse.jdt.ui/debug/ResultCollector" value="false"/> -<mapEntry key="org.eclipse.debug.ui/debug/launchhistory" value="false"/> -<mapEntry key="org.eclipse.equinox.p2.core/engine/installregistry" value="true"/> -<mapEntry key="org.eclipse.debug.ui/debug/viewers/model" value="false"/> -<mapEntry key="org.eclipse.equinox.registry/debug" value="false"/> -<mapEntry key="org.eclipse.ui.intro/debug" value="true"/> -<mapEntry key="org.eclipse.ecf.identity/debug/exceptions/catching" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/cpresolution/advanced" value="false"/> -<mapEntry key="org.eclipse.osgi/eclipseadaptor/converter/debug" value="false"/> -<mapEntry key="org.eclipse.pde.core/cache" value="false"/> -<mapEntry key="org.eclipse.equinox.p2.core/debug" value="true"/> -<mapEntry key="org.eclipse.debug.core/debug/events" value="false"/> +<mapEntry key="org.eclipse.core.resources/build/delta" value="false"/> +<mapEntry key="org.eclipse.jdt.core/debug/search" value="false"/> +<mapEntry key="org.eclipse.jdt.apt.core/debug" value="false"/> +<mapEntry key="org.eclipse.jdt.core/perf/completion" value="300"/> +<mapEntry key="org.eclipse.jdt.core/debug/compiler" value="false"/> +<mapEntry key="org.eclipse.equinox.p2.garbagecollector/debug" value="false"/> <mapEntry key="org.eclipse.jdt.ui/debug" value="true"/> -<mapEntry key="org.eclipse.osgi/monitor/classes" value="false"/> -<mapEntry key="org.eclipse.ui/perf/part.input" value="200"/> -<mapEntry key="org.eclipse.ui.intro.universal/debug" value="true"/> -<mapEntry key="org.eclipse.jdt.ui/debug/TypeConstraints" value="false"/> +<mapEntry key="org.eclipse.jdt.core/debug/javamodel/cache" value="false"/> +<mapEntry key="org.eclipse.update.core/debug/configuration" value="false"/> <mapEntry key="org.eclipse.osgi/debug/messageBundles" value="false"/> -<mapEntry key="org.eclipse.core.resources/build/invoking" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/javadelta/verbose" value="false"/> -<mapEntry key="org.eclipse.core.resources/save/tree" value="false"/> -<mapEntry key="org.eclipse.ui/debug/contributions" value="false"/> -<mapEntry key="org.eclipse.update.core/debug/warning" value="false"/> -<mapEntry key="org.eclipse.core.resources/natures" value="false"/> -<mapEntry key="org.eclipse.equinox.p2.core/metadata/parsing" value="true"/> <mapEntry key="org.eclipse.jdt.core.manipulation/debug" value="true"/> +<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPartListener2" value="false"/> +<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPartListener2" value="false"/> +<mapEntry key="org.eclipse.jdt.core/perf/reconcile" value="1000"/> +<mapEntry key="org.eclipse.jdt.core/debug/hierarchy" value="false"/> +<mapEntry key="org.eclipse.help.webapp/debug" value="true"/> +<mapEntry key="org.eclipse.ui/debug/workingSets" value="false"/> +<mapEntry key="org.eclipse.core.resources/refresh" value="false"/> +<mapEntry key="org.eclipse.team.core/backgroundevents" value="false"/> +<mapEntry key="org.eclipse.ltk.core.refactoring/perf/participants/createChanges" value="300"/> <mapEntry key="org.eclipse.jdt.core/debug/cpresolution" value="false"/> -<mapEntry key="org.eclipse.help/debug/search" value="false"/> -<mapEntry key="org.eclipse.help.ui/debug/embeddedBrowser" value="false"/> -<mapEntry key="org.eclipse.team.cvs.ssh/ssh_protocol" value="false"/> -<mapEntry key="org.eclipse.core.resources/build/stacktrace" value="false"/> -<mapEntry key="org.eclipse.ui/perf/part.create" value="800"/> -<mapEntry key="org.eclipse.ui.intro/trace/logInfo" value="true"/> -<mapEntry key="org.eclipse.team.core/streams" value="false"/> -<mapEntry key="org.eclipse.ui.ide/debug/undomonitor" value="false"/> -<mapEntry key="org.eclipse.jdt.ui/perf/explorer/RefactorActionGroup" value="150"/> -<mapEntry key="org.eclipse.ui/experimental/menus" value="false"/> -<mapEntry key="org.eclipse.core.jobs/jobs/shutdown" value="false"/> -<mapEntry key="org.eclipse.osgi/debug/packageadmin" value="false"/> -<mapEntry key="org.eclipse.ecf/debug/exceptions/throwing" value="false"/> -<mapEntry key="org.eclipse.jdt.apt.core/debug/compilationEnv" value="false"/> -<mapEntry key="org.eclipse.core.runtime/compatibility/debug" value="false"/> -<mapEntry key="org.eclipse.ui/debug/declaredImages" value="false"/> -<mapEntry key="org.eclipse.update.core/debug/reconciler" value="false"/> -<mapEntry key="org.eclipse.ecf.identity/debug/methods/entering" value="false"/> -<mapEntry key="org.eclipse.ui.ide/debug/gc" value="false"/> +<mapEntry key="org.eclipse.ecf/debug/flag" value="true"/> +<mapEntry key="org.eclipse.update.core/debug/warning" value="false"/> +<mapEntry key="org.eclipse.ecf.filetransfer/debug/exceptions/throwing" value="false"/> +<mapEntry key="org.eclipse.core.resources/save" value="false"/> +<mapEntry key="org.eclipse.update.core/debug/parsing" value="false"/> +<mapEntry key="org.eclipse.jdt.ui/perf/explorer/makeActions" value="1000"/> +<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/> <mapEntry key="org.eclipse.debug.ui/debug/viewers/contentProvider" value="false"/> +<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPageListener" value="false"/> +<mapEntry key="org.eclipse.team.core/threading" value="false"/> +<mapEntry key="org.eclipse.core.runtime/url/debug/cachelookup" value="false"/> +<mapEntry key="org.eclipse.equinox.p2.core/engine/installregistry" value="true"/> +<mapEntry key="org.eclipse.update.core/debug/reconciler" value="false"/> +<mapEntry key="org.eclipse.osgi/debug/security" value="false"/> +<mapEntry key="org.eclipse.core.resources/save/syncinfo" value="false"/> +<mapEntry key="org.eclipse.osgi/profile/startup" value="false"/> <mapEntry key="org.eclipse.osgi/debug/services" value="false"/> -<mapEntry key="org.eclipse.ui.workbench/debug" value="false"/> -<mapEntry key="org.eclipse.jdt.ui/perf/content_assist/extensions" value="1000"/> -<mapEntry key="org.eclipse.osgi/debug/filter" value="false"/> -<mapEntry key="org.eclipse.debug.core/debug" value="false"/> -<mapEntry key="org.eclipse.core.resources/debug" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/zipaccess" value="false"/> -<mapEntry key="org.eclipse.ui.browser/debug" value="false"/> -<mapEntry key="org.eclipse.osgi/profile/impl" value="org.eclipse.osgi.internal.profile.DefaultProfileLogger"/> -<mapEntry key="org.eclipse.update.core/debug/web" value="false"/> -<mapEntry key="org.eclipse.team.cvs.core/debug" value="false"/> -<mapEntry key="org.eclipse.help/debug" value="true"/> -<mapEntry key="org.eclipse.core.runtime/perf" value="false"/> -<mapEntry key="org.eclipse.osgi/trace/filters" value="trace.properties"/> -<mapEntry key="org.eclipse.ui/perf/part.listeners" value="200"/> -<mapEntry key="org.eclipse.debug.ui/debug/viewers/viewer" value="false"/> -<mapEntry key="org.eclipse.ui/trace/keyBindings.verbose" value="false"/> -<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/> -<mapEntry key="org.eclipse.osgi/defaultprofile/buffersize" value="256"/> -<mapEntry key="org.eclipse.ui/perf/page.listeners" value="200"/> -<mapEntry key="org.eclipse.team.cvs.core/syncchangeevents" value="false"/> -<mapEntry key="org.eclipse.jdt.apt.pluggable.core/debug" value="false"/> -<mapEntry key="org.eclipse.ui/trace/handlers.verbose" value="false"/> -<mapEntry key="org.eclipse.ecf.filetransfer/debug/filter" value="*"/> +<mapEntry key="org.eclipse.equinox.p2.core/generator/parsing" value="false"/> +<mapEntry key="org.eclipse.core.resources/save/markers" value="false"/> +<mapEntry key="org.eclipse.core.runtime/preferences/plugin" value="false"/> <mapEntry key="org.eclipse.osgi/monitor/resources" value="false"/> -<mapEntry key="org.eclipse.ui/perf/part.control" value="800"/> +<mapEntry key="org.eclipse.core.jobs/jobs/timing" value="false"/> +<mapEntry key="org.eclipse.jdt.core/debug/selection" value="false"/> +<mapEntry key="org.eclipse.ecf.identity/debug/methods/exiting" value="false"/> +<mapEntry key="org.eclipse.jdt.ui/debug/ResultCollector" value="false"/> +<mapEntry key="org.eclipse.core.resources/restore/snapshots" value="false"/> +<mapEntry key="org.eclipse.jdt.ui/perf/explorer/createPartControl" value="1300"/> +<mapEntry key="org.eclipse.team.cvs.core/dirtycaching" value="false"/> +<mapEntry key="org.eclipse.jdt.apt.core/debug/generatedFiles" value="false"/> +<mapEntry key="org.eclipse.jdt.core/debug/zipaccess" value="false"/> +<mapEntry key="org.eclipse.pde.core/cache" value="false"/> +<mapEntry key="org.eclipse.core.runtime/url/debug/cachecopy" value="false"/> +<mapEntry key="org.eclipse.osgi/debug/bundleTime" value="false"/> +<mapEntry key="org.eclipse.ui/trace/operations.verbose" value="false"/> +<mapEntry key="org.eclipse.team.cvs.core/metafiles" value="false"/> +<mapEntry key="org.eclipse.team.core/debug" value="false"/> +<mapEntry key="org.eclipse.ui/perf/workbench.restore" value="30000"/> +<mapEntry key="org.eclipse.osgi/debug/events" value="false"/> +<mapEntry key="org.eclipse.core.jobs/jobs/errorondeadlock" value="false"/> +<mapEntry key="org.eclipse.ecf.filetransfer/debug/flag" value="true"/> +<mapEntry key="org.eclipse.ui/debug/swtdebugglobal" value="false"/> +<mapEntry key="org.eclipse.ui.ide/debug/internalerror/openDialog" value="false"/> +<mapEntry key="org.eclipse.equinox.p2.core/debug" value="true"/> +<mapEntry key="org.eclipse.ui.intro.universal/trace/logPerformance" value="false"/> +<mapEntry key="org.eclipse.ui.ide/debug/markers" value="false"/> <mapEntry key="org.eclipse.ui/perf/uijob" value="200"/> -<mapEntry key="org.eclipse.core.runtime/url/debug/cachelookup" value="false"/> -<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPartListener2" value="false"/> -<mapEntry key="org.eclipse.core.resources/build/delta" value="false"/> -<mapEntry key="org.eclipse.equinox.p2.core/core/parseproblems" value="false"/> -<mapEntry key="org.eclipse.core.resources/build/interrupt" value="false"/> -<mapEntry key="org.eclipse.core.runtime/preferences/plugin" value="false"/> -<mapEntry key="org.eclipse.core.runtime/url/debug" value="false"/> -<mapEntry key="org.eclipse.osgi/resolver/cycles" value="false"/> -<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPartListener" value="false"/> -<mapEntry key="org.eclipse.jdt.core/debug/resolution" value="false"/> -<mapEntry key="org.eclipse.update.configurator/debug" value="false"/> +<mapEntry key="org.eclipse.jdt.core/debug/sourcemapper" value="false"/> +<mapEntry key="org.eclipse.ecf.identity/debug/methods/entering" value="false"/> +<mapEntry key="org.eclipse.ecf.identity/debug/exceptions/catching" value="false"/> +<mapEntry key="org.eclipse.ecf.identity/debug" value="true"/> <mapEntry key="org.eclipse.debug.ui/debug/viewers/deltas" value="false"/> +<mapEntry key="org.eclipse.osgi/resolver/generics" value="false"/> +<mapEntry key="org.eclipse.osgi/resolver/wiring" value="false"/> +<mapEntry key="org.eclipse.jdt.core/perf/javadeltalistener" value="500"/> +<mapEntry key="org.eclipse.osgi/profile/debug" value="false"/> +<mapEntry key="org.eclipse.ui/trace/contexts" value="false"/> +<mapEntry key="org.eclipse.core.contenttype/debug" value="false"/> +<mapEntry key="org.eclipse.ui/trace/multipageeditor" value="false"/> +<mapEntry key="org.eclipse.core.resources/build/invoking" value="false"/> +<mapEntry key="org.eclipse.ui/trace/operations" value="false"/> +<mapEntry key="org.eclipse.core.resources/perf/builders" value="10000"/> +<mapEntry key="org.eclipse.update.core/debug/type" value="false"/> +<mapEntry key="org.eclipse.ui/perf/page.listeners" value="200"/> +<mapEntry key="org.eclipse.jdt.ui/perf/explorer/RefactorActionGroup" value="150"/> +<mapEntry key="org.eclipse.core.resources/history" value="false"/> +<mapEntry key="org.eclipse.team.core/refreshjob" value="false"/> +<mapEntry key="org.eclipse.ui.intro/debug" value="true"/> +<mapEntry key="org.eclipse.jface.text/debug/AbstractInformationControlManager" value="false"/> +<mapEntry key="org.eclipse.debug.core/debug" value="false"/> +<mapEntry key="org.eclipse.help/debug" value="true"/> +<mapEntry key="org.eclipse.jface.text.source/debug/RevisionRulerColumn" value="false"/> +<mapEntry key="org.eclipse.ui/debug" value="false"/> +<mapEntry key="org.eclipse.osgi/debug/packageadmin" value="false"/> +<mapEntry key="org.eclipse.core.resources/build/failure" value="false"/> +<mapEntry key="org.eclipse.ui/trace/handlers" value="false"/> +<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPropertyChangeListener" value="false"/> +<mapEntry key="org.eclipse.ecf.filetransfer/debug/methods/exiting" value="false"/> +<mapEntry key="org.eclipse.ui.browser/debug" value="false"/> +<mapEntry key="org.eclipse.core.resources/save/tree" value="false"/> <mapEntry key="org.eclipse.help.ui/debug" value="true"/> -<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/location" value="false"/> -<mapEntry key="org.eclipse.ui.intro.universal/trace/logInfo" value="true"/> +<mapEntry key="org.eclipse.core.resources/restore/metainfo" value="false"/> +<mapEntry key="org.eclipse.core.resources/save/mastertable" value="false"/> +<mapEntry key="org.eclipse.pde.core/debug" value="true"/> +<mapEntry key="org.eclipse.jdt.core/debug/buffermanager" value="false"/> +<mapEntry key="org.eclipse.ui.ide/debug" value="false"/> +<mapEntry key="org.eclipse.ecf/debug/methods/exiting" value="false"/> +<mapEntry key="org.eclipse.ui.intro/trace/logInfo" value="true"/> +<mapEntry key="org.eclipse.core.resources/restore/mastertable" value="false"/> +<mapEntry key="org.eclipse.ui/experimental/menus" value="false"/> +<mapEntry key="org.eclipse.pde.core/classpath" value="false"/> </mapAttribute> <booleanAttribute key="useDefaultConfigArea" value="true"/> <booleanAttribute key="useNamedJRE" value="false"/> -<stringAttribute key="workspace_bundles" value="org.eclipse.equinox.p2.engine@default:default,org.eclipse.ecf@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.sat4j.core@default:default,org.eclipse.equinox.frameworkadmin@2:true,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.ui.admin.rcp@default:default,org.eclipse.equinox.frameworkadmin.equinox@2:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.p2.exemplarysetup@default:default,org.eclipse.equinox.p2.metadata.generator@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.equinox.p2.updatechecker@default:default,org.sat4j.pb@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.equinox.p2.ui.admin@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@3:true,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.ecf.filetransfer@default:default,,org.eclipse.equinox.p2.jarprocessor@default:default"/> +<stringAttribute key="workspace_bundles" value="org.eclipse.equinox.simpleconfigurator.manipulator@3:true,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.ecf.provider.filetransfer.httpclient.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.ecf@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.frameworkadmin.equinox@2:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.apache.commons.logging@default:default,org.eclipse.equinox.p2.ui.admin.rcp@default:default,org.eclipse.equinox.p2.updatechecker@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.equinox.p2.metadata.generator@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.equinox.frameworkadmin@2:true,org.eclipse.ecf.filetransfer@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.exemplarysetup@default:default,org.eclipse.equinox.p2.ui.admin@default:default,org.eclipse.ecf.ssl@default:false,org.apache.commons.httpclient@default:default,org.sat4j.pb@default:default,org.eclipse.ecf.provider.filetransfer.httpclient@default:default,org.apache.commons.codec@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.equinox.p2.engine@default:default,org.sat4j.core@default:default"/> </launchConfiguration> diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.ui.admin/META-INF/MANIFEST.MF index 05b00b57e..2062e4beb 100644 --- a/bundles/org.eclipse.equinox.p2.ui.admin/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.ui.admin/META-INF/MANIFEST.MF @@ -14,7 +14,7 @@ Import-Package: org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.director, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.metadata, diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/plugin.xml b/bundles/org.eclipse.equinox.p2.ui.admin/plugin.xml index 9acdf9763..d866395a7 100644 --- a/bundles/org.eclipse.equinox.p2.ui.admin/plugin.xml +++ b/bundles/org.eclipse.equinox.p2.ui.admin/plugin.xml @@ -92,7 +92,7 @@ class="org.eclipse.equinox.internal.p2.ui.admin.dialogs.RepositoryImplementationPropertyPage" id="org.eclipse.equinox.internal.p2.ui.admin.dialogs.RepositoryImplementationPropertyPage"> <enabledWhen> - <adapt type="org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository"/> + <adapt type="org.eclipse.equinox.internal.provisional.p2.repository.IRepository"/> </enabledWhen> </page> diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddArtifactRepositoryOperation.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddArtifactRepositoryOperation.java index 3550215ef..c0c85a378 100644 --- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddArtifactRepositoryOperation.java +++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddArtifactRepositoryOperation.java @@ -10,10 +10,11 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.admin; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.ui.operations.AddRepositoryOperation; import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil; diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddMetadataRepositoryOperation.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddMetadataRepositoryOperation.java index 3d41e5e38..64e5f5a9c 100644 --- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddMetadataRepositoryOperation.java +++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddMetadataRepositoryOperation.java @@ -10,10 +10,11 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.admin; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.ui.operations.AddRepositoryOperation; import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil; diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java index d1b1e6e79..c46d001dd 100644 --- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java +++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java @@ -11,12 +11,13 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.admin; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.util.ArrayList; import java.util.List; import org.eclipse.equinox.internal.p2.ui.admin.dialogs.AddMetadataRepositoryDialog; import org.eclipse.equinox.internal.p2.ui.admin.preferences.PreferenceConstants; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.ui.ProvisioningOperationRunner; import org.eclipse.equinox.internal.provisional.p2.ui.actions.InstallAction; import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement; diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java index d4bd52f17..bfbdbae74 100644 --- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java +++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java @@ -10,10 +10,11 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.admin; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import org.eclipse.equinox.internal.p2.ui.admin.dialogs.AddProfileDialog; import org.eclipse.equinox.internal.p2.ui.admin.preferences.PreferenceConstants; import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.director.ProvisioningPlan; import org.eclipse.equinox.internal.provisional.p2.engine.IProfile; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java index f8f1cafb0..73390eb04 100644 --- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java +++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java @@ -10,9 +10,10 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.admin.dialogs; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.util.Map; import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI; import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement; import org.eclipse.swt.SWT; diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/META-INF/MANIFEST.MF index 6faf2fb54..8c6d3797c 100644 --- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/META-INF/MANIFEST.MF @@ -10,7 +10,7 @@ Import-Package: org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.p2.ui.query, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.director, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.metadata, diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.ui.sdk/META-INF/MANIFEST.MF index 79a0096aa..b43cd134d 100644 --- a/bundles/org.eclipse.equinox.p2.ui.sdk/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.ui.sdk/META-INF/MANIFEST.MF @@ -11,7 +11,7 @@ Import-Package: org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.director, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.metadata, diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java index 19a06f57e..caa1ad913 100644 --- a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java +++ b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java @@ -16,10 +16,10 @@ import org.eclipse.equinox.internal.p2.ui.sdk.prefs.PreferenceConstants; import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.engine.IProfile; import org.eclipse.equinox.internal.provisional.p2.engine.IProfileRegistry; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.ui.*; import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil; import org.eclipse.equinox.internal.provisional.p2.ui.policy.IUViewQueryContext; diff --git a/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF index 1a6efcf67..5b566f510 100644 --- a/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF @@ -16,7 +16,7 @@ Import-Package: com.ibm.icu.text, org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.director, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.engine.phases, @@ -24,7 +24,7 @@ Import-Package: com.ibm.icu.text, org.eclipse.equinox.internal.provisional.p2.metadata.query, org.eclipse.equinox.internal.provisional.p2.metadata.repository, org.eclipse.equinox.internal.provisional.p2.query, - org.eclipse.equinox.internal.provisional.spi.p2.core.repository, + org.eclipse.equinox.internal.provisional.spi.p2.repository, org.eclipse.osgi.service.resolver;version="1.1.0", org.eclipse.osgi.util;version="1.1.0", org.osgi.framework;version="1.3.0", diff --git a/bundles/org.eclipse.equinox.p2.ui/plugin.xml b/bundles/org.eclipse.equinox.p2.ui/plugin.xml index 0e5d23313..f2d82005f 100644 --- a/bundles/org.eclipse.equinox.p2.ui/plugin.xml +++ b/bundles/org.eclipse.equinox.p2.ui/plugin.xml @@ -8,7 +8,7 @@ class="org.eclipse.equinox.internal.p2.ui.ProvUIAdapterFactory"> <adapter type="org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit"/> <adapter type="org.eclipse.equinox.internal.provisional.p2.engine.IProfile"/> - <adapter type="org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository"/> + <adapter type="org.eclipse.equinox.internal.provisional.p2.repository.IRepository"/> <adapter type="org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository"/> <adapter type="org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository"/> </factory> diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/DefaultMetadataURLValidator.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/DefaultMetadataURLValidator.java index 689383267..4f9ee2c3a 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/DefaultMetadataURLValidator.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/DefaultMetadataURLValidator.java @@ -11,10 +11,11 @@ package org.eclipse.equinox.internal.p2.ui; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil; import org.eclipse.equinox.internal.provisional.p2.ui.policy.RepositoryLocationValidator; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIAdapterFactory.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIAdapterFactory.java index 6caa32492..a68133e5f 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIAdapterFactory.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIAdapterFactory.java @@ -10,9 +10,10 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import org.eclipse.core.runtime.IAdapterFactory; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.engine.IProfile; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/UIRepositoryEvent.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/UIRepositoryEvent.java index 434454d6c..24c9c4081 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/UIRepositoryEvent.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/UIRepositoryEvent.java @@ -11,8 +11,9 @@ package org.eclipse.equinox.internal.p2.ui; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; + import java.net.URI; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; /** * UIMetadataRepositoryEvent is used to distinguish those metadata repository diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java index a39ab83cb..fcd45f121 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java @@ -21,9 +21,9 @@ import org.eclipse.equinox.internal.p2.ui.*; import org.eclipse.equinox.internal.p2.ui.model.EmptyElementExplanation; import org.eclipse.equinox.internal.p2.ui.viewers.IUDetailsLabelProvider; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.*; import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningContext; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.internal.provisional.p2.repository.*; import org.eclipse.equinox.internal.provisional.p2.ui.*; import org.eclipse.equinox.internal.provisional.p2.ui.dialogs.AddRepositoryDialog; import org.eclipse.equinox.internal.provisional.p2.ui.dialogs.AvailableIUGroup; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ArtifactRepositoryElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ArtifactRepositoryElement.java index 35eb6e86d..12b54f84a 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ArtifactRepositoryElement.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ArtifactRepositoryElement.java @@ -10,13 +10,14 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.model; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import org.eclipse.core.runtime.*; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.equinox.internal.p2.ui.ProvUIMessages; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; import org.eclipse.equinox.internal.provisional.p2.ui.ProvUIImages; import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableIUElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableIUElement.java index 93c096f13..18da26b2d 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableIUElement.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableIUElement.java @@ -15,13 +15,13 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.equinox.internal.p2.ui.ProvUIMessages; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest; import org.eclipse.equinox.internal.provisional.p2.director.ProvisioningPlan; import org.eclipse.equinox.internal.provisional.p2.engine.IProfile; import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningContext; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.metadata.IRequiredCapability; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.ui.ProvUIImages; import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil; import org.eclipse.equinox.internal.provisional.p2.ui.policy.Policy; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java index bac78c688..571ae8232 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java @@ -11,14 +11,15 @@ package org.eclipse.equinox.internal.p2.ui.model; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.equinox.internal.p2.ui.ProvUIMessages; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI; import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningUtil; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/MetadataRepositoryElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/MetadataRepositoryElement.java index 467b2c0c4..3173fcc1e 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/MetadataRepositoryElement.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/MetadataRepositoryElement.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.model; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; @@ -17,7 +19,6 @@ import org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryMan import org.eclipse.equinox.internal.p2.ui.ProvUIActivator; import org.eclipse.equinox.internal.p2.ui.ProvUIMessages; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.query.IQueryable; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/RepositoryDetailsLabelProvider.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/RepositoryDetailsLabelProvider.java index 786fad40e..3649fcdff 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/RepositoryDetailsLabelProvider.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/RepositoryDetailsLabelProvider.java @@ -16,8 +16,8 @@ import org.eclipse.equinox.internal.p2.ui.ProvUIMessages; import org.eclipse.equinox.internal.p2.ui.model.MetadataRepositoryElement; import org.eclipse.equinox.internal.p2.ui.model.ProvElement; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.ui.ProvUIImages; import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement; import org.eclipse.jface.viewers.ITableLabelProvider; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/ProvUIProvisioningListener.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/ProvUIProvisioningListener.java index 645c6a773..397fbfacd 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/ProvUIProvisioningListener.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/ProvUIProvisioningListener.java @@ -11,14 +11,13 @@ package org.eclipse.equinox.internal.provisional.p2.ui; +import java.util.EventObject; import org.eclipse.equinox.internal.p2.ui.BatchChangeBeginningEvent; import org.eclipse.equinox.internal.p2.ui.BatchChangeCompleteEvent; - -import java.util.EventObject; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.ProvisioningListener; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; import org.eclipse.equinox.internal.provisional.p2.engine.ProfileEvent; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; /** * ProvisioningListener which handles event batching and other diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableArtifactRepositoryManager.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableArtifactRepositoryManager.java index 3cf2c884c..f07d4a7fe 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableArtifactRepositoryManager.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableArtifactRepositoryManager.java @@ -19,10 +19,10 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; import org.eclipse.equinox.internal.p2.ui.ProvUIActivator; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.query.Collector; import org.eclipse.equinox.internal.provisional.p2.query.Query; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.ui.policy.IUViewQueryContext; /** diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableMetadataRepositoryManager.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableMetadataRepositoryManager.java index 927338248..26d8235e6 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableMetadataRepositoryManager.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableMetadataRepositoryManager.java @@ -18,10 +18,10 @@ import org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryMan import org.eclipse.equinox.internal.p2.ui.ProvUIActivator; import org.eclipse.equinox.internal.p2.ui.ProvUIMessages; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.query.*; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.ui.policy.IUViewQueryContext; import org.eclipse.osgi.util.NLS; import org.eclipse.ui.statushandlers.StatusManager; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableRepositoryManager.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableRepositoryManager.java index 85fa7120e..655c7f524 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableRepositoryManager.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableRepositoryManager.java @@ -17,9 +17,9 @@ import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.ui.ProvUIActivator; import org.eclipse.equinox.internal.p2.ui.ProvUIMessages; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.query.*; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.ui.policy.IUViewQueryContext; import org.eclipse.osgi.util.NLS; import org.eclipse.ui.statushandlers.StatusManager; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/RepositoryLocationQuery.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/RepositoryLocationQuery.java index 154fcedeb..a332e70eb 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/RepositoryLocationQuery.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/RepositoryLocationQuery.java @@ -14,9 +14,9 @@ package org.eclipse.equinox.internal.provisional.p2.ui; import java.net.URI; import java.util.Iterator; import org.eclipse.equinox.internal.p2.core.helpers.QueryHelpers; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.query.Collector; import org.eclipse.equinox.internal.provisional.p2.query.Query; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; /** * RepositoryLocationQuery is a query that gathers repository diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/AvailableIUGroup.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/AvailableIUGroup.java index d4d9bcc98..4e79fe6a8 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/AvailableIUGroup.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/AvailableIUGroup.java @@ -21,9 +21,9 @@ import org.eclipse.equinox.internal.p2.ui.model.*; import org.eclipse.equinox.internal.p2.ui.viewers.DeferredQueryContentProvider; import org.eclipse.equinox.internal.p2.ui.viewers.IUDetailsLabelProvider; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI; import org.eclipse.equinox.internal.provisional.p2.ui.QueryableMetadataRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositoryManipulationPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositoryManipulationPage.java index ff05c0244..5c28b5aea 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositoryManipulationPage.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositoryManipulationPage.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.provisional.p2.ui.dialogs; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; + import java.lang.reflect.InvocationTargetException; import java.net.URI; import java.util.ArrayList; @@ -23,7 +25,6 @@ import org.eclipse.equinox.internal.p2.ui.model.MetadataRepositoryElement; import org.eclipse.equinox.internal.p2.ui.viewers.MetadataRepositoryElementComparator; import org.eclipse.equinox.internal.p2.ui.viewers.RepositoryDetailsLabelProvider; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; import org.eclipse.equinox.internal.provisional.p2.ui.*; import org.eclipse.equinox.internal.provisional.p2.ui.model.MetadataRepositories; import org.eclipse.equinox.internal.provisional.p2.ui.operations.*; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/model/IRepositoryElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/model/IRepositoryElement.java index 39f455c9b..96ea52459 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/model/IRepositoryElement.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/model/IRepositoryElement.java @@ -10,9 +10,10 @@ *******************************************************************************/ package org.eclipse.equinox.internal.provisional.p2.ui.model; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; /** * Interface for elements that represent repositories. diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/operations/AddColocatedRepositoryOperation.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/operations/AddColocatedRepositoryOperation.java index ced8c0633..fece26d06 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/operations/AddColocatedRepositoryOperation.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/operations/AddColocatedRepositoryOperation.java @@ -10,10 +10,11 @@ *******************************************************************************/ package org.eclipse.equinox.internal.provisional.p2.ui.operations; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; + import java.net.URI; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; /** * Operation that adds colocated artifact and metadata repositories diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/operations/ProvisioningUtil.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/operations/ProvisioningUtil.java index 01ae4b074..1f85d9c40 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/operations/ProvisioningUtil.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/operations/ProvisioningUtil.java @@ -11,6 +11,9 @@ package org.eclipse.equinox.internal.provisional.p2.ui.operations; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; + import java.net.URI; import java.util.Map; import org.eclipse.core.runtime.*; @@ -21,8 +24,6 @@ import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifact import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; import org.eclipse.equinox.internal.provisional.p2.director.*; import org.eclipse.equinox.internal.provisional.p2.engine.*; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/policy/IUViewQueryContext.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/policy/IUViewQueryContext.java index 3036d1f6c..07a453dee 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/policy/IUViewQueryContext.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/policy/IUViewQueryContext.java @@ -11,8 +11,8 @@ package org.eclipse.equinox.internal.provisional.p2.ui.policy; import org.eclipse.equinox.internal.p2.ui.ProvUIMessages; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; /** * IUViewQueryContext defines the different ways diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/policy/Policy.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/policy/Policy.java index 57132ba7c..6963a5ffa 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/policy/Policy.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/policy/Policy.java @@ -10,8 +10,6 @@ *******************************************************************************/ package org.eclipse.equinox.internal.provisional.p2.ui.policy; -import org.eclipse.equinox.internal.p2.ui.ProvUIMessages; - import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/ProvElementLabelProvider.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/ProvElementLabelProvider.java index 78893f483..e2c836904 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/ProvElementLabelProvider.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/ProvElementLabelProvider.java @@ -16,10 +16,10 @@ import org.eclipse.equinox.internal.p2.ui.model.IIUElement; import org.eclipse.equinox.internal.p2.ui.model.ProvElement; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepDescriptor; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.engine.IProfile; import org.eclipse.equinox.internal.provisional.p2.metadata.*; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.ui.ProvUI; import org.eclipse.equinox.internal.provisional.p2.ui.ProvUIImages; import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement; diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/StructuredViewerProvisioningListener.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/StructuredViewerProvisioningListener.java index 9d6bfe228..8135ded4e 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/StructuredViewerProvisioningListener.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/StructuredViewerProvisioningListener.java @@ -11,9 +11,8 @@ package org.eclipse.equinox.internal.provisional.p2.ui.viewers; +import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent; import org.eclipse.equinox.internal.provisional.p2.ui.ProvUIProvisioningListener; - -import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; import org.eclipse.equinox.internal.provisional.p2.ui.model.ProfileElement; import org.eclipse.jface.viewers.StructuredViewer; import org.eclipse.swt.widgets.Display; diff --git a/bundles/org.eclipse.equinox.p2.updatechecker/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.updatechecker/META-INF/MANIFEST.MF index 3c83990e6..5c430570b 100644 --- a/bundles/org.eclipse.equinox.p2.updatechecker/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.updatechecker/META-INF/MANIFEST.MF @@ -9,7 +9,7 @@ Bundle-Activator: org.eclipse.equinox.internal.p2.updatechecker.Activator Import-Package: org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core, - org.eclipse.equinox.internal.provisional.p2.core.repository, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.p2.director, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.metadata, diff --git a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java index 80869f0dc..530cfdfef 100644 --- a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java +++ b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java @@ -17,7 +17,6 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.equinox.internal.p2.core.helpers.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.director.IPlanner; import org.eclipse.equinox.internal.provisional.p2.engine.*; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; @@ -25,6 +24,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUni import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.query.Collector; import org.eclipse.equinox.internal.provisional.p2.query.Query; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.updatechecker.*; /** diff --git a/bundles/org.eclipse.equinox.p2.updatesite/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.updatesite/META-INF/MANIFEST.MF index 0841026cc..729ac74e0 100644 --- a/bundles/org.eclipse.equinox.p2.updatesite/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.updatesite/META-INF/MANIFEST.MF @@ -12,17 +12,19 @@ Import-Package: javax.xml.parsers, org.eclipse.equinox.app;version="1.0.0";resolution:=optional, org.eclipse.equinox.internal.p2.core.helpers, org.eclipse.equinox.internal.p2.publisher.eclipse, + org.eclipse.equinox.internal.p2.repository, + org.eclipse.equinox.internal.p2.repository.helpers, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, - org.eclipse.equinox.internal.provisional.p2.core.repository, org.eclipse.equinox.internal.provisional.p2.metadata, org.eclipse.equinox.internal.provisional.p2.metadata.query, org.eclipse.equinox.internal.provisional.p2.metadata.repository, org.eclipse.equinox.internal.provisional.p2.query, + org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository, - org.eclipse.equinox.internal.provisional.spi.p2.core.repository, org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository, + org.eclipse.equinox.internal.provisional.spi.p2.repository, org.eclipse.equinox.p2.publisher, org.eclipse.equinox.p2.publisher.actions, org.eclipse.equinox.p2.publisher.eclipse, diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/ECFTransport.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/ECFTransport.java deleted file mode 100644 index 0b33540df..000000000 --- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/ECFTransport.java +++ /dev/null @@ -1,425 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * compeople AG (Stefan Liebig) - various ongoing maintenance - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.updatesite; - -import java.io.*; -import java.net.*; -import org.eclipse.core.runtime.*; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.ecf.core.*; -import org.eclipse.ecf.core.security.ConnectContextFactory; -import org.eclipse.ecf.core.security.IConnectContext; -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.internal.p2.core.helpers.LogHelper; -import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IStateful; -import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI; -import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI.AuthenticationInfo; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; -import org.eclipse.equinox.security.storage.*; -import org.eclipse.osgi.util.NLS; -import org.osgi.util.tracker.ServiceTracker; - -/** - * A transport implementation that uses ECF file transfer API. - */ -public class ECFTransport { - /** - * The number of password retry attempts allowed before failing. - */ - private static final int LOGIN_RETRIES = 3; - - private static final ProtocolException ERROR_401 = new ProtocolException(); - - private static final String SERVER_REDIRECT = "Server redirected too many times"; //$NON-NLS-1$ - - /** - * The singleton transport instance. - */ - private static ECFTransport instance; - - /** - * A job that waits on a barrier. - */ - static class WaitJob extends Job { - private final Object[] barrier; - - /** - * Creates a wait job. - * @param location A location string that is used in the job name - * @param barrier The job will wait until the first entry in the barrier is non-null - */ - WaitJob(String location, Object[] barrier) { - super(NLS.bind(Messages.repo_loading, location)); - this.barrier = barrier; - setSystem(true); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) - */ - protected IStatus run(IProgressMonitor monitor) { - synchronized (barrier) { - while (barrier[0] == null) { - try { - barrier.wait(); - } catch (InterruptedException e) { - //ignore - } - } - } - return Status.OK_STATUS; - } - } - - private final ServiceTracker retrievalFactoryTracker; - - /** - * Returns an initialized instance of ECFTransport - */ - public static synchronized ECFTransport getInstance() { - if (instance == null) { - instance = new ECFTransport(); - } - return instance; - } - - /** - * Private to avoid client instantiation. - */ - private ECFTransport() { - retrievalFactoryTracker = new ServiceTracker(Activator.getBundleContext(), IRetrieveFileTransferFactory.class.getName(), null); - retrievalFactoryTracker.open(); - } - - /** - * Gets the last modified date for the specified file. - * @param location - The URL location of the file. - * @return A <code>long</code> representing the date. Returns <code>0</code> if the file is not found or an error occurred. - * @exception OperationCanceledException if the request was canceled. - */ - public long getLastModified(URI location) throws ProvisionException { - String locationString = location.toString(); - try { - IConnectContext context = getConnectionContext(locationString, false); - for (int i = 0; i < LOGIN_RETRIES; i++) { - try { - return doGetLastModified(locationString, context); - } catch (ProtocolException e) { - if (ERROR_401 == e) - context = getConnectionContext(locationString, true); - } catch (Exception e) { - e.getMessage(); - } - } - } catch (UserCancelledException e) { - throw new OperationCanceledException(); - } - //too many retries, so report as failure - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, NLS.bind(Messages.io_failedRead, locationString), null)); - } - - /** - * Perform the ECF call to get the last modified time, failing if there is any - * protocol failure such as an authentication failure. - */ - private long doGetLastModified(String location, IConnectContext context) throws ProtocolException { - IContainer container; - try { - container = ContainerFactory.getDefault().createContainer(); - } catch (ContainerCreateException e) { - return 0; - } - IRemoteFileSystemBrowserContainerAdapter adapter = (IRemoteFileSystemBrowserContainerAdapter) container.getAdapter(IRemoteFileSystemBrowserContainerAdapter.class); - if (adapter == null) { - return 0; - } - IRemoteFile remoteFile = checkFile(adapter, location, context); - if (remoteFile == null) { - return 0; - } - return remoteFile.getInfo().getLastModified(); - } - - /** - * Downloads the contents of the given URL to the given output stream. The - * destination stream will be closed by this method whether it succeeds - * to download or not. - */ - public IStatus download(String url, OutputStream destination, IProgressMonitor monitor) { - try { - IConnectContext context = getConnectionContext(url, false); - for (int i = 0; i < LOGIN_RETRIES; i++) { - try { - return performDownload(url, destination, context, monitor); - } catch (ProtocolException e) { - if (e == ERROR_401) - context = getConnectionContext(url, true); - } - } - } catch (UserCancelledException e) { - return Status.CANCEL_STATUS; - } catch (ProvisionException e) { - return e.getStatus(); - } finally { - try { - destination.close(); - } catch (IOException e) { - //ignore secondary failure - } - } - //reached maximum number of retries without success - return new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, NLS.bind(Messages.io_failedRead, url), null); - } - - public IStatus performDownload(String toDownload, OutputStream target, IConnectContext context, IProgressMonitor monitor) throws ProtocolException { - IRetrieveFileTransferFactory factory = (IRetrieveFileTransferFactory) retrievalFactoryTracker.getService(); - if (factory == null) - return statusOn(target, new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.ecf_configuration_error, toDownload))); - - return transfer(factory.newInstance(), toDownload, target, context, monitor); - } - - private IRemoteFile checkFile(final IRemoteFileSystemBrowserContainerAdapter retrievalContainer, final String location, IConnectContext context) throws ProtocolException { - final Object[] result = new Object[2]; - final Object FAIL = new Object(); - IRemoteFileSystemListener listener = new IRemoteFileSystemListener() { - public void handleRemoteFileEvent(IRemoteFileSystemEvent event) { - Exception exception = event.getException(); - if (exception != null) { - synchronized (result) { - result[0] = FAIL; - result[1] = exception; - result.notify(); - } - } else if (event instanceof IRemoteFileSystemBrowseEvent) { - IRemoteFileSystemBrowseEvent fsbe = (IRemoteFileSystemBrowseEvent) event; - IRemoteFile[] remoteFiles = fsbe.getRemoteFiles(); - if (remoteFiles != null && remoteFiles.length > 0 && remoteFiles[0] != null) { - synchronized (result) { - result[0] = remoteFiles[0]; - result.notify(); - } - } else { - synchronized (result) { - result[0] = FAIL; - result.notify(); - } - } - } - } - }; - try { - retrievalContainer.setConnectContextForAuthentication(context); - retrievalContainer.sendBrowseRequest(FileIDFactory.getDefault().createFileID(retrievalContainer.getBrowseNamespace(), location), listener); - } catch (RemoteFileSystemException e) { - return null; - } catch (FileCreateException e) { - return null; - } - waitFor(location, result); - if (result[0] == FAIL && result[1] instanceof IOException) { - IOException ioException = (IOException) result[1]; - //throw a special exception for authentication failure so we know to prompt for username/password - String message = ioException.getMessage(); - if (message != null && (message.indexOf(" 401 ") != -1 || message.indexOf(SERVER_REDIRECT) != -1)) //$NON-NLS-1$ - throw ERROR_401; - } - if (result[0] instanceof IRemoteFile) - return (IRemoteFile) result[0]; - return null; - } - - /** - * Check if the given exception represents a permission failure (401 for HTTP), - * and throw a special marker exception if a permission failure was encountered. - */ - private void checkPermissionDenied(Throwable t) throws ProtocolException { - if (!(t instanceof IncomingFileTransferException)) - return; - IncomingFileTransferException e = (IncomingFileTransferException) t; - if (e.getErrorCode() == 401) - throw ERROR_401; - //try to figure out if we have a 401 by parsing the exception message - IStatus status = e.getStatus(); - Throwable exception = status.getException(); - if (exception instanceof IOException) - if (exception.getMessage() != null && (exception.getMessage().indexOf(" 401 ") != -1 || exception.getMessage().indexOf(SERVER_REDIRECT) != -1)) //$NON-NLS-1$ - throw ERROR_401; - } - - private IStatus transfer(final IRetrieveFileTransferContainerAdapter retrievalContainer, final String toDownload, final OutputStream target, IConnectContext context, final IProgressMonitor monitor) throws ProtocolException { - final IStatus[] result = new IStatus[1]; - IFileTransferListener listener = new IFileTransferListener() { - public void handleTransferEvent(IFileTransferEvent event) { - if (event instanceof IFileTransferConnectStartEvent) { - IFileTransferConnectStartEvent cse = (IFileTransferConnectStartEvent) event; - FileTransferJob connectJob = cse.prepareConnectJob(null); - cse.connectUsingJob(connectJob); - } else if (event instanceof IIncomingFileTransferReceiveStartEvent) { - IIncomingFileTransferReceiveStartEvent rse = (IIncomingFileTransferReceiveStartEvent) event; - try { - if (target != null) { - rse.receive(target); - } - } catch (IOException e) { - IStatus status = convertToStatus(e); - synchronized (result) { - result[0] = status; - result.notify(); - } - } - } - if (event instanceof IIncomingFileTransferReceiveDataEvent) { - IIncomingFileTransfer source = ((IIncomingFileTransferReceiveDataEvent) event).getSource(); - if (monitor != null) { - if (monitor.isCanceled()) - source.cancel(); - } - } - if (event instanceof IIncomingFileTransferReceiveDoneEvent) { - Exception exception = ((IIncomingFileTransferReceiveDoneEvent) event).getException(); - IStatus status = convertToStatus(exception); - synchronized (result) { - result[0] = status; - result.notify(); - } - } - } - }; - - try { - retrievalContainer.setConnectContextForAuthentication(context); - retrievalContainer.sendRetrieveRequest(FileIDFactory.getDefault().createFileID(retrievalContainer.getRetrieveNamespace(), toDownload), listener, null); - } catch (IncomingFileTransferException e) { - checkPermissionDenied(e); - return statusOn(target, e.getStatus()); - } catch (FileCreateException e) { - return statusOn(target, e.getStatus()); - } - waitFor(toDownload, result); - final Throwable exception = result[0].getException(); - checkPermissionDenied(exception); - //if the transfer failed, return the underlying exception status, otherwise return top level DownloadStatus - if (exception instanceof IncomingFileTransferException) { - IStatus status = ((IncomingFileTransferException) exception).getStatus(); - if (!status.isOK()) - return statusOn(target, status); - } - return statusOn(target, result[0]); - } - - /** - * Returns the connection context for the given URL. This may prompt the - * user for user name and password as required. - * - * @param xmlLocation - the file location requiring login details - * @param prompt - use <code>true</code> to prompt the user instead of - * looking at the secure preference store for login, use <code>false</code> - * to only try the secure preference store - * @throws UserCancelledException when the user cancels the login prompt - * @throws ProvisionException if the password cannot be read or saved - * @return The connection context - */ - public IConnectContext getConnectionContext(String xmlLocation, boolean prompt) throws UserCancelledException, ProvisionException { - ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault(); - IPath hostLocation = new Path(xmlLocation).removeLastSegments(1); - String nodeKey; - try { - nodeKey = URLEncoder.encode(hostLocation.toString(), "UTF-8"); //$NON-NLS-1$ - } catch (UnsupportedEncodingException e2) { - //fall back to default platform encoding - nodeKey = URLEncoder.encode(hostLocation.toString()); - } - String nodeName = IRepository.PREFERENCE_NODE + '/' + nodeKey; - ISecurePreferences prefNode = null; - if (securePreferences.nodeExists(nodeName)) - prefNode = securePreferences.node(nodeName); - if (!prompt) { - if (prefNode == null) - return null; - try { - String username = prefNode.get(IRepository.PROP_USERNAME, null); - String password = prefNode.get(IRepository.PROP_PASSWORD, null); - //if we don't have stored connection data just return a null connection context - if (username == null || password == null) - return null; - return ConnectContextFactory.createUsernamePasswordConnectContext(username, password); - } catch (StorageException e) { - String msg = NLS.bind(Messages.repoMan_internalError, xmlLocation.toString()); - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.INTERNAL_ERROR, msg, null)); - } - } - //need to prompt user for user name and password - ServiceTracker adminUITracker = new ServiceTracker(Activator.getBundleContext(), IServiceUI.class.getName(), null); - adminUITracker.open(); - IServiceUI adminUIService = (IServiceUI) adminUITracker.getService(); - AuthenticationInfo loginDetails = null; - if (adminUIService != null) - loginDetails = adminUIService.getUsernamePassword(hostLocation.toString()); - //null result means user canceled password dialog - if (loginDetails == null) - throw new UserCancelledException(); - //save user name and password if requested by user - if (loginDetails.saveResult()) { - if (prefNode == null) - prefNode = securePreferences.node(nodeName); - try { - prefNode.put(IRepository.PROP_USERNAME, loginDetails.getUserName(), true); - prefNode.put(IRepository.PROP_PASSWORD, loginDetails.getPassword(), true); - prefNode.flush(); - } catch (StorageException e1) { - String msg = NLS.bind(Messages.repoMan_internalError, xmlLocation.toString()); - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.INTERNAL_ERROR, msg, null)); - } catch (IOException e) { - String msg = NLS.bind(Messages.repoMan_internalError, xmlLocation.toString()); - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.INTERNAL_ERROR, msg, null)); - } - } - return ConnectContextFactory.createUsernamePasswordConnectContext(loginDetails.getUserName(), loginDetails.getPassword()); - } - - protected IStatus convertToStatus(Exception e) { - if (e == null) - return Status.OK_STATUS; - if (e instanceof UserCancelledException) - return new Status(IStatus.CANCEL, Activator.ID, e.getMessage(), e); - return new Status(IStatus.ERROR, Activator.ID, e.getMessage(), e); - } - - private static IStatus statusOn(OutputStream target, IStatus status) { - if (target instanceof IStateful) - ((IStateful) target).setStatus(status); - return status; - } - - /** - * Waits until the first entry in the given array is non-null. - */ - private void waitFor(String location, Object[] barrier) { - WaitJob wait = new WaitJob(location, barrier); - wait.schedule(); - while (barrier[0] == null) { - boolean logged = false; - try { - wait.join(); - } catch (InterruptedException e) { - if (!logged) - LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "Unexpected interrupt while waiting on ECF transfer", e)); //$NON-NLS-1$ - } - } - } -} diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java index 4a09d1b80..10b0c6e01 100644 --- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java +++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java @@ -17,13 +17,13 @@ import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; import org.eclipse.equinox.internal.provisional.p2.core.*; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.metadata.*; import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription; import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; import org.eclipse.equinox.internal.provisional.p2.metadata.query.LatestIUVersionQuery; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.equinox.internal.provisional.p2.query.*; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; import org.eclipse.equinox.p2.publisher.*; import org.eclipse.equinox.p2.publisher.eclipse.URLEntry; import org.eclipse.equinox.spi.p2.publisher.LocalizationHelper; diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java index 9232fe693..df950e5e8 100644 --- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java +++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java @@ -16,8 +16,11 @@ import java.util.HashMap; import java.util.Map; import java.util.zip.*; import org.eclipse.core.runtime.*; +import org.eclipse.ecf.filetransfer.UserCancelledException; import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; import org.eclipse.equinox.internal.p2.publisher.eclipse.FeatureParser; +import org.eclipse.equinox.internal.p2.repository.AuthenticationFailedException; +import org.eclipse.equinox.internal.p2.repository.RepositoryTransport; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.p2.publisher.eclipse.*; import org.eclipse.osgi.util.NLS; @@ -110,48 +113,70 @@ public class UpdateSite { * Returns a local file containing the contents of the update site at the given location. */ private static File loadSiteFile(URI location, IProgressMonitor monitor) throws ProvisionException { - Throwable failure; - File siteFile = null; - IStatus transferResult; - boolean deleteSiteFile = false; + SubMonitor submonitor = SubMonitor.convert(monitor, 1000); try { - URI actualLocation = getSiteURI(location); - if (PROTOCOL_FILE.equals(actualLocation.getScheme())) { - siteFile = URIUtil.toFile(actualLocation); - if (siteFile.exists()) - transferResult = Status.OK_STATUS; - else { - String msg = NLS.bind(Messages.ErrorReadingSite, location); - transferResult = new Status(IStatus.ERROR, Activator.ID, msg, new FileNotFoundException(siteFile.getAbsolutePath())); + File siteFile = null; + IStatus transferResult = null; + boolean deleteSiteFile = false; + try { + URI actualLocation = getSiteURI(location); + if (PROTOCOL_FILE.equals(actualLocation.getScheme())) { + siteFile = URIUtil.toFile(actualLocation); + if (siteFile.exists()) + transferResult = Status.OK_STATUS; + else { + String msg = NLS.bind(Messages.ErrorReadingSite, location); + transferResult = new Status(IStatus.ERROR, Activator.ID, ProvisionException.ARTIFACT_NOT_FOUND, msg, new FileNotFoundException(siteFile.getAbsolutePath())); + } + } else { + // creating a temp file. In the event of an error we want to delete it. + deleteSiteFile = true; + OutputStream destination = null; + try { + siteFile = File.createTempFile("site", ".xml"); //$NON-NLS-1$//$NON-NLS-2$ + destination = new BufferedOutputStream(new FileOutputStream(siteFile)); + } catch (IOException e) { + throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.INTERNAL_ERROR, "Can not create tempfile for site.xml", e)); //$NON-NLS-1$ + } + transferResult = getTransport().download(actualLocation, destination, submonitor.newChild(999)); + try { + destination.close(); + } catch (IOException e) { + throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.INTERNAL_ERROR, "Failing to close tempfile for site.xml", e)); //$NON-NLS-1$ + } + } + if (monitor.isCanceled()) + throw new OperationCanceledException(); + if (transferResult.isOK()) { + // successful. If the siteFile is the download of a remote site.xml it will get cleaned up later + deleteSiteFile = false; + return siteFile; } - } else { - // creating a temp file. In the event of an error we want to delete it. - deleteSiteFile = true; - siteFile = File.createTempFile("site", ".xml"); //$NON-NLS-1$//$NON-NLS-2$ - OutputStream destination = new BufferedOutputStream(new FileOutputStream(siteFile)); - transferResult = getTransport().download(actualLocation.toString(), destination, monitor); - } - if (monitor.isCanceled()) - throw new OperationCanceledException(); - if (transferResult.isOK()) { - // successful. If the siteFile is the download of a remote site.xml it will get cleaned up later - deleteSiteFile = false; - return siteFile; - } - // The transfer failed. Check if the file is not present - if (0 == getTransport().getLastModified(actualLocation)) - throw new FileNotFoundException(actualLocation.toString()); - failure = transferResult.getException(); - } catch (IOException e) { - failure = e; + // The transferStatus from download has a well formatted message that should + // be used as it contains useful feedback to the user. + // The only thing needed is to translate the error code ARTIFACT_NOT_FOUND to + // REPOSITORY_NOT_FOUND as the download does not know what the file represents. + // + // TODO: ? Tests dictate that REPOSITORY_NOT_FOUND is the correct response to + // issues like "unknown host", "malformed url" - it is almost impossible to differentiate + // between "not found" and "error while reading something found" at this point. + int code = transferResult.getCode(); + MultiStatus ms = new MultiStatus(Activator.ID, // + ProvisionException.REPOSITORY_NOT_FOUND, + // (code == ProvisionException.ARTIFACT_NOT_FOUND || code == ProvisionException.REPOSITORY_NOT_FOUND ? ProvisionException.REPOSITORY_NOT_FOUND : ProvisionException.REPOSITORY_FAILED_READ), // + new IStatus[] {transferResult}, // + NLS.bind(Messages.ErrorReadingSite, location), null); + throw new ProvisionException(ms); + + } finally { + if (deleteSiteFile && siteFile != null) + siteFile.delete(); + } } finally { - if (deleteSiteFile && siteFile != null) - siteFile.delete(); + if (monitor != null) + monitor.done(); } - int code = (failure instanceof FileNotFoundException) ? ProvisionException.REPOSITORY_NOT_FOUND : ProvisionException.REPOSITORY_FAILED_READ; - String msg = NLS.bind(Messages.ErrorReadingSite, location); - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, code, msg, failure)); } /* @@ -172,7 +197,13 @@ public class UpdateSite { if (monitor.isCanceled()) throw new OperationCanceledException(); OutputStream destination = new BufferedOutputStream(new FileOutputStream(featureFile)); - transferResult = getTransport().download(featureURI.toString(), destination, monitor); + transferResult = getTransport().download(featureURI, destination, monitor); + try { + destination.close(); + } catch (IOException e) { + LogHelper.log(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.ErrorReadingFeature, featureURI), e)); + return null; + } if (transferResult.isOK()) break; } @@ -192,15 +223,22 @@ public class UpdateSite { return null; } - /* + /** * Throw an exception if the site pointed to by the given URI is not valid. + * @param url the site file to check + * @param monitor a monitor + * @throws UserCancelledException if user canceled during authentication + * @throws AuthenticationFailedException if too many attempts made to login + * @throws FileNotFoundException if the remote file does not exist + * @throws CoreException on errors in communication (unknown host, connection refused, etc.) */ - public static void validate(URI url, IProgressMonitor monitor) throws ProvisionException { + public static void validate(URI url, IProgressMonitor monitor) throws UserCancelledException, AuthenticationFailedException, FileNotFoundException, CoreException { URI siteURI = getSiteURI(url); - long lastModified = getTransport().getLastModified(siteURI); + long lastModified = getTransport().getLastModified(siteURI, monitor); if (lastModified == 0) { - String msg = NLS.bind(Messages.ErrorReadingSite, url); - throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, null)); + throw new FileNotFoundException(url.toString()); + // String msg = NLS.bind(Messages.ErrorReadingSite, url); + // throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, null)); } } @@ -369,7 +407,13 @@ public class UpdateSite { } else { digestFile = File.createTempFile("digest", ".zip"); //$NON-NLS-1$ //$NON-NLS-2$ BufferedOutputStream destination = new BufferedOutputStream(new FileOutputStream(digestFile)); - IStatus result = getTransport().download(digestURI.toString(), destination, monitor); + IStatus result = getTransport().download(digestURI, destination, monitor); + try { + destination.close(); + } catch (IOException e) { + LogHelper.log(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.ErrorReadingDigest, location), e)); + return null; + } if (result.getSeverity() == IStatus.CANCEL || monitor.isCanceled()) throw new OperationCanceledException(); if (!result.isOK()) @@ -476,7 +520,7 @@ public class UpdateSite { } } - private static ECFTransport getTransport() { - return ECFTransport.getInstance(); + private static RepositoryTransport getTransport() { + return RepositoryTransport.getInstance(); } } diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java index 7a0f7cdc9..74d0ad660 100644 --- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java +++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java @@ -11,6 +11,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.updatesite.artifact; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; + import java.net.URI; import java.util.*; import org.eclipse.core.runtime.IProgressMonitor; @@ -18,7 +20,6 @@ import org.eclipse.equinox.internal.p2.updatesite.UpdateSite; import org.eclipse.equinox.internal.p2.updatesite.metadata.UpdateSiteMetadataRepositoryFactory; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.ArtifactRepositoryFactory; import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.SimpleArtifactRepositoryFactory; diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/Messages.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/Messages.java new file mode 100644 index 000000000..9c9b3858e --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/Messages.java @@ -0,0 +1,21 @@ +package org.eclipse.equinox.internal.p2.updatesite.metadata; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +public class Messages { + private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.p2.updatesite.metadata.messages"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); + + private Messages() { + } + + public static String getString(String key) { + try { + return RESOURCE_BUNDLE.getString(key); + } catch (MissingResourceException e) { + return '!' + key + '!'; + } + } +} diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java index 4a6f083f9..5c8e054ba 100644 --- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java +++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java @@ -13,17 +13,21 @@ package org.eclipse.equinox.internal.p2.updatesite.metadata; import java.io.File; +import java.io.FileNotFoundException; import java.net.URI; import java.util.Map; import org.eclipse.core.runtime.*; +import org.eclipse.ecf.filetransfer.UserCancelledException; import org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository; +import org.eclipse.equinox.internal.p2.repository.AuthenticationFailedException; import org.eclipse.equinox.internal.p2.updatesite.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; +import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.MetadataRepositoryFactory; import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.SimpleMetadataRepositoryFactory; import org.eclipse.equinox.p2.publisher.*; +import org.eclipse.osgi.util.NLS; public class UpdateSiteMetadataRepositoryFactory extends MetadataRepositoryFactory { private static final String PROP_SITE_CHECKSUM = "site.checksum"; //$NON-NLS-1$ @@ -47,6 +51,14 @@ public class UpdateSiteMetadataRepositoryFactory extends MetadataRepositoryFacto UpdateSite.validate(location, monitor); } catch (ProvisionException e) { return e.getStatus(); + } catch (UserCancelledException e) { + return Status.CANCEL_STATUS; + } catch (AuthenticationFailedException e) { + return new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, NLS.bind(Messages.getString("UpdateSiteMetadataRepositoryFactory.AuthenticationFailedFor_0"), location.toString()), e); //$NON-NLS-1$ + } catch (FileNotFoundException e) { + return new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, NLS.bind(Messages.getString("UpdateSiteMetadataRepositoryFactory.RepositoryNotFound_0"), location.toString()), e); //$NON-NLS-1$ + } catch (CoreException e) { + return e.getStatus(); } return Status.OK_STATUS; } diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/messages.properties b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/messages.properties new file mode 100644 index 000000000..2a848a928 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/messages.properties @@ -0,0 +1,2 @@ +UpdateSiteMetadataRepositoryFactory.AuthenticationFailedFor_0=Authentication failed {0} +UpdateSiteMetadataRepositoryFactory.RepositoryNotFound_0=Repository not found {0} |