Package org.eclipse.tycho.p2.remote
Class RemoteRepositoryLoadingHelper
- java.lang.Object
-
- org.eclipse.tycho.p2.remote.RemoteRepositoryLoadingHelper
-
- All Implemented Interfaces:
IRepositoryIdManager
class RemoteRepositoryLoadingHelper extends java.lang.Object implements IRepositoryIdManager
Helper class for the Remote*RepositoryManagers taking care of mapping repository URLs to the settings.xml-configured mirrors and setting passwords.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.net.URI,java.lang.String>
knownMavenRepositoryIds
private MavenLogger
logger
private MavenRepositorySettings
settings
-
Fields inherited from interface org.eclipse.tycho.p2.remote.IRepositoryIdManager
SERVICE_NAME
-
-
Constructor Summary
Constructors Constructor Description RemoteRepositoryLoadingHelper(MavenRepositorySettings settings, MavenLogger logger)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMapping(java.lang.String mavenRepositoryId, java.net.URI location)
private static boolean
certainlyNoRemoteURL(java.net.URI location)
private MavenRepositoryLocation
effectiveLocationFor(java.net.URI location, boolean forLoading)
java.net.URI
getEffectiveLocation(java.net.URI location)
java.net.URI
getEffectiveLocationAndPrepareLoad(java.net.URI location)
private static java.net.URI
normalize(java.net.URI location)
private void
setPasswordForLoading(MavenRepositoryLocation location)
Sets passwords configured in the Maven settings in p2.
-
-
-
Field Detail
-
settings
private final MavenRepositorySettings settings
-
logger
private final MavenLogger logger
-
knownMavenRepositoryIds
private java.util.Map<java.net.URI,java.lang.String> knownMavenRepositoryIds
-
-
Constructor Detail
-
RemoteRepositoryLoadingHelper
public RemoteRepositoryLoadingHelper(MavenRepositorySettings settings, MavenLogger logger)
-
-
Method Detail
-
addMapping
public void addMapping(java.lang.String mavenRepositoryId, java.net.URI location)
- Specified by:
addMapping
in interfaceIRepositoryIdManager
-
normalize
private static java.net.URI normalize(java.net.URI location)
-
getEffectiveLocation
public java.net.URI getEffectiveLocation(java.net.URI location)
-
getEffectiveLocationAndPrepareLoad
public java.net.URI getEffectiveLocationAndPrepareLoad(java.net.URI location) throws org.eclipse.equinox.p2.core.ProvisionException
- Throws:
org.eclipse.equinox.p2.core.ProvisionException
-
effectiveLocationFor
private MavenRepositoryLocation effectiveLocationFor(java.net.URI location, boolean forLoading)
-
setPasswordForLoading
private void setPasswordForLoading(MavenRepositoryLocation location) throws org.eclipse.equinox.p2.core.ProvisionException
Sets passwords configured in the Maven settings in p2.Warning: This method heavily relies on side-effects. Instead of remembering the credentials just for the given location, p2 associates the password with the host. This allows to load children of a composite repository with the same credentials as the parent, without having to specify all children in the Maven settings. This feature can easily break if repositories are loaded in parallel. If this shall be supported, a lock is needed here (TODO).
- Throws:
org.eclipse.equinox.p2.core.ProvisionException
-
certainlyNoRemoteURL
private static boolean certainlyNoRemoteURL(java.net.URI location)
-
-