Class ArtifactUpload


public final class ArtifactUpload extends ArtifactTransfer
An upload of an artifact to a remote repository. A repository connector processing this upload has to use setException(ArtifactTransferException) to report the results of the transfer.
  • Field Details

  • Constructor Details

    • ArtifactUpload

      public ArtifactUpload()
      Creates a new uninitialized upload.
    • ArtifactUpload

      public ArtifactUpload(Artifact artifact, File file)
      Creates a new upload with the specified properties.
      Parameters:
      artifact - The artifact to upload, may be null.
      file - The local file to upload the artifact from, may be null.
    • ArtifactUpload

      public ArtifactUpload(Artifact artifact, File file, FileTransformer fileTransformer)

      Creates a new upload with the specified properties.

      IMPORTANT When using a fileTransformer, the content of the file is stored in memory to ensure that file content and checksums stay in sync!

      Parameters:
      artifact - The artifact to upload, may be null.
      file - The local file to upload the artifact from, may be null.
      fileTransformer - The file transformer, may be null.
  • Method Details

    • setArtifact

      public ArtifactUpload setArtifact(Artifact artifact)
      Description copied from class: ArtifactTransfer
      Sets the artifact to transfer.
      Overrides:
      setArtifact in class ArtifactTransfer
      Parameters:
      artifact - The artifact, may be null.
      Returns:
      This transfer for chaining, never null.
    • setFile

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

      public ArtifactUpload setException(ArtifactTransferException exception)
      Description copied from class: ArtifactTransfer
      Sets the exception that occurred during the transfer.
      Overrides:
      setException in class ArtifactTransfer
      Parameters:
      exception - The exception, may be null to denote a successful transfer.
      Returns:
      This transfer for chaining, never null.
    • setListener

      public ArtifactUpload setListener(TransferListener listener)
      Description copied from class: Transfer
      Sets the listener that is to be notified during the transfer.
      Overrides:
      setListener in class Transfer
      Parameters:
      listener - The transfer listener to notify, may be null if none.
      Returns:
      This transfer for chaining, never null.
    • setTrace

      public ArtifactUpload setTrace(RequestTrace trace)
      Description copied from class: Transfer
      Sets the trace information that describes the higher level request/operation in which this transfer is issued.
      Overrides:
      setTrace in class Transfer
      Parameters:
      trace - The trace information about the higher level operation, may be null.
      Returns:
      This transfer for chaining, never null.
    • setFileTransformer

      public ArtifactUpload setFileTransformer(FileTransformer fileTransformer)
    • getFileTransformer

      public FileTransformer getFileTransformer()
    • toString

      public String toString()
      Overrides:
      toString in class Object