EchoPoint API - 3.0.0b5
App Webcontainer

echopoint.tucana
Class AbstractDownloadProvider

java.lang.Object
  extended by echopoint.tucana.AbstractDownloadProvider
All Implemented Interfaces:
DownloadProvider, Serializable
Direct Known Subclasses:
FileDownloadProvider, InputStreamDownloadProvider

public abstract class AbstractDownloadProvider
extends Object
implements DownloadProvider

An abstract implementation that returns default values for non-mandatory methods.

Version:
$Id: AbstractDownloadProvider.java 248 2009-10-19 14:20:53Z sptrakesh $
Author:
Echo File Transfer Library
See Also:
Serialized Form

Field Summary
protected  String contentDisposition
          The content disposition for the file being sent to client.
protected  String contentType
          The content-type to set for the file.
protected  String fileName
          The file name of the content being enqueued to the client.
protected  long size
          The content length of the file (or equivalent) being enqueued to client.
protected  Status status
          The status of the download process.
 
Constructor Summary
AbstractDownloadProvider()
           
 
Method Summary
 String getContentDisposition()
          Returns the value of the disposition-type in the Content-Disposition parameter of the response header.
 String getFileName()
          Returns the file name, for example "my-file.txt".
 long getSize()
          Returns the size of the data to be downloaded.
 Status getStatus()
          Return the status of the download action.
 void setContentType(String contentType)
          Set the content-type for the file.
 void setFileName(String fileName)
          Set the file name for the downloaded content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface echopoint.tucana.DownloadProvider
getContentType, writeFile
 

Field Detail

fileName

protected String fileName
The file name of the content being enqueued to the client.


size

protected long size
The content length of the file (or equivalent) being enqueued to client.


contentDisposition

protected String contentDisposition
The content disposition for the file being sent to client.


contentType

protected String contentType
The content-type to set for the file. Specify only if you wish to over-ride default processing.


status

protected Status status
The status of the download process.

Constructor Detail

AbstractDownloadProvider

public AbstractDownloadProvider()
Method Detail

getFileName

public String getFileName()
Returns the file name, for example "my-file.txt".

Specified by:
getFileName in interface DownloadProvider
Returns:
the file name.

setFileName

public void setFileName(String fileName)
Set the file name for the downloaded content. Specify if you wish to over-ride the default name.

Parameters:
fileName - The file name to send to client.

getSize

public long getSize()
Returns the size of the data to be downloaded.

Specified by:
getSize in interface DownloadProvider
Returns:
the size of the data to be downloaded.

getContentDisposition

public String getContentDisposition()
Returns the value of the disposition-type in the Content-Disposition parameter of the response header. null indicates that a Content-Disposition parameter should not be included in the reponse header. See RFC 2183 for more info. The following values are most commonly used:

Specified by:
getContentDisposition in interface DownloadProvider
Returns:
The file's Content-Disposition

setContentType

public void setContentType(String contentType)
Set the content-type for the file. Specify if you wish to explicitly set the content-type rather than let default rules apply.

Parameters:
contentType - The content-type to set.

getStatus

public Status getStatus()
Return the status of the download action.

Specified by:
getStatus in interface DownloadProvider
Returns:
A status indicator regarding progress of the download.

EchoPoint API - 3.0.0b5
App Webcontainer