org.apache.struts.actions
Class DownloadAction.FileStreamInfo
java.lang.Object
org.apache.struts.actions.DownloadAction.FileStreamInfo
- DownloadAction
- DownloadAction.StreamInfo
public static class DownloadAction.FileStreamInfo
extends java.lang.Object
A concrete implementation of the StreamInfo
interface which
simplifies the downloading of a file from the disk.
private String | contentType - The content type for this stream.
|
private File | file - The file to be downloaded.
|
FileStreamInfo(String contentType, File file) - Constructs an instance of this class, based on the supplied
parameters.
|
String | getContentType() - Returns the content type of the stream to be downloaded.
|
InputStream | getInputStream() - Returns an input stream on the file to be downloaded.
|
contentType
private String contentType
The content type for this stream.
file
private File file
The file to be downloaded.
FileStreamInfo
public FileStreamInfo(String contentType,
File file)
Constructs an instance of this class, based on the supplied
parameters.
contentType
- The content type of the file.file
- The file to be downloaded.
getInputStream
public InputStream getInputStream()
throws IOException
Returns an input stream on the file to be downloaded. This stream
will be closed by the DownloadAction
.
- getInputStream in interface DownloadAction.StreamInfo
- The input stream for the file to be downloaded.
Copyright B) 2000-2007 - The Apache Software Foundation