@Service(value="repositoryProxyHandler#maven") public class MavenRepositoryProxyHandler extends DefaultRepositoryProxyHandler
log, urlFailureCache
Constructor and Description |
---|
MavenRepositoryProxyHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addNetworkproxy(String id,
NetworkProxy networkProxy)
Adds a network proxy that is used to access the remote repository.
|
protected boolean |
connectToRepository(ProxyConnector connector,
org.apache.maven.wagon.Wagon wagon,
RemoteRepository remoteRepository)
Using wagon, connect to the remote repository.
|
<T extends RepositoryProxyHandler> |
getHandler(Class<T> clazz)
Returns the proxy handler implementation.
|
WagonFactory |
getWagonFactory() |
void |
initialize() |
void |
setNetworkProxies(Map<String,NetworkProxy> networkProxies)
Sets network proxies (normally HTTP proxies) to access the remote repositories.
|
void |
setWagonFactory(WagonFactory wagonFactory) |
List<RepositoryType> |
supports() |
protected void |
transferArtifact(org.apache.maven.wagon.Wagon wagon,
RemoteRepository remoteRepository,
String remotePath,
ManagedRepository repository,
Path resource,
Path tmpDirectory,
StorageAsset destFile) |
protected void |
transferChecksum(org.apache.maven.wagon.Wagon wagon,
RemoteRepository remoteRepository,
String remotePath,
ManagedRepository repository,
Path resource,
String ext,
Path destFile)
Quietly transfer the checksum file from the remote repository to the local file.
|
protected void |
transferResources(ProxyConnector connector,
RemoteRepository remoteRepository,
StorageAsset tmpResource,
StorageAsset[] checksumFiles,
String url,
String remotePath,
StorageAsset resource,
Path workingDirectory,
ManagedRepository repository) |
protected void |
transferSimpleFile(org.apache.maven.wagon.Wagon wagon,
RemoteRepository remoteRepository,
String remotePath,
ManagedRepository repository,
Path origFile,
Path destFile)
Perform the transfer of the remote file to the local file specified.
|
addParameters, addPolicy, addProxyConnector, fetchFromProxies, fetchFromProxies, fetchMetadataFromProxies, getDownloadErrorPolicies, getMetadataTools, getNetworkProxies, getNetworkProxy, getPostDownloadPolicies, getPreDownloadPolicies, getProxyConnectors, getUrlFailureCache, hasProxies, removePolicy, setArchivaConfiguration, setDownloadErrorPolicies, setMetadataTools, setPolicies, setPostDownloadPolicies, setPreDownloadPolicies, setProxyConnectors, setUrlFailureCache, transferFile
public MavenRepositoryProxyHandler()
public void initialize()
initialize
in class DefaultRepositoryProxyHandler
public void setNetworkProxies(Map<String,NetworkProxy> networkProxies)
RepositoryProxyHandler
setNetworkProxies
in interface RepositoryProxyHandler
setNetworkProxies
in class DefaultRepositoryProxyHandler
networkProxies
- A map of (repository id, network proxy) where the repository id must be the id of an
existing remote repository.protected void transferResources(ProxyConnector connector, RemoteRepository remoteRepository, StorageAsset tmpResource, StorageAsset[] checksumFiles, String url, String remotePath, StorageAsset resource, Path workingDirectory, ManagedRepository repository) throws ProxyException, NotModifiedException
transferResources
in class DefaultRepositoryProxyHandler
connector
- remoteRepository
- tmpResource
- checksumFiles
- url
- remotePath
- resource
- workingDirectory
- repository
- ProxyException
NotModifiedException
protected void transferArtifact(org.apache.maven.wagon.Wagon wagon, RemoteRepository remoteRepository, String remotePath, ManagedRepository repository, Path resource, Path tmpDirectory, StorageAsset destFile) throws ProxyException
ProxyException
protected void transferChecksum(org.apache.maven.wagon.Wagon wagon, RemoteRepository remoteRepository, String remotePath, ManagedRepository repository, Path resource, String ext, Path destFile) throws ProxyException
Quietly transfer the checksum file from the remote repository to the local file.
wagon
- the wagon instance (should already be connected) to use.remoteRepository
- the remote repository to transfer from.remotePath
- the remote path to the resource to get.repository
- the managed repository that will hold the fileresource
- the local file that should contain the downloaded contentsext
- the type of checksum to transfer (example: ".md5" or ".sha1")ProxyException
- if copying the downloaded file into place did not succeed.protected void transferSimpleFile(org.apache.maven.wagon.Wagon wagon, RemoteRepository remoteRepository, String remotePath, ManagedRepository repository, Path origFile, Path destFile) throws ProxyException
wagon
- the wagon instance to use.remoteRepository
- the remote repository to useremotePath
- the remote path to attempt to getrepository
- the managed repository that will hold the fileorigFile
- the local file to save toProxyException
- if there was a problem moving the downloaded file into place.protected boolean connectToRepository(ProxyConnector connector, org.apache.maven.wagon.Wagon wagon, RemoteRepository remoteRepository)
connector
- the connector configuration to utilize (for obtaining network proxy configuration from)wagon
- the wagon instance to establish the connection on.remoteRepository
- the remote repository to connect to.public WagonFactory getWagonFactory()
public void setWagonFactory(WagonFactory wagonFactory)
public List<RepositoryType> supports()
supports
in interface RepositoryProxyHandler
supports
in class DefaultRepositoryProxyHandler
public void addNetworkproxy(String id, NetworkProxy networkProxy)
RepositoryProxyHandler
id
- The repository idnetworkProxy
- The network proxy to usepublic <T extends RepositoryProxyHandler> T getHandler(Class<T> clazz) throws IllegalArgumentException
RepositoryProxyHandler
T
- The typeclazz
- The class to convert toIllegalArgumentException
Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.