org.directwebremoting.impl
Class FileTransferFileGenerator

java.lang.Object
  extended by org.directwebremoting.impl.FileTransferFileGenerator
All Implemented Interfaces:
FileGenerator

public class FileTransferFileGenerator
extends java.lang.Object
implements FileGenerator

An implementation of FileGenerator that uses a FileTransfer.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
FileTransferFileGenerator(FileTransfer fileTransfer)
           
 
Method Summary
 void generateFile(java.io.OutputStream out)
          Write the file to the give OutputStream.
 java.lang.String getFilename()
          Accessor for the filename of this download
 java.lang.String getMimeType()
          What is the MimeType for the given file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTransferFileGenerator

public FileTransferFileGenerator(FileTransfer fileTransfer)
Parameters:
fileTransfer - The FileTransfer user object that we base ourselves on
Method Detail

generateFile

public void generateFile(java.io.OutputStream out)
                  throws java.io.IOException
Description copied from interface: FileGenerator
Write the file to the give OutputStream. The system will take care of opening and closing the stream

Specified by:
generateFile in interface FileGenerator
Parameters:
out - The stream to write to.
Throws:
java.io.IOException - If there are creation problems

getMimeType

public java.lang.String getMimeType()
Description copied from interface: FileGenerator
What is the MimeType for the given file

Specified by:
getMimeType in interface FileGenerator
Returns:
a valid mime-type

getFilename

public java.lang.String getFilename()
Description copied from interface: FileGenerator
Accessor for the filename of this download

Specified by:
getFilename in interface FileGenerator
Returns:
An appropriate filename which may have to be some sort of default

Copyright ¬ 2005