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

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.aether.spi.connector.Transfer

      `Transfer.State`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MetadataTransfer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MetadataTransferException` | `getException()` Gets the exception that occurred during the transfer (if any).
    `File` | `getFile()` Gets the local file the metadata is downloaded to or uploaded from.
    `Metadata` | `getMetadata()` Gets the metadata being transferred.
    `MetadataTransfer` | `setException(MetadataTransferException exception)` Sets the exception that occurred during the transfer.
    `MetadataTransfer` | `setFile(File file)` Sets the local file the metadata is downloaded to or uploaded from.
    `MetadataTransfer` | `setMetadata(Metadata metadata)` Sets the metadata to transfer.

    - ### Methods inherited from class org.eclipse.aether.spi.connector.Transfer

      `getState, getTrace, setState, setTrace`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MetadataTransfer

          public MetadataTransfer()

  - ### Method Detail

    - #### getMetadata

          public Metadata getMetadata()

      Gets the metadata being transferred.
      Returns:
        The metadata being transferred or `null` if not set.

    - #### setMetadata

          public MetadataTransfer setMetadata(Metadata metadata)

      Sets the metadata to transfer.
      Parameters:
        `metadata` - The metadata, may be `null`.
      Returns:
        This transfer for chaining, never `null`.

    - #### getFile

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

    - #### setFile

          public MetadataTransfer setFile(File file)

      Sets the local file the metadata is downloaded to or uploaded from.
      Parameters:
        `file` - The local file, may be `null`.
      Returns:
        This transfer for chaining, never `null`.

    - #### getException

          public MetadataTransferException getException()

      Gets the exception that occurred during the transfer (if any).
      Returns:
        The exception or `null` if the transfer was successful.

    - #### setException

          public MetadataTransfer setException(MetadataTransferException exception)

      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`.

Copyright © 2010-2012 The Eclipse Foundation. All Rights Reserved.