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.
Restriction:
This class is not intended to be extended by clients.
  • Method Details

    • getArtifact

      Gets the artifact being transferred.
      Returns:
      The artifact being transferred or null if not set.
    • setArtifact

      Sets the artifact to transfer.
      Parameters:
      artifact - The artifact, may be null.
      Returns:
      This transfer for chaining, never null.
    • getFile

      public 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 null if not set.
    • setFile

      public ArtifactTransfer setFile(File file)
      Sets the local file the artifact is downloaded to or uploaded from.
      Parameters:
      file - The local file, may be null.
      Returns:
      This transfer for chaining, never null.
    • getException

      Gets the exception that occurred during the transfer (if any).
      Specified by:
      getException in class Transfer
      Returns:
      The exception or null if the transfer was successful.
    • setException

      Sets the exception that occurred during the transfer.
      Parameters:
      exception - The exception, may be null to denote a successful transfer.
      Returns:
      This transfer for chaining, never null.