public final class ArtifactDownload extends ArtifactTransfer
setException(ArtifactTransferException)
and setSupportedContexts(Collection)
(if applicable) to
report the results of the transfer.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
checksumPolicy |
private java.lang.String |
context |
private java.util.Collection<java.lang.String> |
contexts |
private boolean |
existenceCheck |
private java.util.List<RemoteRepository> |
repositories |
Constructor and Description |
---|
ArtifactDownload()
Creates a new uninitialized download.
|
ArtifactDownload(Artifact artifact,
java.lang.String context,
java.io.File file,
java.lang.String checksumPolicy)
Creates a new download with the specified properties.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getChecksumPolicy()
Gets the checksum policy for this transfer.
|
java.util.List<RemoteRepository> |
getRepositories()
Gets the remote repositories that are being aggregated by the physically contacted remote repository (i.e.
|
java.lang.String |
getRequestContext()
Gets the context of this transfer.
|
java.util.Collection<java.lang.String> |
getSupportedContexts()
Gets the set of request contexts in which the artifact is generally available.
|
boolean |
isExistenceCheck()
Indicates whether this transfer shall only verify the existence of the artifact in the remote repository rather
than actually downloading the file.
|
ArtifactDownload |
setArtifact(Artifact artifact)
Sets the artifact to transfer.
|
ArtifactDownload |
setChecksumPolicy(java.lang.String checksumPolicy)
Sets the checksum policy for this transfer.
|
ArtifactDownload |
setException(ArtifactTransferException exception)
Sets the exception that occurred during the transfer.
|
ArtifactDownload |
setExistenceCheck(boolean existenceCheck)
Controls whether this transfer shall only verify the existence of the artifact in the remote repository rather
than actually downloading the file.
|
ArtifactDownload |
setFile(java.io.File file)
Sets the local file the artifact is downloaded to or uploaded from.
|
ArtifactDownload |
setListener(TransferListener listener)
Sets the listener that is to be notified during the transfer.
|
ArtifactDownload |
setRepositories(java.util.List<RemoteRepository> repositories)
Sets the remote repositories that are being aggregated by the physically contacted remote repository (i.e.
|
ArtifactDownload |
setRequestContext(java.lang.String context)
Sets the context of this transfer.
|
ArtifactDownload |
setSupportedContexts(java.util.Collection<java.lang.String> contexts)
Sets the set of request contexts in which the artifact is generally available.
|
ArtifactDownload |
setTrace(RequestTrace trace)
Sets the trace information that describes the higher level request/operation in which this transfer is issued.
|
java.lang.String |
toString() |
getArtifact, getException, getFile
getListener, getTrace
private boolean existenceCheck
private java.lang.String checksumPolicy
private java.lang.String context
private java.util.Collection<java.lang.String> contexts
private java.util.List<RemoteRepository> repositories
public ArtifactDownload()
public ArtifactDownload(Artifact artifact, java.lang.String context, java.io.File file, java.lang.String checksumPolicy)
artifact
- The artifact to download, may be null
.context
- The context in which this download is performed, may be null
.file
- The local file to download the artifact to, may be null
.checksumPolicy
- The checksum policy, may be null
.public ArtifactDownload setArtifact(Artifact artifact)
ArtifactTransfer
setArtifact
in class ArtifactTransfer
artifact
- The artifact, may be null
.null
.public ArtifactDownload setFile(java.io.File file)
ArtifactTransfer
setFile
in class ArtifactTransfer
file
- The local file, may be null
.null
.public boolean isExistenceCheck()
ArtifactNotFoundException
with this download. Note: If an existence check is requested,
ArtifactTransfer.getFile()
may be null
, i.e. the connector must not try to access the local file.true
if only the artifact existence shall be verified, false
to actually download the
artifact.public ArtifactDownload setExistenceCheck(boolean existenceCheck)
existenceCheck
- true
if only the artifact existence shall be verified, false
to actually
download the artifact.null
.public java.lang.String getChecksumPolicy()
null
.public ArtifactDownload setChecksumPolicy(java.lang.String checksumPolicy)
checksumPolicy
- The checksum policy, may be null
.null
.public java.lang.String getRequestContext()
null
.public ArtifactDownload setRequestContext(java.lang.String context)
context
- The context id, may be null
.null
.public java.util.Collection<java.lang.String> getSupportedContexts()
null
.public ArtifactDownload setSupportedContexts(java.util.Collection<java.lang.String> contexts)
contexts
- The set of requests context in which the artifact is available, may be null
.null
.public java.util.List<RemoteRepository> getRepositories()
null
.public ArtifactDownload setRepositories(java.util.List<RemoteRepository> repositories)
repositories
- The remote repositories being aggregated, may be null
.null
.public ArtifactDownload setException(ArtifactTransferException exception)
ArtifactTransfer
setException
in class ArtifactTransfer
exception
- The exception, may be null
to denote a successful transfer.null
.public ArtifactDownload setListener(TransferListener listener)
Transfer
setListener
in class Transfer
listener
- The transfer listener to notify, may be null
if none.null
.public ArtifactDownload setTrace(RequestTrace trace)
Transfer
public java.lang.String toString()
toString
in class java.lang.Object