Package org.eclipse.aether.spi.connector
Class ArtifactTransfer
- java.lang.Object
-
- org.eclipse.aether.spi.connector.Transfer
-
- org.eclipse.aether.spi.connector.ArtifactTransfer
-
- Direct Known Subclasses:
ArtifactDownload,ArtifactUpload
public abstract class ArtifactTransfer extends Transfer
A download/upload of an artifact.
-
-
Field Summary
Fields Modifier and Type Field Description private Artifactartifactprivate ArtifactTransferExceptionexceptionprivate java.io.Filefile
-
Constructor Summary
Constructors Constructor Description ArtifactTransfer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArtifactgetArtifact()Gets the artifact being transferred.ArtifactTransferExceptiongetException()Gets the exception that occurred during the transfer (if any).java.io.FilegetFile()Gets the local file the artifact is downloaded to or uploaded from.ArtifactTransfersetArtifact(Artifact artifact)Sets the artifact to transfer.ArtifactTransfersetException(ArtifactTransferException exception)Sets the exception that occurred during the transfer.ArtifactTransfersetFile(java.io.File file)Sets the local file the artifact is downloaded to or uploaded from.-
Methods inherited from class org.eclipse.aether.spi.connector.Transfer
getListener, getTrace, setListener, setTrace
-
-
-
-
Field Detail
-
artifact
private Artifact artifact
-
file
private java.io.File file
-
exception
private ArtifactTransferException exception
-
-
Method Detail
-
getArtifact
public Artifact getArtifact()
Gets the artifact being transferred.- Returns:
- The artifact being transferred or
nullif not set.
-
setArtifact
public ArtifactTransfer setArtifact(Artifact artifact)
Sets the artifact to transfer.- Parameters:
artifact- The artifact, may benull.- Returns:
- This transfer for chaining, never
null.
-
getFile
public java.io.File getFile()
Gets the local file the artifact is downloaded to or uploaded from. In case of a download, a connector should first transfer the bytes to a temporary file and only overwrite the target file once the entire download is completed such that an interrupted/failed download does not corrupt the current file contents.- Returns:
- The local file or
nullif not set.
-
setFile
public ArtifactTransfer setFile(java.io.File file)
Sets the local file the artifact is downloaded to or uploaded from.- Parameters:
file- The local file, may benull.- Returns:
- This transfer for chaining, never
null.
-
getException
public ArtifactTransferException getException()
Gets the exception that occurred during the transfer (if any).- Specified by:
getExceptionin classTransfer- Returns:
- The exception or
nullif the transfer was successful.
-
setException
public ArtifactTransfer setException(ArtifactTransferException exception)
Sets the exception that occurred during the transfer.- Parameters:
exception- The exception, may benullto denote a successful transfer.- Returns:
- This transfer for chaining, never
null.
-
-