Class DataSourceDownload

java.lang.Object
org.aktin.broker.download.DataSourceDownload
All Implemented Interfaces:
javax.activation.DataSource, Download, DateDataSource

public class DataSourceDownload
extends Object
Wraps a DataSource for download. This class also recognizes DateDataSource and provides
Author:
Raphael
  • Constructor Details

    • DataSourceDownload

      public DataSourceDownload​(javax.activation.DataSource ds)
    • DataSourceDownload

      public DataSourceDownload​(PathDataSource ds, boolean deletePath)
  • Method Details

    • setName

      public void setName​(String name)
      Override the name used for the download. If unset or null then the DataSource.getName() method of the underlying DataSource is used.
      Parameters:
      name - name
    • getLastModified

      public Instant getLastModified()
    • getContentType

      public String getContentType()
    • getInputStream

      public InputStream getInputStream() throws IOException
      Throws:
      IOException
    • getName

      public String getName()
      return the name set via setName(String). If this is undefined, returns the DataSource.getName().
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Throws:
      IOException
    • getContentLength

      public Long getContentLength()
    • getExpireTimestamp

      public long getExpireTimestamp()
      Specified by:
      getExpireTimestamp in interface Download
    • getId

      public UUID getId()
      Specified by:
      getId in interface Download