Package org.eclipse.aether.spi.connector
Class ArtifactDownload
java.lang.Object
org.eclipse.aether.spi.connector.Transfer
org.eclipse.aether.spi.connector.ArtifactTransfer
org.eclipse.aether.spi.connector.ArtifactDownload
A download of an artifact from a remote repository. A repository connector processing this download has to use
setException(ArtifactTransferException)
and setSupportedContexts(Collection)
(if applicable) to
report the results of the transfer.-
Constructor Summary
ConstructorDescriptionCreates a new uninitialized download.ArtifactDownload
(org.eclipse.aether.artifact.Artifact artifact, String context, File file, String checksumPolicy) Deprecated.ArtifactDownload
(org.eclipse.aether.artifact.Artifact artifact, String context, Path path, String checksumPolicy) -
Method Summary
Modifier and TypeMethodDescriptionGets the checksum policy for this transfer.List
<org.eclipse.aether.repository.RemoteRepository> Gets the remote repositories that are being aggregated by the physically contacted remote repository (i.e.Gets the context of this transfer.Gets the set of request contexts in which the artifact is generally available.boolean
Indicates whether this transfer shall only verify the existence of the artifact in the remote repository rather than actually downloading the file.setArtifact
(org.eclipse.aether.artifact.Artifact artifact) Sets the artifact to transfer.setChecksumPolicy
(String checksumPolicy) Sets the checksum policy for this transfer.setException
(org.eclipse.aether.transfer.ArtifactTransferException exception) Sets the exception that occurred during the transfer.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.Deprecated.setListener
(org.eclipse.aether.transfer.TransferListener listener) Sets the local file the artifact is downloaded to or uploaded from.setRepositories
(List<org.eclipse.aether.repository.RemoteRepository> repositories) Sets the remote repositories that are being aggregated by the physically contacted remote repository (i.e.setRequestContext
(String context) Sets the context of this transfer.setSupportedContexts
(Collection<String> contexts) Sets the set of request contexts in which the artifact is generally available.setTrace
(org.eclipse.aether.RequestTrace trace) toString()
Methods inherited from class org.eclipse.aether.spi.connector.ArtifactTransfer
getArtifact, getException, getFile, getPath
Methods inherited from class org.eclipse.aether.spi.connector.Transfer
getListener, getTrace
-
Constructor Details
-
ArtifactDownload
public ArtifactDownload()Creates a new uninitialized download. -
ArtifactDownload
@Deprecated public ArtifactDownload(org.eclipse.aether.artifact.Artifact artifact, String context, File file, String checksumPolicy) Deprecated.Creates a new download with the specified properties.- Parameters:
artifact
- The artifact to download, may benull
.context
- The context in which this download is performed, may benull
.file
- The local file to download the artifact to, may benull
.checksumPolicy
- The checksum policy, may benull
.
-
ArtifactDownload
public ArtifactDownload(org.eclipse.aether.artifact.Artifact artifact, String context, Path path, String checksumPolicy) Deprecated.Creates a new download with the specified properties.- Parameters:
artifact
- The artifact to download, may benull
.context
- The context in which this download is performed, may benull
.path
- The local file to download the artifact to, may benull
.checksumPolicy
- The checksum policy, may benull
.- Since:
- 2.0.0
-
-
Method Details
-
setArtifact
Description copied from class:ArtifactTransfer
Sets the artifact to transfer.- Overrides:
setArtifact
in classArtifactTransfer
- Parameters:
artifact
- The artifact, may benull
.- Returns:
- This transfer for chaining, never
null
.
-
setFile
Deprecated.Description copied from class:ArtifactTransfer
Sets the local file the artifact is downloaded to or uploaded from.- Overrides:
setFile
in classArtifactTransfer
- Parameters:
file
- The local file, may benull
.- Returns:
- This transfer for chaining, never
null
.
-
setPath
Description copied from class:ArtifactTransfer
Sets the local file the artifact is downloaded to or uploaded from.- Overrides:
setPath
in classArtifactTransfer
- Parameters:
path
- The local file, may benull
.- Returns:
- This transfer for chaining, never
null
.
-
isExistenceCheck
Indicates whether this transfer shall only verify the existence of the artifact in the remote repository rather than actually downloading the file. Just like with an actual transfer, a connector is expected to signal the non-existence of the artifact by associating anArtifactNotFoundException
with this download. Note: If an existence check is requested,ArtifactTransfer.getFile()
may benull
, i.e. the connector must not try to access the local file.- Returns:
true
if only the artifact existence shall be verified,false
to actually download the artifact.
-
setExistenceCheck
Controls whether this transfer shall only verify the existence of the artifact in the remote repository rather than actually downloading the file.- Parameters:
existenceCheck
-true
if only the artifact existence shall be verified,false
to actually download the artifact.- Returns:
- This transfer for chaining, never
null
.
-
getChecksumPolicy
Gets the checksum policy for this transfer.- Returns:
- The checksum policy, never
null
.
-
setChecksumPolicy
Sets the checksum policy for this transfer.- Parameters:
checksumPolicy
- The checksum policy, may benull
.- Returns:
- This transfer for chaining, never
null
.
-
getRequestContext
Gets the context of this transfer.- Returns:
- The context id, never
null
.
-
setRequestContext
Sets the context of this transfer.- Parameters:
context
- The context id, may benull
.- Returns:
- This transfer for chaining, never
null
.
-
getSupportedContexts
Gets the set of request contexts in which the artifact is generally available. Repository managers can indicate that an artifact is available in more than the requested context to avoid future remote trips for the same artifact in a different context.- Returns:
- The set of requests context in which the artifact is available, never
null
.
-
setSupportedContexts
Sets the set of request contexts in which the artifact is generally available. Repository managers can indicate that an artifact is available in more than the requested context to avoid future remote trips for the same artifact in a different context. The set of supported contexts defaults to the original request context if not overridden by the repository connector.- Parameters:
contexts
- The set of requests context in which the artifact is available, may benull
.- Returns:
- This transfer for chaining, never
null
.
-
getRepositories
Gets the remote repositories that are being aggregated by the physically contacted remote repository (i.e. a repository manager).- Returns:
- The remote repositories being aggregated, never
null
.
-
setRepositories
public ArtifactDownload setRepositories(List<org.eclipse.aether.repository.RemoteRepository> repositories) Sets the remote repositories that are being aggregated by the physically contacted remote repository (i.e. a repository manager).- Parameters:
repositories
- The remote repositories being aggregated, may benull
.- Returns:
- This transfer for chaining, never
null
.
-
setException
public ArtifactDownload setException(org.eclipse.aether.transfer.ArtifactTransferException exception) Description copied from class:ArtifactTransfer
Sets the exception that occurred during the transfer.- Overrides:
setException
in classArtifactTransfer
- Parameters:
exception
- The exception, may benull
to denote a successful transfer.- Returns:
- This transfer for chaining, never
null
.
-
setListener
-
setTrace
-
toString
-
ArtifactDownload(org.eclipse.aether.artifact.Artifact,java.lang.String,java.nio.file.Path,java.lang.String)
instead.