nextapp.echo.filetransfer
Interface DownloadProvider

All Known Implementing Classes:
AbstractDownloadProvider, ResourceDownloadProvider

public interface DownloadProvider

An interface for download-providing objects. This interface specifies methods for obtaining the content type, filename, size, and data of a downloadable file.


Method Summary
 java.lang.String getContentType()
          Returns the content type of the file.
 java.lang.String getFileName()
          Returns the file's name.
 int getSize()
          Returns the size of the file.
 void writeFile(java.io.OutputStream out)
          Writes the file to the specified output stream.
 

Method Detail

getContentType

java.lang.String getContentType()
Returns the content type of the file.

Returns:
The content type of the file.

getFileName

java.lang.String getFileName()
Returns the file's name. Returning null is allowed.

Returns:
The file's name.

getSize

int getSize()
Returns the size of the file. If the size is unknown, -1 may be returned.

Returns:
The size of the file.

writeFile

void writeFile(java.io.OutputStream out)
               throws java.io.IOException
Writes the file to the specified output stream.

Parameters:
out - The output stream to which the file should be written.
Throws:
java.io.IOException - If the provider is unable to perform this operation.