org.apache.maven.artifact.manager

## Class DefaultWagonManager

- java.lang.Object
- - AbstractLogEnabled
  - - org.apache.maven.artifact.manager.DefaultWagonManager

All Implemented Interfaces:
  WagonManager

    public class DefaultWagonManager
    extends AbstractLogEnabled
    implements WagonManager

### Field Summary

### Fields inherited from interface org.apache.maven.artifact.manager.WagonManager

`ROLE`

### Constructor Summary

Constructors
Constructor and Description
`DefaultWagonManager()`

### Method Summary

Methods
`void` `addAuthenticationInfo(java.lang.String repositoryId, java.lang.String username, java.lang.String password, java.lang.String privateKey, java.lang.String passphrase)`
`void` `addConfiguration(java.lang.String repositoryId, Xpp3Dom configuration)` Set the configuration for a repository
`void` `addMirror(java.lang.String id, java.lang.String mirrorOf, java.lang.String url)`
`void` `addPermissionInfo(java.lang.String repositoryId, java.lang.String filePermissions, java.lang.String directoryPermissions)`
`void` `addProxy(java.lang.String protocol, java.lang.String host, int port, java.lang.String username, java.lang.String password, java.lang.String nonProxyHosts)` Set the proxy used for a particular protocol.
`void` `contextualize(Context context)`
`void` `getArtifact(Artifact artifact, ArtifactRepository repository)`
`void` `getArtifact(Artifact artifact, java.util.List remoteRepositories)`
`void` `getArtifactMetadata(ArtifactMetadata metadata, ArtifactRepository repository, java.io.File destination, java.lang.String checksumPolicy)`
`void` `getArtifactMetadataFromDeploymentRepository(ArtifactMetadata metadata, ArtifactRepository repository, java.io.File destination, java.lang.String checksumPolicy)`
`AuthenticationInfo` `getAuthenticationInfo(java.lang.String id)`
`java.lang.String` `getHttpUserAgent()`
`ArtifactRepository` `getMirror(ArtifactRepository originalRepository)` This method finds a matching mirror for the selected repository.
`ArtifactRepository` `getMirrorRepository(ArtifactRepository repository)`
`ProxyInfo` `getProxy(java.lang.String protocol)`
`Wagon` `getWagon(Repository repository)` Get a Wagon provider that understands the protocol passed as argument.
`Wagon` `getWagon(java.lang.String protocol)` Get a Wagon provider that understands the protocol passed as argument.
`void` `initialize()`
`boolean` `isExternalRepo(ArtifactRepository originalRepository)` Checks the URL to see if this repository refers to an external repository
`boolean` `isOnline()`
`boolean` `matchPattern(ArtifactRepository originalRepository, java.lang.String pattern)` This method checks if the pattern matches the originalRepository.
`void` `putArtifact(java.io.File source, Artifact artifact, ArtifactRepository deploymentRepository)`
`void` `putArtifactMetadata(java.io.File source, ArtifactMetadata artifactMetadata, ArtifactRepository repository)`
`void` `registerWagons(java.util.Collection wagons, PlexusContainer extensionContainer)`
`void` `setDefaultRepositoryPermissions(RepositoryPermissions defaultRepositoryPermissions)`
`void` `setDownloadMonitor(TransferListener downloadMonitor)`
`void` `setHttpUserAgent(java.lang.String userAgent)`
`void` `setInteractive(boolean interactive)`
`void` `setOnline(boolean online)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DefaultWagonManager

    public DefaultWagonManager()

### Method Detail

#### getWagon

    public Wagon getWagon(Repository repository)
                   throws UnsupportedProtocolException,
                          WagonConfigurationException

Description copied from interface: `WagonManager`
Get a Wagon provider that understands the protocol passed as argument. It doesn't configure the Wagon.

Specified by:
  `getWagon` in interface `WagonManager`
Parameters:
  `repository` - the protocol the `Wagon` will handle
Returns:
  the `Wagon` instance able to handle the protocol provided
Throws:
  `UnsupportedProtocolException` - if there is no provider able to handle the protocol
  `WagonConfigurationException`

#### getWagon

    public Wagon getWagon(java.lang.String protocol)
                   throws UnsupportedProtocolException

Description copied from interface: `WagonManager`
Get a Wagon provider that understands the protocol passed as argument. It doesn't configure the Wagon.

Specified by:
  `getWagon` in interface `WagonManager`
Parameters:
  `protocol` - the protocol the `Wagon` will handle
Returns:
  the `Wagon` instance able to handle the protocol provided
Throws:
  `UnsupportedProtocolException` - if there is no provider able to handle the protocol

#### putArtifact

    public void putArtifact(java.io.File source,
                   Artifact artifact,
                   ArtifactRepository deploymentRepository)
                     throws TransferFailedException

Specified by:
  `putArtifact` in interface `WagonManager`
Throws:
  `TransferFailedException`

#### putArtifactMetadata

    public void putArtifactMetadata(java.io.File source,
                           ArtifactMetadata artifactMetadata,
                           ArtifactRepository repository)
                             throws TransferFailedException

Specified by:
  `putArtifactMetadata` in interface `WagonManager`
Throws:
  `TransferFailedException`

#### getArtifact

    public void getArtifact(Artifact artifact,
                   java.util.List remoteRepositories)
                     throws TransferFailedException,
                            ResourceDoesNotExistException

Specified by:
  `getArtifact` in interface `WagonManager`
Throws:
  `TransferFailedException`
  `ResourceDoesNotExistException`

#### getArtifact

    public void getArtifact(Artifact artifact,
                   ArtifactRepository repository)
                     throws TransferFailedException,
                            ResourceDoesNotExistException

Specified by:
  `getArtifact` in interface `WagonManager`
Throws:
  `TransferFailedException`
  `ResourceDoesNotExistException`

#### getArtifactMetadata

    public void getArtifactMetadata(ArtifactMetadata metadata,
                           ArtifactRepository repository,
                           java.io.File destination,
                           java.lang.String checksumPolicy)
                             throws TransferFailedException,
                                    ResourceDoesNotExistException

Specified by:
  `getArtifactMetadata` in interface `WagonManager`
Throws:
  `TransferFailedException`
  `ResourceDoesNotExistException`

#### getArtifactMetadataFromDeploymentRepository

    public void getArtifactMetadataFromDeploymentRepository(ArtifactMetadata metadata,
                                                   ArtifactRepository repository,
                                                   java.io.File destination,
                                                   java.lang.String checksumPolicy)
                                                     throws TransferFailedException,
                                                            ResourceDoesNotExistException

Specified by:
  `getArtifactMetadataFromDeploymentRepository` in interface `WagonManager`
Throws:
  `TransferFailedException`
  `ResourceDoesNotExistException`

#### getMirrorRepository

    public ArtifactRepository getMirrorRepository(ArtifactRepository repository)

Specified by:
  `getMirrorRepository` in interface `WagonManager`

#### getProxy

    public ProxyInfo getProxy(java.lang.String protocol)

Specified by:
  `getProxy` in interface `WagonManager`

#### getAuthenticationInfo

    public AuthenticationInfo getAuthenticationInfo(java.lang.String id)

Specified by:
  `getAuthenticationInfo` in interface `WagonManager`

#### getMirror

    public ArtifactRepository getMirror(ArtifactRepository originalRepository)

This method finds a matching mirror for the selected repository. If there is an exact match, this will be used. If there is no exact match, then the list of mirrors is examined to see if a pattern applies.

Parameters:
  `originalRepository` - See if there is a mirror for this repository.
Returns:
  the selected mirror or null if none are found.

#### matchPattern

    public boolean matchPattern(ArtifactRepository originalRepository,
                       java.lang.String pattern)

This method checks if the pattern matches the originalRepository. Valid patterns: * = everything external:* = everything not on the localhost and not file based. repo,repo1 = repo or repo1 *,!repo1 = everything except repo1

Parameters:
  `originalRepository` - to compare for a match.
  `pattern` - used for match. Currently only '*' is supported.
Returns:
  true if the repository is a match to this pattern.

#### isExternalRepo

    public boolean isExternalRepo(ArtifactRepository originalRepository)

Checks the URL to see if this repository refers to an external repository

Parameters:
  `originalRepository` -
Returns:
  true if external.

#### addProxy

    public void addProxy(java.lang.String protocol,
                java.lang.String host,
                int port,
                java.lang.String username,
                java.lang.String password,
                java.lang.String nonProxyHosts)

Set the proxy used for a particular protocol.

Specified by:
  `addProxy` in interface `WagonManager`
Parameters:
  `protocol` - the protocol (required)
  `host` - the proxy host name (required)
  `port` - the proxy port (required)
  `username` - the username for the proxy, or null if there is none
  `password` - the password for the proxy, or null if there is none
  `nonProxyHosts` - the set of hosts not to use the proxy for. Follows Java system property format: `*.foo.com|localhost`.

#### contextualize

    public void contextualize(Context context)
                       throws ContextException

Throws:
  `ContextException`

#### setDownloadMonitor

    public void setDownloadMonitor(TransferListener downloadMonitor)

Specified by:
  `setDownloadMonitor` in interface `WagonManager`

#### addAuthenticationInfo

    public void addAuthenticationInfo(java.lang.String repositoryId,
                             java.lang.String username,
                             java.lang.String password,
                             java.lang.String privateKey,
                             java.lang.String passphrase)

Specified by:
  `addAuthenticationInfo` in interface `WagonManager`

#### addPermissionInfo

    public void addPermissionInfo(java.lang.String repositoryId,
                         java.lang.String filePermissions,
                         java.lang.String directoryPermissions)

Specified by:
  `addPermissionInfo` in interface `WagonManager`

#### addMirror

    public void addMirror(java.lang.String id,
                 java.lang.String mirrorOf,
                 java.lang.String url)

Specified by:
  `addMirror` in interface `WagonManager`

#### setOnline

    public void setOnline(boolean online)

Specified by:
  `setOnline` in interface `WagonManager`

#### isOnline

    public boolean isOnline()

Specified by:
  `isOnline` in interface `WagonManager`

#### setInteractive

    public void setInteractive(boolean interactive)

Specified by:
  `setInteractive` in interface `WagonManager`

#### registerWagons

    public void registerWagons(java.util.Collection wagons,
                      PlexusContainer extensionContainer)

Specified by:
  `registerWagons` in interface `WagonManager`

#### addConfiguration

    public void addConfiguration(java.lang.String repositoryId,
                        Xpp3Dom configuration)

Description copied from interface: `WagonManager`
Set the configuration for a repository

Specified by:
  `addConfiguration` in interface `WagonManager`
Parameters:
  `repositoryId` - id of the repository to set the configuration to
  `configuration` - dom tree of the xml with the configuration for the `Wagon`

#### setDefaultRepositoryPermissions

    public void setDefaultRepositoryPermissions(RepositoryPermissions defaultRepositoryPermissions)

Specified by:
  `setDefaultRepositoryPermissions` in interface `WagonManager`

#### initialize

    public void initialize()
                    throws InitializationException

Throws:
  `InitializationException`

#### setHttpUserAgent

    public void setHttpUserAgent(java.lang.String userAgent)

#### getHttpUserAgent

    public java.lang.String getHttpUserAgent()