Package org.eclipse.aether.spi.connector
Class ArtifactUpload
- java.lang.Object
-
- org.eclipse.aether.spi.connector.Transfer
-
- org.eclipse.aether.spi.connector.ArtifactTransfer
-
- org.eclipse.aether.spi.connector.ArtifactUpload
-
public final class ArtifactUpload extends ArtifactTransfer
An upload of an artifact to a remote repository. A repository connector processing this upload has to usesetException(ArtifactTransferException)to report the results of the transfer.
-
-
Field Summary
Fields Modifier and Type Field Description private FileTransformerfileTransformer
-
Constructor Summary
Constructors Constructor Description ArtifactUpload()Creates a new uninitialized upload.ArtifactUpload(Artifact artifact, java.io.File file)Creates a new upload with the specified properties.ArtifactUpload(Artifact artifact, java.io.File file, FileTransformer fileTransformer)Creates a new upload with the specified properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileTransformergetFileTransformer()ArtifactUploadsetArtifact(Artifact artifact)Sets the artifact to transfer.ArtifactUploadsetException(ArtifactTransferException exception)Sets the exception that occurred during the transfer.ArtifactUploadsetFile(java.io.File file)Sets the local file the artifact is downloaded to or uploaded from.ArtifactUploadsetFileTransformer(FileTransformer fileTransformer)ArtifactUploadsetListener(TransferListener listener)Sets the listener that is to be notified during the transfer.ArtifactUploadsetTrace(RequestTrace trace)Sets the trace information that describes the higher level request/operation in which this transfer is issued.java.lang.StringtoString()-
Methods inherited from class org.eclipse.aether.spi.connector.ArtifactTransfer
getArtifact, getException, getFile
-
Methods inherited from class org.eclipse.aether.spi.connector.Transfer
getListener, getTrace
-
-
-
-
Field Detail
-
fileTransformer
private FileTransformer fileTransformer
-
-
Constructor Detail
-
ArtifactUpload
public ArtifactUpload()
Creates a new uninitialized upload.
-
ArtifactUpload
public ArtifactUpload(Artifact artifact, java.io.File file)
Creates a new upload with the specified properties.- Parameters:
artifact- The artifact to upload, may benull.file- The local file to upload the artifact from, may benull.
-
ArtifactUpload
public ArtifactUpload(Artifact artifact, java.io.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 benull.file- The local file to upload the artifact from, may benull.fileTransformer- The file transformer, may benull.
-
-
Method Detail
-
setArtifact
public ArtifactUpload setArtifact(Artifact artifact)
Description copied from class:ArtifactTransferSets the artifact to transfer.- Overrides:
setArtifactin classArtifactTransfer- Parameters:
artifact- The artifact, may benull.- Returns:
- This transfer for chaining, never
null.
-
setFile
public ArtifactUpload setFile(java.io.File file)
Description copied from class:ArtifactTransferSets the local file the artifact is downloaded to or uploaded from.- Overrides:
setFilein classArtifactTransfer- Parameters:
file- The local file, may benull.- Returns:
- This transfer for chaining, never
null.
-
setException
public ArtifactUpload setException(ArtifactTransferException exception)
Description copied from class:ArtifactTransferSets the exception that occurred during the transfer.- Overrides:
setExceptionin classArtifactTransfer- Parameters:
exception- The exception, may benullto denote a successful transfer.- Returns:
- This transfer for chaining, never
null.
-
setListener
public ArtifactUpload setListener(TransferListener listener)
Description copied from class:TransferSets the listener that is to be notified during the transfer.- Overrides:
setListenerin classTransfer- Parameters:
listener- The transfer listener to notify, may benullif none.- Returns:
- This transfer for chaining, never
null.
-
setTrace
public ArtifactUpload setTrace(RequestTrace trace)
Description copied from class:TransferSets the trace information that describes the higher level request/operation in which this transfer is issued.
-
setFileTransformer
public ArtifactUpload setFileTransformer(FileTransformer fileTransformer)
-
getFileTransformer
public FileTransformer getFileTransformer()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-