Package org.aktin.broker.download
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 Summary
Constructors Constructor Description DataSourceDownload(javax.activation.DataSource ds)DataSourceDownload(PathDataSource ds, boolean deletePath) -
Method Summary
Modifier and Type Method Description LonggetContentLength()StringgetContentType()longgetExpireTimestamp()UUIDgetId()InputStreamgetInputStream()InstantgetLastModified()StringgetName()return the name set viasetName(String).OutputStreamgetOutputStream()voidsetName(String name)Override the name used for the download.
-
Constructor Details
-
DataSourceDownload
public DataSourceDownload(javax.activation.DataSource ds) -
DataSourceDownload
-
-
Method Details
-
setName
Override the name used for the download. If unset ornullthen theDataSource.getName()method of the underlyingDataSourceis used.- Parameters:
name- name
-
getLastModified
-
getContentType
-
getInputStream
- Throws:
IOException
-
getName
return the name set viasetName(String). If this is undefined, returns theDataSource.getName(). -
getOutputStream
- Throws:
IOException
-
getContentLength
-
getExpireTimestamp
public long getExpireTimestamp()- Specified by:
getExpireTimestampin interfaceDownload
-
getId
-