Package org.eclipse.aether.spi.connector
Class MetadataTransfer
- java.lang.Object
-
- org.eclipse.aether.spi.connector.Transfer
-
- org.eclipse.aether.spi.connector.MetadataTransfer
-
- Direct Known Subclasses:
MetadataDownload,MetadataUpload
public abstract class MetadataTransfer extends Transfer
A download/upload of metadata.
-
-
Field Summary
Fields Modifier and Type Field Description private MetadataTransferExceptionexceptionprivate java.io.Filefileprivate Metadatametadata
-
Constructor Summary
Constructors Constructor Description MetadataTransfer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetadataTransferExceptiongetException()Gets the exception that occurred during the transfer (if any).java.io.FilegetFile()Gets the local file the metadata is downloaded to or uploaded from.MetadatagetMetadata()Gets the metadata being transferred.MetadataTransfersetException(MetadataTransferException exception)Sets the exception that occurred during the transfer.MetadataTransfersetFile(java.io.File file)Sets the local file the metadata is downloaded to or uploaded from.MetadataTransfersetMetadata(Metadata metadata)Sets the metadata to transfer.-
Methods inherited from class org.eclipse.aether.spi.connector.Transfer
getListener, getTrace, setListener, setTrace
-
-
-
-
Field Detail
-
metadata
private Metadata metadata
-
file
private java.io.File file
-
exception
private MetadataTransferException exception
-
-
Method Detail
-
getMetadata
public Metadata getMetadata()
Gets the metadata being transferred.- Returns:
- The metadata being transferred or
nullif not set.
-
setMetadata
public MetadataTransfer setMetadata(Metadata metadata)
Sets the metadata to transfer.- Parameters:
metadata- The metadata, may benull.- Returns:
- This transfer for chaining, never
null.
-
getFile
public java.io.File getFile()
Gets the local file the metadata 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 MetadataTransfer setFile(java.io.File file)
Sets the local file the metadata is downloaded to or uploaded from.- Parameters:
file- The local file, may benull.- Returns:
- This transfer for chaining, never
null.
-
getException
public MetadataTransferException 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 MetadataTransfer setException(MetadataTransferException 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.
-
-