Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 128612 Details for
Bug 216278
[prov] ECFTransport and ECFMetadataTransport should be merged
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to use new repository bundle
repositoryPatch.txt (text/plain), 405.77 KB, created by
Henrik Lindberg
on 2009-03-12 15:20:58 EDT
(
hide
)
Description:
Patch to use new repository bundle
Filename:
MIME Type:
Creator:
Henrik Lindberg
Created:
2009-03-12 15:20:58 EDT
Size:
405.77 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.core >Index: src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryEvent.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryEvent.java >diff -N src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryEvent.java >--- src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryEvent.java 12 Feb 2009 22:22:41 -0000 1.7 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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; >- } >- >-} >Index: src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepository.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepository.java >diff -N src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepository.java >--- src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepository.java 12 Feb 2009 18:23:20 -0000 1.10 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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); >-} >Index: src/org/eclipse/equinox/internal/provisional/p2/core/repository/ICompositeRepository.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/provisional/p2/core/repository/ICompositeRepository.java >diff -N src/org/eclipse/equinox/internal/provisional/p2/core/repository/ICompositeRepository.java >--- src/org/eclipse/equinox/internal/provisional/p2/core/repository/ICompositeRepository.java 13 Feb 2009 23:14:20 -0000 1.2 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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); >-} >Index: src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepositoryManager.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepositoryManager.java >diff -N src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepositoryManager.java >--- src/org/eclipse/equinox/internal/provisional/p2/core/repository/IRepositoryManager.java 19 Feb 2009 16:31:07 -0000 1.7 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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); >- >-} >Index: src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryCreationException.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryCreationException.java >diff -N src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryCreationException.java >--- src/org/eclipse/equinox/internal/provisional/p2/core/repository/RepositoryCreationException.java 11 Feb 2008 05:30:41 -0000 1.2 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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); >- } >- >-} >Index: src/org/eclipse/equinox/internal/p2/core/helpers/messages.properties >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/messages.properties,v >retrieving revision 1.3 >diff -u -r1.3 messages.properties >--- src/org/eclipse/equinox/internal/p2/core/helpers/messages.properties 20 Feb 2009 22:43:59 -0000 1.3 >+++ src/org/eclipse/equinox/internal/p2/core/helpers/messages.properties 12 Mar 2009 18:54:52 -0000 >@@ -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} >Index: src/org/eclipse/equinox/internal/p2/core/helpers/Messages.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/Messages.java,v >retrieving revision 1.3 >diff -u -r1.3 Messages.java >--- src/org/eclipse/equinox/internal/p2/core/helpers/Messages.java 20 Feb 2009 22:43:59 -0000 1.3 >+++ src/org/eclipse/equinox/internal/p2/core/helpers/Messages.java 12 Mar 2009 18:54:52 -0000 >@@ -25,14 +25,6 @@ > // 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; > >Index: src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java >diff -N src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java >--- src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java 28 Feb 2009 20:46:03 -0000 1.22 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,953 +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); >- try { >- IRepository result = loadRepository(location, monitor, null, 0); >- setEnabled(location, wasEnabled); >- return result; >- } catch (ProvisionException e) { >- //if we failed to load, make sure the repository is not lost >- addRepository(location, wasEnabled, true); >- throw e; >- } >- } >- >- 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; >- } >- >-} >Index: src/org/eclipse/equinox/internal/p2/persistence/XMLConstants.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/persistence/XMLConstants.java >diff -N src/org/eclipse/equinox/internal/p2/persistence/XMLConstants.java >--- src/org/eclipse/equinox/internal/p2/persistence/XMLConstants.java 13 Nov 2008 20:42:49 -0000 1.6 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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$ >-} >Index: src/org/eclipse/equinox/internal/p2/persistence/CompositeWriter.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/persistence/CompositeWriter.java >diff -N src/org/eclipse/equinox/internal/p2/persistence/CompositeWriter.java >--- src/org/eclipse/equinox/internal/p2/persistence/CompositeWriter.java 13 Feb 2009 23:14:20 -0000 1.4 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,69 +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; >-import org.eclipse.equinox.internal.provisional.p2.core.repository.ICompositeRepository; >- >-/* >- * 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.makeClassVersionInstruction(type, ICompositeRepository.class, 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(); >- } >- >-} >Index: src/org/eclipse/equinox/internal/p2/persistence/messages.properties >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/persistence/messages.properties >diff -N src/org/eclipse/equinox/internal/p2/persistence/messages.properties >--- src/org/eclipse/equinox/internal/p2/persistence/messages.properties 5 Dec 2008 21:11:46 -0000 1.3 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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 >Index: src/org/eclipse/equinox/internal/p2/persistence/XMLWriter.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/persistence/XMLWriter.java >diff -N src/org/eclipse/equinox/internal/p2/persistence/XMLWriter.java >--- src/org/eclipse/equinox/internal/p2/persistence/XMLWriter.java 22 Dec 2008 15:30:46 -0000 1.11 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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 makeClassVersionInstruction(String target, Class clazz, Version version) { >- return new ProcessingInstruction(target, new String[] {PI_CLASS_ATTRIBUTE, PI_VERSION_ATTRIBUTE}, new String[] {clazz.getName(), 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; >- } >- } >- >-} >Index: src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryState.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryState.java >diff -N src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryState.java >--- src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryState.java 13 Feb 2009 23:14:20 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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 >Index: src/org/eclipse/equinox/internal/p2/persistence/CompositeParser.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/persistence/CompositeParser.java >diff -N src/org/eclipse/equinox/internal/p2/persistence/CompositeParser.java >--- src/org/eclipse/equinox/internal/p2/persistence/CompositeParser.java 13 Feb 2009 23:14:19 -0000 1.4 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,218 +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)) { >- // TODO: should the root handler be constructed based on class >- // via an extension registry mechanism? >- // String clazz = extractPIClass(data); >- // TODO: version tolerance by extension >- 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; >- } >- >-} >Index: src/org/eclipse/equinox/internal/p2/persistence/Messages.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/persistence/Messages.java >diff -N src/org/eclipse/equinox/internal/p2/persistence/Messages.java >--- src/org/eclipse/equinox/internal/p2/persistence/Messages.java 5 Dec 2008 21:11:46 -0000 1.3 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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; >- >-} >Index: src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryIO.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryIO.java >diff -N src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryIO.java >--- src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryIO.java 13 Feb 2009 23:14:20 -0000 1.6 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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)); >- } >- } >-} >Index: src/org/eclipse/equinox/internal/p2/persistence/XMLParser.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/persistence/XMLParser.java >diff -N src/org/eclipse/equinox/internal/p2/persistence/XMLParser.java >--- src/org/eclipse/equinox/internal/p2/persistence/XMLParser.java 22 Dec 2008 15:30:46 -0000 1.21 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,770 +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.VersionRange; >-import org.eclipse.osgi.util.NLS; >-import org.osgi.framework.BundleContext; >-import org.eclipse.equinox.internal.provisional.p2.core.Version; >-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); >- } >- >- } >- >- // Helpers for processing instructions that include a Class and/or a Version. >- >- public String extractPIClass(String data) { >- return extractPIAttribute(data, PI_CLASS_ATTRIBUTE); >- } >- >- 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$ >- // } >- // } >- >-} >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF,v >retrieving revision 1.40 >diff -u -r1.40 MANIFEST.MF >--- META-INF/MANIFEST.MF 9 Mar 2009 17:25:14 -0000 1.40 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:54:52 -0000 >@@ -18,7 +18,7 @@ > 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 @@ > 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 @@ > 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 @@ > 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 @@ > 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 @@ > 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, >Index: src/org/eclipse/equinox/internal/provisional/spi/p2/core/repository/AbstractRepository.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/provisional/spi/p2/core/repository/AbstractRepository.java >diff -N src/org/eclipse/equinox/internal/provisional/spi/p2/core/repository/AbstractRepository.java >--- src/org/eclipse/equinox/internal/provisional/spi/p2/core/repository/AbstractRepository.java 9 Oct 2008 03:22:18 -0000 1.5 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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; >- } >-} >#P org.eclipse.equinox.p2.updatechecker >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.updatechecker/META-INF/MANIFEST.MF,v >retrieving revision 1.13 >diff -u -r1.13 MANIFEST.MF >--- META-INF/MANIFEST.MF 13 Nov 2008 21:11:23 -0000 1.13 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:54:54 -0000 >@@ -9,7 +9,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.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, >Index: src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java,v >retrieving revision 1.9 >diff -u -r1.9 UpdateChecker.java >--- src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java 27 Feb 2009 00:15:16 -0000 1.9 >+++ src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java 12 Mar 2009 18:54:55 -0000 >@@ -17,7 +17,6 @@ > 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.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.*; > > /** >#P org.eclipse.equinox.p2.ui >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableArtifactRepositoryManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableArtifactRepositoryManager.java,v >retrieving revision 1.11 >diff -u -r1.11 QueryableArtifactRepositoryManager.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableArtifactRepositoryManager.java 5 Mar 2009 21:31:06 -0000 1.11 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableArtifactRepositoryManager.java 12 Mar 2009 18:55:01 -0000 >@@ -11,6 +11,9 @@ > *******************************************************************************/ > package org.eclipse.equinox.internal.provisional.p2.ui; > >+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.Arrays; > import org.eclipse.core.runtime.IProgressMonitor; >@@ -19,8 +22,6 @@ > 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.ui.policy.IUViewQueryContext; >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/RepositoryLocationQuery.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/RepositoryLocationQuery.java,v >retrieving revision 1.1 >diff -u -r1.1 RepositoryLocationQuery.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/RepositoryLocationQuery.java 25 Feb 2009 23:46:08 -0000 1.1 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/RepositoryLocationQuery.java 12 Mar 2009 18:55:02 -0000 >@@ -11,10 +11,11 @@ > > package org.eclipse.equinox.internal.provisional.p2.ui; > >+import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; >+ > 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; > >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/ProvUIProvisioningListener.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/ProvUIProvisioningListener.java,v >retrieving revision 1.1 >diff -u -r1.1 ProvUIProvisioningListener.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/ProvUIProvisioningListener.java 2 Mar 2009 20:08:02 -0000 1.1 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/ProvUIProvisioningListener.java 12 Mar 2009 18:55:00 -0000 >@@ -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 >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableRepositoryManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableRepositoryManager.java,v >retrieving revision 1.3 >diff -u -r1.3 QueryableRepositoryManager.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableRepositoryManager.java 5 Mar 2009 21:31:06 -0000 1.3 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableRepositoryManager.java 12 Mar 2009 18:55:02 -0000 >@@ -10,14 +10,15 @@ > *******************************************************************************/ > package org.eclipse.equinox.internal.provisional.p2.ui; > >+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.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.ui.policy.IUViewQueryContext; > import org.eclipse.osgi.util.NLS; >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableMetadataRepositoryManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableMetadataRepositoryManager.java,v >retrieving revision 1.12 >diff -u -r1.12 QueryableMetadataRepositoryManager.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableMetadataRepositoryManager.java 5 Mar 2009 21:31:06 -0000 1.12 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/QueryableMetadataRepositoryManager.java 12 Mar 2009 18:55:01 -0000 >@@ -19,10 +19,10 @@ > 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; >Index: src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java,v >retrieving revision 1.9 >diff -u -r1.9 ElementUtils.java >--- src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java 2 Mar 2009 20:08:02 -0000 1.9 >+++ src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java 12 Mar 2009 18:54:58 -0000 >@@ -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; >Index: src/org/eclipse/equinox/internal/p2/ui/model/AvailableIUElement.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableIUElement.java,v >retrieving revision 1.22 >diff -u -r1.22 AvailableIUElement.java >--- src/org/eclipse/equinox/internal/p2/ui/model/AvailableIUElement.java 6 Mar 2009 23:14:48 -0000 1.22 >+++ src/org/eclipse/equinox/internal/p2/ui/model/AvailableIUElement.java 12 Mar 2009 18:54:58 -0000 >@@ -15,13 +15,13 @@ > 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; >Index: src/org/eclipse/equinox/internal/p2/ui/model/ArtifactRepositoryElement.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ArtifactRepositoryElement.java,v >retrieving revision 1.13 >diff -u -r1.13 ArtifactRepositoryElement.java >--- src/org/eclipse/equinox/internal/p2/ui/model/ArtifactRepositoryElement.java 26 Feb 2009 22:29:37 -0000 1.13 >+++ src/org/eclipse/equinox/internal/p2/ui/model/ArtifactRepositoryElement.java 12 Mar 2009 18:54:58 -0000 >@@ -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.IProgressMonitor; > import org.eclipse.core.runtime.OperationCanceledException; >@@ -17,7 +19,6 @@ > 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; >Index: src/org/eclipse/equinox/internal/p2/ui/model/MetadataRepositoryElement.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/MetadataRepositoryElement.java,v >retrieving revision 1.8 >diff -u -r1.8 MetadataRepositoryElement.java >--- src/org/eclipse/equinox/internal/p2/ui/model/MetadataRepositoryElement.java 26 Feb 2009 22:29:37 -0000 1.8 >+++ src/org/eclipse/equinox/internal/p2/ui/model/MetadataRepositoryElement.java 12 Mar 2009 18:54:58 -0000 >@@ -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.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; >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/plugin.xml,v >retrieving revision 1.3 >diff -u -r1.3 plugin.xml >--- plugin.xml 10 Feb 2008 22:45:13 -0000 1.3 >+++ plugin.xml 12 Mar 2009 18:54:56 -0000 >@@ -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> >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/AvailableIUGroup.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/AvailableIUGroup.java,v >retrieving revision 1.39 >diff -u -r1.39 AvailableIUGroup.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/AvailableIUGroup.java 6 Mar 2009 23:14:48 -0000 1.39 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/AvailableIUGroup.java 12 Mar 2009 18:55:03 -0000 >@@ -20,9 +20,9 @@ > 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; >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositoryManipulationPage.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositoryManipulationPage.java,v >retrieving revision 1.7 >diff -u -r1.7 RepositoryManipulationPage.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositoryManipulationPage.java 2 Mar 2009 20:06:57 -0000 1.7 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/dialogs/RepositoryManipulationPage.java 12 Mar 2009 18:55:04 -0000 >@@ -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.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.*; >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/operations/AddColocatedRepositoryOperation.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/operations/AddColocatedRepositoryOperation.java,v >retrieving revision 1.7 >diff -u -r1.7 AddColocatedRepositoryOperation.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/operations/AddColocatedRepositoryOperation.java 26 Feb 2009 22:29:37 -0000 1.7 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/operations/AddColocatedRepositoryOperation.java 12 Mar 2009 18:55:05 -0000 >@@ -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 >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/operations/ProvisioningUtil.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/operations/ProvisioningUtil.java,v >retrieving revision 1.24 >diff -u -r1.24 ProvisioningUtil.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/operations/ProvisioningUtil.java 6 Mar 2009 23:14:48 -0000 1.24 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/operations/ProvisioningUtil.java 12 Mar 2009 18:55:05 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/StructuredViewerProvisioningListener.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/StructuredViewerProvisioningListener.java,v >retrieving revision 1.12 >diff -u -r1.12 StructuredViewerProvisioningListener.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/StructuredViewerProvisioningListener.java 2 Mar 2009 20:08:02 -0000 1.12 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/StructuredViewerProvisioningListener.java 12 Mar 2009 18:55:06 -0000 >@@ -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; >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/ProvElementLabelProvider.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/ProvElementLabelProvider.java,v >retrieving revision 1.9 >diff -u -r1.9 ProvElementLabelProvider.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/ProvElementLabelProvider.java 30 Dec 2008 15:57:39 -0000 1.9 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/viewers/ProvElementLabelProvider.java 12 Mar 2009 18:55:06 -0000 >@@ -11,11 +11,12 @@ > > package org.eclipse.equinox.internal.provisional.p2.ui.viewers; > >+import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; >+ > 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; >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/policy/IUViewQueryContext.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/policy/IUViewQueryContext.java,v >retrieving revision 1.5 >diff -u -r1.5 IUViewQueryContext.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/policy/IUViewQueryContext.java 11 Mar 2009 20:52:14 -0000 1.5 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/policy/IUViewQueryContext.java 12 Mar 2009 18:55:05 -0000 >@@ -10,7 +10,8 @@ > *******************************************************************************/ > package org.eclipse.equinox.internal.provisional.p2.ui.policy; > >-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.IInstallableUnit; > > /** >Index: src/org/eclipse/equinox/internal/p2/ui/UIRepositoryEvent.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/UIRepositoryEvent.java,v >retrieving revision 1.1 >diff -u -r1.1 UIRepositoryEvent.java >--- src/org/eclipse/equinox/internal/p2/ui/UIRepositoryEvent.java 14 Oct 2008 21:56:29 -0000 1.1 >+++ src/org/eclipse/equinox/internal/p2/ui/UIRepositoryEvent.java 12 Mar 2009 18:54:56 -0000 >@@ -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 >Index: src/org/eclipse/equinox/internal/p2/ui/ProvUIAdapterFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIAdapterFactory.java,v >retrieving revision 1.4 >diff -u -r1.4 ProvUIAdapterFactory.java >--- src/org/eclipse/equinox/internal/p2/ui/ProvUIAdapterFactory.java 11 Feb 2008 05:53:07 -0000 1.4 >+++ src/org/eclipse/equinox/internal/p2/ui/ProvUIAdapterFactory.java 12 Mar 2009 18:54:56 -0000 >@@ -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; >Index: src/org/eclipse/equinox/internal/p2/ui/DefaultMetadataURLValidator.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/DefaultMetadataURLValidator.java,v >retrieving revision 1.4 >diff -u -r1.4 DefaultMetadataURLValidator.java >--- src/org/eclipse/equinox/internal/p2/ui/DefaultMetadataURLValidator.java 24 Jan 2009 22:47:41 -0000 1.4 >+++ src/org/eclipse/equinox/internal/p2/ui/DefaultMetadataURLValidator.java 12 Mar 2009 18:54:56 -0000 >@@ -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; > >Index: src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java,v >retrieving revision 1.21 >diff -u -r1.21 AvailableIUsPage.java >--- src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java 11 Mar 2009 23:21:22 -0000 1.21 >+++ src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUsPage.java 12 Mar 2009 18:54:57 -0000 >@@ -18,10 +18,10 @@ > import org.eclipse.equinox.internal.p2.ui.*; > 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.engine.ProvisioningContext; > 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.*; > import org.eclipse.equinox.internal.provisional.p2.ui.dialogs.AddRepositoryDialog; > import org.eclipse.equinox.internal.provisional.p2.ui.dialogs.AvailableIUGroup; >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/model/IRepositoryElement.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/model/IRepositoryElement.java,v >retrieving revision 1.2 >diff -u -r1.2 IRepositoryElement.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/model/IRepositoryElement.java 9 Oct 2008 03:22:14 -0000 1.2 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/model/IRepositoryElement.java 12 Mar 2009 18:55:05 -0000 >@@ -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. >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.34 >diff -u -r1.34 MANIFEST.MF >--- META-INF/MANIFEST.MF 26 Feb 2009 23:37:11 -0000 1.34 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:54:56 -0000 >@@ -16,7 +16,7 @@ > 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 @@ > 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", >Index: src/org/eclipse/equinox/internal/p2/ui/viewers/RepositoryDetailsLabelProvider.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/RepositoryDetailsLabelProvider.java,v >retrieving revision 1.3 >diff -u -r1.3 RepositoryDetailsLabelProvider.java >--- src/org/eclipse/equinox/internal/p2/ui/viewers/RepositoryDetailsLabelProvider.java 26 Feb 2009 00:06:57 -0000 1.3 >+++ src/org/eclipse/equinox/internal/p2/ui/viewers/RepositoryDetailsLabelProvider.java 12 Mar 2009 18:54:59 -0000 >@@ -11,11 +11,12 @@ > > package org.eclipse.equinox.internal.p2.ui.viewers; > >+import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; >+ > 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.ui.ProvUIImages; > import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement; >#P org.eclipse.equinox.p2.tests.ui >Index: src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java,v >retrieving revision 1.2 >diff -u -r1.2 AbstractQueryTest.java >--- src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java 15 Jan 2009 02:21:02 -0000 1.2 >+++ src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java 12 Mar 2009 18:55:09 -0000 >@@ -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; >Index: src/org/eclipse/equinox/p2/tests/ui/operations/ProvisioningUtilTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/operations/ProvisioningUtilTest.java,v >retrieving revision 1.1 >diff -u -r1.1 ProvisioningUtilTest.java >--- src/org/eclipse/equinox/p2/tests/ui/operations/ProvisioningUtilTest.java 31 Jan 2009 18:17:58 -0000 1.1 >+++ src/org/eclipse/equinox/p2/tests/ui/operations/ProvisioningUtilTest.java 12 Mar 2009 18:55:09 -0000 >@@ -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; > >Index: src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java,v >retrieving revision 1.11 >diff -u -r1.11 AbstractProvisioningUITest.java >--- src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java 6 Mar 2009 23:14:51 -0000 1.11 >+++ src/org/eclipse/equinox/p2/tests/ui/AbstractProvisioningUITest.java 12 Mar 2009 18:55:09 -0000 >@@ -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.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.*; >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.3 >diff -u -r1.3 MANIFEST.MF >--- META-INF/MANIFEST.MF 26 Sep 2008 21:13:51 -0000 1.3 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:55:08 -0000 >@@ -17,4 +17,5 @@ > 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" >#P org.eclipse.equinox.p2.installer >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.installer/META-INF/MANIFEST.MF,v >retrieving revision 1.10 >diff -u -r1.10 MANIFEST.MF >--- META-INF/MANIFEST.MF 10 Jul 2008 18:45:28 -0000 1.10 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:55:12 -0000 >@@ -17,7 +17,8 @@ > 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, >#P org.eclipse.equinox.p2.engine >Index: src/org/eclipse/equinox/internal/provisional/p2/engine/phases/Sizing.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/provisional/p2/engine/phases/Sizing.java,v >retrieving revision 1.12 >diff -u -r1.12 Sizing.java >--- src/org/eclipse/equinox/internal/provisional/p2/engine/phases/Sizing.java 14 Jan 2009 06:34:08 -0000 1.12 >+++ src/org/eclipse/equinox/internal/provisional/p2/engine/phases/Sizing.java 12 Mar 2009 18:55:17 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java,v >retrieving revision 1.5 >diff -u -r1.5 ProfileMetadataRepository.java >--- src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java 9 Mar 2009 17:25:16 -0000 1.5 >+++ src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java 12 Mar 2009 18:55:17 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepositoryFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepositoryFactory.java,v >retrieving revision 1.3 >diff -u -r1.3 ProfileMetadataRepositoryFactory.java >--- src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepositoryFactory.java 4 Mar 2009 21:52:47 -0000 1.3 >+++ src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepositoryFactory.java 12 Mar 2009 18:55:17 -0000 >@@ -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; > >Index: src/org/eclipse/equinox/internal/p2/engine/MetadataCache.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Attic/MetadataCache.java,v >retrieving revision 1.10 >diff -u -r1.10 MetadataCache.java >--- src/org/eclipse/equinox/internal/p2/engine/MetadataCache.java 26 Feb 2009 21:56:39 -0000 1.10 >+++ src/org/eclipse/equinox/internal/p2/engine/MetadataCache.java 12 Mar 2009 18:55:16 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.equinox.internal.p2.engine; > >+import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; >+ > import java.net.URI; > import java.util.*; > import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; >@@ -18,7 +20,6 @@ > 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.location.AgentLocation; >-import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; > 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.repository.IMetadataRepository; >Index: src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java,v >retrieving revision 1.10 >diff -u -r1.10 DownloadManager.java >--- src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java 20 Jan 2009 21:46:19 -0000 1.10 >+++ src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java 12 Mar 2009 18:55:16 -0000 >@@ -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 { >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF,v >retrieving revision 1.29 >diff -u -r1.29 MANIFEST.MF >--- META-INF/MANIFEST.MF 3 Mar 2009 22:29:26 -0000 1.29 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:55:16 -0000 >@@ -36,13 +36,13 @@ > 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", >#P org.eclipse.equinox.p2.reconciler.dropins >Index: src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java,v >retrieving revision 1.45 >diff -u -r1.45 ProfileSynchronizer.java >--- src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java 7 Mar 2009 16:06:56 -0000 1.45 >+++ src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java 12 Mar 2009 18:55:23 -0000 >@@ -21,13 +21,13 @@ > 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; >Index: src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java,v >retrieving revision 1.17 >diff -u -r1.17 DropinsRepositoryListener.java >--- src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java 9 Oct 2008 03:22:09 -0000 1.17 >+++ src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java 12 Mar 2009 18:55:21 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java,v >retrieving revision 1.29 >diff -u -r1.29 PlatformXmlListener.java >--- src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java 12 Dec 2008 19:57:32 -0000 1.29 >+++ src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java 12 Mar 2009 18:55:21 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.equinox.internal.p2.reconciler.dropins; > >+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 org.eclipse.equinox.internal.p2.update.*; > 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.directorywatcher.DirectoryChangeListener; > import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; > import org.eclipse.osgi.util.NLS; >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF,v >retrieving revision 1.26 >diff -u -r1.26 MANIFEST.MF >--- META-INF/MANIFEST.MF 18 Nov 2008 15:29:32 -0000 1.26 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:55:21 -0000 >@@ -9,15 +9,15 @@ > 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 @@ > 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", >#P org.eclipse.equinox.p2.tests >Index: src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java,v >retrieving revision 1.28 >diff -u -r1.28 UpdateSiteTest.java >--- src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java 27 Feb 2009 16:05:07 -0000 1.28 >+++ src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java 12 Mar 2009 18:55:40 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java,v >retrieving revision 1.4 >diff -u -r1.4 SiteXMLActionTest.java >--- src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java 6 Mar 2009 16:44:21 -0000 1.4 >+++ src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java 12 Mar 2009 18:55:39 -0000 >@@ -17,11 +17,11 @@ > 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; >Index: src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java,v >retrieving revision 1.15 >diff -u -r1.15 ArtifactRepositoryManagerTest.java >--- src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java 20 Feb 2009 22:44:00 -0000 1.15 >+++ src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryManagerTest.java 12 Mar 2009 18:55:26 -0000 >@@ -22,7 +22,7 @@ > 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; >Index: src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java,v >retrieving revision 1.12 >diff -u -r1.12 CompositeArtifactRepositoryTest.java >--- src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java 13 Feb 2009 23:14:18 -0000 1.12 >+++ src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java 12 Mar 2009 18:55:29 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java,v >retrieving revision 1.19 >diff -u -r1.19 SimpleArtifactRepositoryTest.java >--- src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java 18 Feb 2009 23:13:49 -0000 1.19 >+++ src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java 12 Mar 2009 18:55:29 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java,v >retrieving revision 1.7 >diff -u -r1.7 TransferTest.java >--- src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java 13 Feb 2009 01:25:20 -0000 1.7 >+++ src/org/eclipse/equinox/p2/tests/artifact/repository/TransferTest.java 12 Mar 2009 18:55:29 -0000 >@@ -13,7 +13,7 @@ > 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 @@ > } 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; >Index: src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java,v >retrieving revision 1.13 >diff -u -r1.13 ArtifactOutputStreamTest.java >--- src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java 30 Dec 2008 15:58:14 -0000 1.13 >+++ src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java 12 Mar 2009 18:55:26 -0000 >@@ -17,10 +17,12 @@ > 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 { >Index: src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java,v >retrieving revision 1.30 >diff -u -r1.30 MetadataRepositoryManagerTest.java >--- src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java 4 Mar 2009 02:20:12 -0000 1.30 >+++ src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java 12 Mar 2009 18:55:34 -0000 >@@ -25,11 +25,11 @@ > 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.*; >Index: src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java,v >retrieving revision 1.11 >diff -u -r1.11 CompositeMetadataRepositoryTest.java >--- src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java 13 Feb 2009 23:14:18 -0000 1.11 >+++ src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java 12 Mar 2009 18:55:33 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java,v >retrieving revision 1.4 >diff -u -r1.4 SPIMetadataRepositoryTest.java >--- src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java 12 Feb 2009 22:33:02 -0000 1.4 >+++ src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java 12 Mar 2009 18:55:35 -0000 >@@ -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 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; >Index: src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java,v >retrieving revision 1.19 >diff -u -r1.19 LocalMetadataRepositoryTest.java >--- src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java 12 Feb 2009 22:22:39 -0000 1.19 >+++ src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java 12 Mar 2009 18:55:33 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java,v >retrieving revision 1.22 >diff -u -r1.22 JarURLRepositoryTest.java >--- src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java 30 Dec 2008 15:58:14 -0000 1.22 >+++ src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java 12 Mar 2009 18:55:33 -0000 >@@ -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 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; >Index: src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java,v >retrieving revision 1.11 >diff -u -r1.11 TestArtifactRepository.java >--- src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java 19 Dec 2008 14:48:03 -0000 1.11 >+++ src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java 12 Mar 2009 18:55:26 -0000 >@@ -17,11 +17,11 @@ > 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 @@ > 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 @@ > } > return Status.OK_STATUS; > } >+ >+ public IStatus download(URI toDownload, OutputStream target, IProgressMonitor pm) { >+ return download(toDownload.toString(), target, pm); >+ } > }; > > public TestArtifactRepository() { >Index: src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java,v >retrieving revision 1.17 >diff -u -r1.17 TestMetadataRepository.java >--- src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java 12 Feb 2009 22:22:39 -0000 1.17 >+++ src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java 12 Mar 2009 18:55:26 -0000 >@@ -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; >Index: src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java,v >retrieving revision 1.86 >diff -u -r1.86 AbstractProvisioningTest.java >--- src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java 6 Mar 2009 06:20:56 -0000 1.86 >+++ src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java 12 Mar 2009 18:55:26 -0000 >@@ -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.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.*; >Index: src/org/eclipse/equinox/p2/tests/TestRepositoryListener.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestRepositoryListener.java,v >retrieving revision 1.3 >diff -u -r1.3 TestRepositoryListener.java >--- src/org/eclipse/equinox/p2/tests/TestRepositoryListener.java 20 Oct 2008 19:27:21 -0000 1.3 >+++ src/org/eclipse/equinox/p2/tests/TestRepositoryListener.java 12 Mar 2009 18:55:26 -0000 >@@ -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, >Index: src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java,v >retrieving revision 1.24 >diff -u -r1.24 ArtifactMirrorApplicationTest.java >--- src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java 22 Dec 2008 15:30:44 -0000 1.24 >+++ src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java 12 Mar 2009 18:55:37 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java,v >retrieving revision 1.13 >diff -u -r1.13 MetadataMirrorApplicationTest.java >--- src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java 8 Dec 2008 18:19:32 -0000 1.13 >+++ src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java 12 Mar 2009 18:55:38 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/p2/tests/director/DirectorAppTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/DirectorAppTest.java,v >retrieving revision 1.5 >diff -u -r1.5 DirectorAppTest.java >--- src/org/eclipse/equinox/p2/tests/director/DirectorAppTest.java 21 Feb 2009 03:30:28 -0000 1.5 >+++ src/org/eclipse/equinox/p2/tests/director/DirectorAppTest.java 12 Mar 2009 18:55:30 -0000 >@@ -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.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.*; >Index: src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java,v >retrieving revision 1.9 >diff -u -r1.9 ExtensionLocationMetadataRepositoryFactoryTest.java >--- src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java 5 Mar 2009 18:58:26 -0000 1.9 >+++ src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java 12 Mar 2009 18:55:32 -0000 >@@ -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; >Index: src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java,v >retrieving revision 1.9 >diff -u -r1.9 ExtensionLocationArtifactRepositoryFactoryTest.java >--- src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java 5 Mar 2009 18:58:26 -0000 1.9 >+++ src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java 12 Mar 2009 18:55:30 -0000 >@@ -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.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; > >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF,v >retrieving revision 1.58 >diff -u -r1.58 MANIFEST.MF >--- META-INF/MANIFEST.MF 28 Jan 2009 22:32:04 -0000 1.58 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:55:24 -0000 >@@ -5,7 +5,7 @@ > 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 @@ > 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 @@ > 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 @@ > 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 >Index: src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveRepositoryActionTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveRepositoryActionTest.java,v >retrieving revision 1.1 >diff -u -r1.1 RemoveRepositoryActionTest.java >--- src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveRepositoryActionTest.java 6 Nov 2008 22:00:40 -0000 1.1 >+++ src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveRepositoryActionTest.java 12 Mar 2009 18:55:39 -0000 >@@ -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; > > /** >Index: src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java,v >retrieving revision 1.13 >diff -u -r1.13 AddRepositoryActionTest.java >--- src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java 4 Mar 2009 04:09:08 -0000 1.13 >+++ src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java 12 Mar 2009 18:55:39 -0000 >@@ -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.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; >Index: All p2 Tests.launch >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/All p2 Tests.launch,v >retrieving revision 1.8 >diff -u -r1.8 All p2 Tests.launch >--- All p2 Tests.launch 18 Feb 2009 17:07:11 -0000 1.8 >+++ All p2 Tests.launch 12 Mar 2009 18:55:24 -0000 >@@ -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> >Index: src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java,v >retrieving revision 1.2 >diff -u -r1.2 TestArtifactRepository.java >--- src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java 9 Oct 2008 03:22:37 -0000 1.2 >+++ src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java 12 Mar 2009 18:55:39 -0000 >@@ -21,6 +21,7 @@ > 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; > >Index: src/org/eclipse/equinox/p2/tests/artifact/repository/TransferExceptionsTest.java >=================================================================== >RCS file: src/org/eclipse/equinox/p2/tests/artifact/repository/TransferExceptionsTest.java >diff -N src/org/eclipse/equinox/p2/tests/artifact/repository/TransferExceptionsTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/equinox/p2/tests/artifact/repository/TransferExceptionsTest.java 1 Jan 1970 00:00:00 -0000 >@@ -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"); >+ >+ } >+ >+} >Index: src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerExceptionsTest.java >=================================================================== >RCS file: src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerExceptionsTest.java >diff -N src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerExceptionsTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerExceptionsTest.java 1 Jan 1970 00:00:00 -0000 >@@ -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()); >+ } >+ } >+ >+} >#P org.eclipse.equinox.p2.ui.sdk >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.sdk/META-INF/MANIFEST.MF,v >retrieving revision 1.30 >diff -u -r1.30 MANIFEST.MF >--- META-INF/MANIFEST.MF 13 Nov 2008 21:11:20 -0000 1.30 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:55:46 -0000 >@@ -11,7 +11,7 @@ > 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, >Index: src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java,v >retrieving revision 1.32 >diff -u -r1.32 ProvSDKUIActivator.java >--- src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java 11 Mar 2009 20:52:11 -0000 1.32 >+++ src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java 12 Mar 2009 18:55:46 -0000 >@@ -10,13 +10,14 @@ > *******************************************************************************/ > package org.eclipse.equinox.internal.p2.ui.sdk; > >+import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; >+ > import java.io.*; > import org.eclipse.core.runtime.*; > 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.director.ProvisioningPlan; > import org.eclipse.equinox.internal.provisional.p2.engine.IProfile; > import org.eclipse.equinox.internal.provisional.p2.engine.IProfileRegistry; >#P org.eclipse.equinox.p2.repository.tools >Index: src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java,v >retrieving revision 1.1 >diff -u -r1.1 RecreateRepositoryApplication.java >--- src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java 21 Feb 2009 00:08:39 -0000 1.1 >+++ src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java 12 Mar 2009 18:55:49 -0000 >@@ -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.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; > >Index: src/org/eclipse/equinox/p2/internal/repository/tools/RepositoryDescriptor.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RepositoryDescriptor.java,v >retrieving revision 1.2 >diff -u -r1.2 RepositoryDescriptor.java >--- src/org/eclipse/equinox/p2/internal/repository/tools/RepositoryDescriptor.java 17 Feb 2009 21:02:59 -0000 1.2 >+++ src/org/eclipse/equinox/p2/internal/repository/tools/RepositoryDescriptor.java 12 Mar 2009 18:55:49 -0000 >@@ -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 { > >Index: src/org/eclipse/equinox/p2/internal/repository/tools/AbstractApplication.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/AbstractApplication.java,v >retrieving revision 1.5 >diff -u -r1.5 AbstractApplication.java >--- src/org/eclipse/equinox/p2/internal/repository/tools/AbstractApplication.java 3 Mar 2009 00:13:54 -0000 1.5 >+++ src/org/eclipse/equinox/p2/internal/repository/tools/AbstractApplication.java 12 Mar 2009 18:55:49 -0000 >@@ -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.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; > >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository.tools/META-INF/MANIFEST.MF,v >retrieving revision 1.7 >diff -u -r1.7 MANIFEST.MF >--- META-INF/MANIFEST.MF 21 Feb 2009 00:08:39 -0000 1.7 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:55:47 -0000 >@@ -19,7 +19,7 @@ > 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, >#P org.eclipse.equinox.p2.metadata.repository >Index: src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java,v >retrieving revision 1.7 >diff -u -r1.7 CompositeMetadataRepositoryFactory.java >--- src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java 2 Mar 2009 19:08:03 -0000 1.7 >+++ src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java 12 Mar 2009 18:55:52 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/internal/p2/metadata/repository/Messages.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/Messages.java,v >retrieving revision 1.10 >diff -u -r1.10 Messages.java >--- src/org/eclipse/equinox/internal/p2/metadata/repository/Messages.java 9 Jan 2009 20:34:26 -0000 1.10 >+++ src/org/eclipse/equinox/internal/p2/metadata/repository/Messages.java 12 Mar 2009 18:55:53 -0000 >@@ -22,6 +22,9 @@ > // 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 ecf_configuration_error; > >Index: src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java,v >retrieving revision 1.11 >diff -u -r1.11 CompositeMetadataRepository.java >--- src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java 2 Mar 2009 19:08:03 -0000 1.11 >+++ src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java 12 Mar 2009 18:55:52 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java,v >retrieving revision 1.57 >diff -u -r1.57 MetadataRepositoryManager.java >--- src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java 18 Feb 2009 23:13:46 -0000 1.57 >+++ src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java 12 Mar 2009 18:55:53 -0000 >@@ -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.*; >Index: src/org/eclipse/equinox/internal/p2/metadata/repository/messages.properties >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/messages.properties,v >retrieving revision 1.10 >diff -u -r1.10 messages.properties >--- src/org/eclipse/equinox/internal/p2/metadata/repository/messages.properties 9 Jan 2009 20:34:26 -0000 1.10 >+++ src/org/eclipse/equinox/internal/p2/metadata/repository/messages.properties 12 Mar 2009 18:55:53 -0000 >@@ -1,3 +1,5 @@ >+CacheManager_FailedCommunicationWithRepo_0=Failed to communicate with repository: {0} >+CacheManager_Neither_0_nor_1_found=Neither: {0} nor: {0} available > ############################################################################### > # Copyright (c) 2007, 2008 IBM Corporation and others. > # All rights reserved. This program and the accompanying materials >@@ -9,6 +11,7 @@ > # IBM Corporation - initial API and implementation > ############################################################################### > >+CacheManager_AuthenticationFaileFor_0=Authentication failed for: {0} > io_failedRead=Unable to read repository at {0} > io_IncompatibleVersion=\ > Metadata repository has incompatible version {0}; expected {1} >Index: src/org/eclipse/equinox/internal/p2/metadata/repository/ECFMetadataTransport.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/ECFMetadataTransport.java,v >retrieving revision 1.18 >diff -u -r1.18 ECFMetadataTransport.java >--- src/org/eclipse/equinox/internal/p2/metadata/repository/ECFMetadataTransport.java 28 Feb 2009 20:38:37 -0000 1.18 >+++ src/org/eclipse/equinox/internal/p2/metadata/repository/ECFMetadataTransport.java 12 Mar 2009 18:55:52 -0000 >@@ -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 > } >Index: src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java,v >retrieving revision 1.7 >diff -u -r1.7 CacheManager.java >--- src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java 11 Mar 2009 21:34:59 -0000 1.7 >+++ src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java 12 Mar 2009 18:55:52 -0000 >@@ -15,13 +15,17 @@ > 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 @@ > 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 @@ > * @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 (monitor != null) >+ monitor.done(); > } >- if (!result.isOK()) { >- //don't leave a partial cache file lying around >- cacheFile.delete(); >- throw new ProvisionException(result); >- } >- return cacheFile; > } > > /** >@@ -171,43 +206,8 @@ > 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(); > } > > /** >Index: src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java,v >retrieving revision 1.35 >diff -u -r1.35 LocalMetadataRepository.java >--- src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java 19 Feb 2009 16:24:05 -0000 1.35 >+++ src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java 12 Mar 2009 18:55:53 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/internal/p2/metadata/mirror/MirrorApplication.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/mirror/MirrorApplication.java,v >retrieving revision 1.14 >diff -u -r1.14 MirrorApplication.java >--- src/org/eclipse/equinox/internal/p2/metadata/mirror/MirrorApplication.java 18 Feb 2009 23:45:36 -0000 1.14 >+++ src/org/eclipse/equinox/internal/p2/metadata/mirror/MirrorApplication.java 12 Mar 2009 18:55:52 -0000 >@@ -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.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; > >Index: src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java,v >retrieving revision 1.20 >diff -u -r1.20 IMetadataRepositoryManager.java >--- src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java 19 Feb 2009 16:31:09 -0000 1.20 >+++ src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java 12 Mar 2009 18:55:53 -0000 >@@ -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; > > /** >Index: src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java,v >retrieving revision 1.5 >diff -u -r1.5 IMetadataRepository.java >--- src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java 12 Feb 2009 22:22:42 -0000 1.5 >+++ src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepository.java 12 Mar 2009 18:55:53 -0000 >@@ -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; >Index: src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/MetadataRepositoryFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/MetadataRepositoryFactory.java,v >retrieving revision 1.3 >diff -u -r1.3 MetadataRepositoryFactory.java >--- src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/MetadataRepositoryFactory.java 18 Feb 2009 23:13:46 -0000 1.3 >+++ src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/MetadataRepositoryFactory.java 12 Mar 2009 18:55:53 -0000 >@@ -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; > > /** >Index: src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java,v >retrieving revision 1.11 >diff -u -r1.11 AbstractMetadataRepository.java >--- src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java 12 Feb 2009 22:22:42 -0000 1.11 >+++ src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java 12 Mar 2009 18:55:53 -0000 >@@ -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.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. >Index: src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/SimpleMetadataRepositoryFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/SimpleMetadataRepositoryFactory.java,v >retrieving revision 1.11 >diff -u -r1.11 SimpleMetadataRepositoryFactory.java >--- src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/SimpleMetadataRepositoryFactory.java 18 Feb 2009 23:13:46 -0000 1.11 >+++ src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/SimpleMetadataRepositoryFactory.java 12 Mar 2009 18:55:54 -0000 >@@ -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.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 @@ > 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)); > } >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/plugin.properties,v >retrieving revision 1.3 >diff -u -r1.3 plugin.properties >--- plugin.properties 4 Mar 2009 18:26:58 -0000 1.3 >+++ plugin.properties 12 Mar 2009 18:55:51 -0000 >@@ -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 >Index: src_ant/org/eclipse/equinox/internal/p2/metadata/repository/ant/CreateCompositeMetadataRepositoryTask.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/src_ant/org/eclipse/equinox/internal/p2/metadata/repository/ant/CreateCompositeMetadataRepositoryTask.java,v >retrieving revision 1.4 >diff -u -r1.4 CreateCompositeMetadataRepositoryTask.java >--- src_ant/org/eclipse/equinox/internal/p2/metadata/repository/ant/CreateCompositeMetadataRepositoryTask.java 19 Jan 2009 19:57:55 -0000 1.4 >+++ src_ant/org/eclipse/equinox/internal/p2/metadata/repository/ant/CreateCompositeMetadataRepositoryTask.java 12 Mar 2009 18:55:54 -0000 >@@ -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.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; > >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF,v >retrieving revision 1.35 >diff -u -r1.35 MANIFEST.MF >--- META-INF/MANIFEST.MF 19 Feb 2009 16:24:05 -0000 1.35 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:55:51 -0000 >@@ -39,14 +39,16 @@ > 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", >#P org.eclipse.equinox.p2.publisher >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.publisher/META-INF/MANIFEST.MF,v >retrieving revision 1.14 >diff -u -r1.14 MANIFEST.MF >--- META-INF/MANIFEST.MF 17 Feb 2009 18:19:06 -0000 1.14 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:55:55 -0000 >@@ -20,7 +20,7 @@ > 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, >Index: src/org/eclipse/equinox/p2/publisher/Publisher.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java,v >retrieving revision 1.8 >diff -u -r1.8 Publisher.java >--- src/org/eclipse/equinox/p2/publisher/Publisher.java 18 Feb 2009 23:30:02 -0000 1.8 >+++ src/org/eclipse/equinox/p2/publisher/Publisher.java 12 Mar 2009 18:55:55 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java,v >retrieving revision 1.36 >diff -u -r1.36 FeaturesAction.java >--- src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java 3 Mar 2009 20:23:46 -0000 1.36 >+++ src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java 12 Mar 2009 18:55:56 -0000 >@@ -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; >@@ -25,7 +27,6 @@ > 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; >#P org.eclipse.equinox.p2.updatesite >Index: src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java,v >retrieving revision 1.29 >diff -u -r1.29 UpdateSite.java >--- src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java 12 Dec 2008 21:34:45 -0000 1.29 >+++ src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java 12 Mar 2009 18:55:59 -0000 >@@ -16,8 +16,11 @@ > 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; >@@ -121,48 +124,66 @@ > * 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)); >+ } >+ 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)); > } > > /* >@@ -183,7 +204,7 @@ > 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); > if (transferResult.isOK()) > break; > } >@@ -203,15 +224,22 @@ > 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 +397,7 @@ > } 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); > if (result.getSeverity() == IStatus.CANCEL || monitor.isCanceled()) > throw new OperationCanceledException(); > if (!result.isOK()) >@@ -476,7 +504,7 @@ > } > } > >- private static ECFTransport getTransport() { >- return ECFTransport.getInstance(); >+ private static RepositoryTransport getTransport() { >+ return RepositoryTransport.getInstance(); > } > } >Index: src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java,v >retrieving revision 1.17 >diff -u -r1.17 SiteXMLAction.java >--- src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java 4 Mar 2009 13:47:32 -0000 1.17 >+++ src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java 12 Mar 2009 18:55:59 -0000 >@@ -10,6 +10,8 @@ > ******************************************************************************/ > package org.eclipse.equinox.internal.p2.updatesite; > >+import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; >+ > import java.io.File; > import java.net.URI; > import java.net.URISyntaxException; >@@ -17,7 +19,6 @@ > 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; >Index: src/org/eclipse/equinox/internal/p2/updatesite/ECFTransport.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/ECFTransport.java,v >retrieving revision 1.11 >diff -u -r1.11 ECFTransport.java >--- src/org/eclipse/equinox/internal/p2/updatesite/ECFTransport.java 28 Feb 2009 20:38:36 -0000 1.11 >+++ src/org/eclipse/equinox/internal/p2/updatesite/ECFTransport.java 12 Mar 2009 18:55:58 -0000 >@@ -11,415 +11,12 @@ > *******************************************************************************/ > 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; >+import org.eclipse.equinox.internal.p2.repository.RepositoryTransport; > > /** >- * A transport implementation that uses ECF file transfer API. >+ * TODO: Remove this class it is not used. >+ * @deprecated Please use {@link RepositoryTransport} instead. > */ > 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$ >- } >- } >- } >+ // TO BE REMOVED > } >Index: src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java,v >retrieving revision 1.13 >diff -u -r1.13 UpdateSiteArtifactRepositoryFactory.java >--- src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java 18 Feb 2009 23:13:44 -0000 1.13 >+++ src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java 12 Mar 2009 18:55:59 -0000 >@@ -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.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; >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.updatesite/META-INF/MANIFEST.MF,v >retrieving revision 1.18 >diff -u -r1.18 MANIFEST.MF >--- META-INF/MANIFEST.MF 11 Feb 2009 18:45:51 -0000 1.18 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:55:58 -0000 >@@ -12,17 +12,19 @@ > 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, >Index: src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java,v >retrieving revision 1.18 >diff -u -r1.18 UpdateSiteMetadataRepositoryFactory.java >--- src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java 4 Mar 2009 13:47:32 -0000 1.18 >+++ src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java 12 Mar 2009 18:55:59 -0000 >@@ -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 @@ > 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; > } >Index: src/org/eclipse/equinox/internal/p2/updatesite/metadata/messages.properties >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/updatesite/metadata/messages.properties >diff -N src/org/eclipse/equinox/internal/p2/updatesite/metadata/messages.properties >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/equinox/internal/p2/updatesite/metadata/messages.properties 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2 @@ >+UpdateSiteMetadataRepositoryFactory.AuthenticationFailedFor_0=Authentication failed {0} >+UpdateSiteMetadataRepositoryFactory.RepositoryNotFound_0=Repository not found {0} >Index: src/org/eclipse/equinox/internal/p2/updatesite/metadata/Messages.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/updatesite/metadata/Messages.java >diff -N src/org/eclipse/equinox/internal/p2/updatesite/metadata/Messages.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/equinox/internal/p2/updatesite/metadata/Messages.java 1 Jan 1970 00:00:00 -0000 >@@ -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 + '!'; >+ } >+ } >+} >#P org.eclipse.equinox.p2.director >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF,v >retrieving revision 1.27 >diff -u -r1.27 MANIFEST.MF >--- META-INF/MANIFEST.MF 2 Mar 2009 18:12:26 -0000 1.27 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:04 -0000 >@@ -9,7 +9,7 @@ > 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, >Index: src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java,v >retrieving revision 1.75 >diff -u -r1.75 SimplePlanner.java >--- src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java 9 Mar 2009 21:49:08 -0000 1.75 >+++ src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java 12 Mar 2009 18:56:04 -0000 >@@ -17,7 +17,6 @@ > 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.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; >#P org.eclipse.equinox.p2.metadata.generator >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.generator/META-INF/MANIFEST.MF,v >retrieving revision 1.23 >diff -u -r1.23 MANIFEST.MF >--- META-INF/MANIFEST.MF 18 Nov 2008 15:29:29 -0000 1.23 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:09 -0000 >@@ -18,6 +18,7 @@ > 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, >Index: src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java,v >retrieving revision 1.46 >diff -u -r1.46 EclipseGeneratorApplication.java >--- src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java 14 Nov 2008 22:01:43 -0000 1.46 >+++ src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java 12 Mar 2009 18:56:10 -0000 >@@ -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.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; >Index: src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java,v >retrieving revision 1.81 >diff -u -r1.81 Generator.java >--- src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java 9 Mar 2009 15:45:17 -0000 1.81 >+++ src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java 12 Mar 2009 18:56:12 -0000 >@@ -25,7 +25,6 @@ > 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.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; >#P org.eclipse.equinox.p2.selfhosting >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.selfhosting/META-INF/MANIFEST.MF,v >retrieving revision 1.15 >diff -u -r1.15 MANIFEST.MF >--- META-INF/MANIFEST.MF 7 Nov 2008 19:30:13 -0000 1.15 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:14 -0000 >@@ -24,7 +24,7 @@ > org.eclipse.equinox.internal.provisional.frameworkadmin, > 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, >#P org.eclipse.equinox.p2.tests.optimizers >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tests.optimizers/META-INF/MANIFEST.MF,v >retrieving revision 1.3 >diff -u -r1.3 MANIFEST.MF >--- META-INF/MANIFEST.MF 21 Oct 2008 00:20:32 -0000 1.3 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:16 -0000 >@@ -24,6 +24,7 @@ > 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 >#P org.eclipse.equinox.p2.directorywatcher >Index: src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java,v >retrieving revision 1.35 >diff -u -r1.35 RepositoryListener.java >--- src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java 15 Jan 2009 02:21:14 -0000 1.35 >+++ src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java 12 Mar 2009 18:56:17 -0000 >@@ -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.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; >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF,v >retrieving revision 1.25 >diff -u -r1.25 MANIFEST.MF >--- META-INF/MANIFEST.MF 9 Oct 2008 12:18:23 -0000 1.25 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:17 -0000 >@@ -11,7 +11,7 @@ > 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, >#P org.eclipse.equinox.p2.director.app >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF,v >retrieving revision 1.16 >diff -u -r1.16 MANIFEST.MF >--- META-INF/MANIFEST.MF 5 Dec 2008 22:41:59 -0000 1.16 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:18 -0000 >@@ -12,7 +12,7 @@ > 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, >#P org.eclipse.equinox.p2.ui.admin >Index: src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java,v >retrieving revision 1.13 >diff -u -r1.13 ProvAdminUIActivator.java >--- src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java 13 Nov 2008 23:48:41 -0000 1.13 >+++ src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java 12 Mar 2009 18:56:19 -0000 >@@ -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; >Index: src/org/eclipse/equinox/internal/p2/ui/admin/AddMetadataRepositoryOperation.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddMetadataRepositoryOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 AddMetadataRepositoryOperation.java >--- src/org/eclipse/equinox/internal/p2/ui/admin/AddMetadataRepositoryOperation.java 26 Feb 2009 22:29:32 -0000 1.2 >+++ src/org/eclipse/equinox/internal/p2/ui/admin/AddMetadataRepositoryOperation.java 12 Mar 2009 18:56:19 -0000 >@@ -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; > >Index: src/org/eclipse/equinox/internal/p2/ui/admin/AddArtifactRepositoryOperation.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddArtifactRepositoryOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 AddArtifactRepositoryOperation.java >--- src/org/eclipse/equinox/internal/p2/ui/admin/AddArtifactRepositoryOperation.java 26 Feb 2009 22:29:32 -0000 1.2 >+++ src/org/eclipse/equinox/internal/p2/ui/admin/AddArtifactRepositoryOperation.java 12 Mar 2009 18:56:19 -0000 >@@ -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; > >Index: src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java,v >retrieving revision 1.33 >diff -u -r1.33 MetadataRepositoriesView.java >--- src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java 26 Feb 2009 22:27:53 -0000 1.33 >+++ src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java 12 Mar 2009 18:56:19 -0000 >@@ -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; >Index: src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java,v >retrieving revision 1.8 >diff -u -r1.8 RepositoryImplementationPropertyPage.java >--- src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java 26 Feb 2009 22:29:32 -0000 1.8 >+++ src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java 12 Mar 2009 18:56:20 -0000 >@@ -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; >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.admin/META-INF/MANIFEST.MF,v >retrieving revision 1.11 >diff -u -r1.11 MANIFEST.MF >--- META-INF/MANIFEST.MF 7 Oct 2008 23:04:52 -0000 1.11 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:19 -0000 >@@ -14,7 +14,7 @@ > 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, >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.admin/plugin.xml,v >retrieving revision 1.10 >diff -u -r1.10 plugin.xml >--- plugin.xml 10 Feb 2008 22:45:52 -0000 1.10 >+++ plugin.xml 12 Mar 2009 18:56:19 -0000 >@@ -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> > >#P org.eclipse.equinox.p2.console >Index: src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java,v >retrieving revision 1.43 >diff -u -r1.43 ProvisioningHelper.java >--- src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java 22 Dec 2008 15:30:51 -0000 1.43 >+++ src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java 12 Mar 2009 18:56:21 -0000 >@@ -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.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; >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF,v >retrieving revision 1.10 >diff -u -r1.10 MANIFEST.MF >--- META-INF/MANIFEST.MF 25 Apr 2008 19:10:03 -0000 1.10 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:21 -0000 >@@ -13,7 +13,7 @@ > 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, >#P org.eclipse.equinox.p2.ui.sdk.scheduler >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/META-INF/MANIFEST.MF,v >retrieving revision 1.3 >diff -u -r1.3 MANIFEST.MF >--- META-INF/MANIFEST.MF 13 Nov 2008 21:19:42 -0000 1.3 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:23 -0000 >@@ -10,7 +10,7 @@ > 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, >#P org.eclipse.equinox.p2.artifact.processors >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.processors/META-INF/MANIFEST.MF,v >retrieving revision 1.11 >diff -u -r1.11 MANIFEST.MF >--- META-INF/MANIFEST.MF 21 Oct 2008 00:20:31 -0000 1.11 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:25 -0000 >@@ -18,7 +18,7 @@ > 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 >Index: src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java,v >retrieving revision 1.9 >diff -u -r1.9 AbstractDeltaProcessorStep.java >--- src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java 24 Oct 2008 19:21:58 -0000 1.9 >+++ src/org/eclipse/equinox/internal/p2/artifact/processors/AbstractDeltaProcessorStep.java 12 Mar 2009 18:56:25 -0000 >@@ -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; >#P org.eclipse.equinox.p2.touchpoint.natives >Index: src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java,v >retrieving revision 1.4 >diff -u -r1.4 Util.java >--- src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java 10 Nov 2008 19:27:24 -0000 1.4 >+++ src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java 12 Mar 2009 18:56:26 -0000 >@@ -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.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; > >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF,v >retrieving revision 1.11 >diff -u -r1.11 MANIFEST.MF >--- META-INF/MANIFEST.MF 10 Nov 2008 19:27:23 -0000 1.11 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:26 -0000 >@@ -11,7 +11,7 @@ > 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", >#P org.eclipse.equinox.p2.tools >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tools/META-INF/MANIFEST.MF,v >retrieving revision 1.10 >diff -u -r1.10 MANIFEST.MF >--- META-INF/MANIFEST.MF 3 Jun 2008 19:37:35 -0000 1.10 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:27 -0000 >@@ -16,15 +16,16 @@ > 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", >Index: src/org/eclipse/equinox/internal/p2/tools/mirror/RepositoryMirroring.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.tools/src/org/eclipse/equinox/internal/p2/tools/mirror/RepositoryMirroring.java,v >retrieving revision 1.6 >diff -u -r1.6 RepositoryMirroring.java >--- src/org/eclipse/equinox/internal/p2/tools/mirror/RepositoryMirroring.java 20 Oct 2008 14:40:47 -0000 1.6 >+++ src/org/eclipse/equinox/internal/p2/tools/mirror/RepositoryMirroring.java 12 Mar 2009 18:56:27 -0000 >@@ -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.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; >#P org.eclipse.equinox.p2.exemplarysetup >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.exemplarysetup/META-INF/MANIFEST.MF,v >retrieving revision 1.15 >diff -u -r1.15 MANIFEST.MF >--- META-INF/MANIFEST.MF 25 Apr 2008 19:09:46 -0000 1.15 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:40 -0000 >@@ -6,10 +6,12 @@ > 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, >#P org.eclipse.equinox.p2.artifact.optimizers >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF,v >retrieving revision 1.10 >diff -u -r1.10 MANIFEST.MF >--- META-INF/MANIFEST.MF 14 May 2008 22:43:45 -0000 1.10 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:42 -0000 >@@ -10,13 +10,14 @@ > 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" >#P org.eclipse.equinox.p2.artifact.repository >Index: src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java,v >retrieving revision 1.4 >diff -u -r1.4 CreateCompositeArtifactRepositoryTask.java >--- src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java 19 Jan 2009 19:58:07 -0000 1.4 >+++ src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java 12 Mar 2009 18:56:46 -0000 >@@ -23,7 +23,7 @@ > 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. >Index: src/org/eclipse/equinox/internal/p2/artifact/repository/ECFTransport.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/artifact/repository/ECFTransport.java >diff -N src/org/eclipse/equinox/internal/p2/artifact/repository/ECFTransport.java >--- src/org/eclipse/equinox/internal/p2/artifact/repository/ECFTransport.java 28 Feb 2009 20:38:37 -0000 1.29 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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; >- } >-} >Index: src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java,v >retrieving revision 1.52 >diff -u -r1.52 ArtifactRepositoryManager.java >--- src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java 18 Feb 2009 23:13:43 -0000 1.52 >+++ src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java 12 Mar 2009 18:56:43 -0000 >@@ -13,12 +13,14 @@ > 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 @@ > 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); > } >Index: src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java,v >retrieving revision 1.28 >diff -u -r1.28 MirrorRequest.java >--- src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java 18 Feb 2009 23:36:14 -0000 1.28 >+++ src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java 12 Mar 2009 18:56:44 -0000 >@@ -20,6 +20,7 @@ > 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; > > /** >Index: src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java,v >retrieving revision 1.11 >diff -u -r1.11 MirrorSelector.java >--- src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java 10 Mar 2009 21:53:13 -0000 1.11 >+++ src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java 12 Mar 2009 18:56:44 -0000 >@@ -18,7 +18,7 @@ > 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.*; > > /** >Index: src/org/eclipse/equinox/internal/p2/artifact/repository/Transport.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/artifact/repository/Transport.java >diff -N src/org/eclipse/equinox/internal/p2/artifact/repository/Transport.java >--- src/org/eclipse/equinox/internal/p2/artifact/repository/Transport.java 5 Oct 2007 01:44:28 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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); >-} >Index: src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java,v >retrieving revision 1.15 >diff -u -r1.15 CompositeArtifactRepository.java >--- src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java 2 Mar 2009 19:08:04 -0000 1.15 >+++ src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java 12 Mar 2009 18:56:44 -0000 >@@ -23,8 +23,8 @@ > 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; > >Index: src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java,v >retrieving revision 1.9 >diff -u -r1.9 CompositeArtifactRepositoryFactory.java >--- src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java 2 Mar 2009 19:08:04 -0000 1.9 >+++ src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java 12 Mar 2009 18:56:44 -0000 >@@ -19,9 +19,11 @@ > 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; > >@@ -120,6 +122,6 @@ > } > > private Transport getTransport() { >- return ECFTransport.getInstance(); >+ return RepositoryTransport.getInstance(); > } > } >Index: src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java,v >retrieving revision 1.7 >diff -u -r1.7 AbstractArtifactRepository.java >--- src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java 19 Dec 2008 14:48:03 -0000 1.7 >+++ src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java 12 Mar 2009 18:56:45 -0000 >@@ -17,7 +17,7 @@ > 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 { > >Index: src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java,v >retrieving revision 1.8 >diff -u -r1.8 SimpleArtifactRepositoryFactory.java >--- src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java 18 Feb 2009 23:13:43 -0000 1.8 >+++ src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java 12 Mar 2009 18:56:46 -0000 >@@ -16,13 +16,16 @@ > 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 @@ > } > > private Transport getTransport() { >- return ECFTransport.getInstance(); >+ return RepositoryTransport.getInstance(); > } > } >Index: src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java,v >retrieving revision 1.3 >diff -u -r1.3 ArtifactRepositoryFactory.java >--- src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java 18 Feb 2009 23:13:43 -0000 1.3 >+++ src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java 12 Mar 2009 18:56:46 -0000 >@@ -15,7 +15,7 @@ > 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 >Index: src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java,v >retrieving revision 1.75 >diff -u -r1.75 SimpleArtifactRepository.java >--- src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java 20 Feb 2009 20:34:49 -0000 1.75 >+++ src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java 12 Mar 2009 18:56:45 -0000 >@@ -22,11 +22,14 @@ > 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; > >@@ -755,7 +758,7 @@ > } > > 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 >Index: src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java,v >retrieving revision 1.27 >diff -u -r1.27 MirrorApplication.java >--- src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java 18 Feb 2009 23:45:36 -0000 1.27 >+++ src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java 12 Mar 2009 18:56:43 -0000 >@@ -24,7 +24,7 @@ > 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; > >Index: src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java,v >retrieving revision 1.6 >diff -u -r1.6 IArtifactRepository.java >--- src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java 9 Oct 2008 01:05:13 -0000 1.6 >+++ src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java 12 Mar 2009 18:56:45 -0000 >@@ -14,7 +14,7 @@ > 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; > >Index: src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java,v >retrieving revision 1.17 >diff -u -r1.17 IArtifactRepositoryManager.java >--- src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java 19 Feb 2009 16:31:08 -0000 1.17 >+++ src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java 12 Mar 2009 18:56:45 -0000 >@@ -15,7 +15,7 @@ > 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; > > /** >Index: src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IStateful.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IStateful.java >diff -N src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IStateful.java >--- src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IStateful.java 14 Feb 2008 14:12:19 -0000 1.2 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -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(); >- >-} >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF,v >retrieving revision 1.36 >diff -u -r1.36 MANIFEST.MF >--- META-INF/MANIFEST.MF 22 Feb 2009 20:12:23 -0000 1.36 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:43 -0000 >@@ -10,6 +10,7 @@ > 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 @@ > 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", >Index: src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java,v >retrieving revision 1.3 >diff -u -r1.3 ProcessingStepHandler.java >--- src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java 28 May 2008 20:37:13 -0000 1.3 >+++ src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java 12 Mar 2009 18:56:45 -0000 >@@ -17,7 +17,7 @@ > 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 @@ > 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); >Index: src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java,v >retrieving revision 1.3 >diff -u -r1.3 ProcessingStep.java >--- src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java 28 May 2008 20:37:13 -0000 1.3 >+++ src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java 12 Mar 2009 18:56:45 -0000 >@@ -15,7 +15,7 @@ > 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 >#P org.eclipse.equinox.p2.extensionlocation >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 18 Nov 2008 15:29:24 -0000 1.9 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:48 -0000 >@@ -15,15 +15,15 @@ > 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", >Index: src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java,v >retrieving revision 1.26 >diff -u -r1.26 ExtensionLocationMetadataRepository.java >--- src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java 5 Mar 2009 18:58:27 -0000 1.26 >+++ src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java 12 Mar 2009 18:56:49 -0000 >@@ -172,7 +172,7 @@ > } > > /* (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(); >Index: src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java,v >retrieving revision 1.23 >diff -u -r1.23 ExtensionLocationArtifactRepository.java >--- src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java 5 Mar 2009 18:58:27 -0000 1.23 >+++ src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java 12 Mar 2009 18:56:49 -0000 >@@ -18,7 +18,7 @@ > 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; > >Index: src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java,v >retrieving revision 1.10 >diff -u -r1.10 ExtensionLocationArtifactRepositoryFactory.java >--- src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java 18 Feb 2009 23:13:45 -0000 1.10 >+++ src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java 12 Mar 2009 18:56:49 -0000 >@@ -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; >Index: src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java,v >retrieving revision 1.12 >diff -u -r1.12 ExtensionLocationMetadataRepositoryFactory.java >--- src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java 18 Feb 2009 23:13:45 -0000 1.12 >+++ src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java 12 Mar 2009 18:56:50 -0000 >@@ -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; >#P org.eclipse.equinox.p2.touchpoint.eclipse >Index: src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RemoveRepositoryAction.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RemoveRepositoryAction.java,v >retrieving revision 1.4 >diff -u -r1.4 RemoveRepositoryAction.java >--- src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RemoveRepositoryAction.java 27 Feb 2009 18:33:11 -0000 1.4 >+++ src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RemoveRepositoryAction.java 12 Mar 2009 18:56:51 -0000 >@@ -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. >Index: src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java,v >retrieving revision 1.4 >diff -u -r1.4 AddRepositoryAction.java >--- src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java 27 Feb 2009 18:33:11 -0000 1.4 >+++ src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java 12 Mar 2009 18:56:51 -0000 >@@ -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. >Index: src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RepositoryAction.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RepositoryAction.java,v >retrieving revision 1.3 >diff -u -r1.3 RepositoryAction.java >--- src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RepositoryAction.java 27 Feb 2009 18:33:11 -0000 1.3 >+++ src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RepositoryAction.java 12 Mar 2009 18:56:52 -0000 >@@ -20,9 +20,9 @@ > 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; >Index: src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java,v >retrieving revision 1.62 >diff -u -r1.62 Util.java >--- src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java 6 Mar 2009 20:06:59 -0000 1.62 >+++ src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java 12 Mar 2009 18:56:51 -0000 >@@ -21,9 +21,9 @@ > 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; >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF,v >retrieving revision 1.34 >diff -u -r1.34 MANIFEST.MF >--- META-INF/MANIFEST.MF 20 Feb 2009 22:43:59 -0000 1.34 >+++ META-INF/MANIFEST.MF 12 Mar 2009 18:56:51 -0000 >@@ -15,7 +15,7 @@ > 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,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 216278
:
128610
|
128612
|
129128
|
129407