Interface DownloadTarget

All Known Implementing Classes:
BaseFileDownloadTarget, ByteArrayDownloadTarget, OutputStreamDownloadTarget, ServletResponseDownloadTarget

public interface DownloadTarget
Represents a local file or resource that is the target for a file that is about to be downloaded from a remote server. The download is initiated by calling AbstractSession.downloadFile(String, DownloadTarget) which will call getMetadata() first and populate this with as much information as it can get from the remote server. Then, the getOutputStream() is called and the file data is written to the returned stream.
Since:
1.0
Author:
nicklas
  • Method Summary

    Modifier and Type Method Description
    FileMetaData getMetadata()
    Get a metadata instance for collecting information about the remote file.
    String getName()
    The name of the local resource.
    OutputStream getOutputStream()
    Get an ouput stream for writing the file data to the local resource.
  • Method Details

    • getName

      String getName()
      The name of the local resource.
    • getOutputStream

      OutputStream getOutputStream() throws IOException
      Get an ouput stream for writing the file data to the local resource.
      Throws:
      IOException
    • getMetadata

      FileMetaData getMetadata()
      Get a metadata instance for collecting information about the remote file. The metadata will be populated before the download is started.
      Returns:
      A metadata instance or null if not important