org.apache.maven.artifact.repository
Class DefaultRepositoryRequest

java.lang.Object
  extended by org.apache.maven.artifact.repository.DefaultRepositoryRequest
All Implemented Interfaces:
RepositoryRequest

public class DefaultRepositoryRequest
extends Object
implements RepositoryRequest

Collects basic settings to access the repository system.

Author:
Benjamin Bentmann

Constructor Summary
DefaultRepositoryRequest()
          Creates an empty repository request.
DefaultRepositoryRequest(RepositoryRequest repositoryRequest)
          Creates a shallow copy of the specified repository request.
 
Method Summary
 ArtifactRepository getLocalRepository()
          Gets the local repository to use.
 List<ArtifactRepository> getRemoteRepositories()
          Gets the remote repositories to use.
static RepositoryRequest getRepositoryRequest(MavenSession session, MavenProject project)
           
 boolean isForceUpdate()
          Indicates whether remote repositories should be re-checked for updated artifacts/metadata regardless of their configured update policy.
 boolean isOffline()
          Indicates whether network access to remote repositories has been disabled.
 DefaultRepositoryRequest setForceUpdate(boolean forceUpdate)
          Enables/disabled forced checks for updated artifacts/metadata on remote repositories.
 DefaultRepositoryRequest setLocalRepository(ArtifactRepository localRepository)
          Sets the local repository to use.
 DefaultRepositoryRequest setOffline(boolean offline)
          Enables/disables network access to remote repositories.
 DefaultRepositoryRequest setRemoteRepositories(List<ArtifactRepository> remoteRepositories)
          Sets the remote repositories to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRepositoryRequest

public DefaultRepositoryRequest()
Creates an empty repository request.


DefaultRepositoryRequest

public DefaultRepositoryRequest(RepositoryRequest repositoryRequest)
Creates a shallow copy of the specified repository request.

Parameters:
repositoryRequest - The repository request to copy from, must not be null.
Method Detail

getRepositoryRequest

public static RepositoryRequest getRepositoryRequest(MavenSession session,
                                                     MavenProject project)

isOffline

public boolean isOffline()
Description copied from interface: RepositoryRequest
Indicates whether network access to remote repositories has been disabled.

Specified by:
isOffline in interface RepositoryRequest
Returns:
true if remote access has been disabled, false otherwise.

setOffline

public DefaultRepositoryRequest setOffline(boolean offline)
Description copied from interface: RepositoryRequest
Enables/disables network access to remote repositories.

Specified by:
setOffline in interface RepositoryRequest
Parameters:
offline - true to disable remote access, false to allow network access.
Returns:
This request, never null.

isForceUpdate

public boolean isForceUpdate()
Description copied from interface: RepositoryRequest
Indicates whether remote repositories should be re-checked for updated artifacts/metadata regardless of their configured update policy.

Specified by:
isForceUpdate in interface RepositoryRequest
Returns:
true if remote repositories should be re-checked for updated artifacts/metadata, false otherwise.

setForceUpdate

public DefaultRepositoryRequest setForceUpdate(boolean forceUpdate)
Description copied from interface: RepositoryRequest
Enables/disabled forced checks for updated artifacts/metadata on remote repositories.

Specified by:
setForceUpdate in interface RepositoryRequest
Parameters:
forceUpdate - true to forcibly check the remote repositories for updated artifacts/metadata, false to use the update policy configured on each repository.
Returns:
This request, never null.

getLocalRepository

public ArtifactRepository getLocalRepository()
Description copied from interface: RepositoryRequest
Gets the local repository to use.

Specified by:
getLocalRepository in interface RepositoryRequest
Returns:
The local repository to use or null if not set.

setLocalRepository

public DefaultRepositoryRequest setLocalRepository(ArtifactRepository localRepository)
Description copied from interface: RepositoryRequest
Sets the local repository to use.

Specified by:
setLocalRepository in interface RepositoryRequest
Parameters:
localRepository - The local repository to use.
Returns:
This request, never null.

getRemoteRepositories

public List<ArtifactRepository> getRemoteRepositories()
Description copied from interface: RepositoryRequest
Gets the remote repositories to use.

Specified by:
getRemoteRepositories in interface RepositoryRequest
Returns:
The remote repositories to use, never null.

setRemoteRepositories

public DefaultRepositoryRequest setRemoteRepositories(List<ArtifactRepository> remoteRepositories)
Description copied from interface: RepositoryRequest
Sets the remote repositories to use.

Specified by:
setRemoteRepositories in interface RepositoryRequest
Parameters:
remoteRepositories - The remote repositories to use.
Returns:
This request, never null.


Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.