org.apache.struts.actions
public static class DownloadAction.FileStreamInfo extends java.lang.Object implements DownloadAction.StreamInfo
StreamInfo
interface which
simplifies the downloading of a file from the disk.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
contentType
The content type for this stream.
|
private java.io.File |
file
The file to be downloaded.
|
Constructor and Description |
---|
DownloadAction.FileStreamInfo(java.lang.String contentType,
java.io.File file)
Constructs an instance of this class, based on the supplied
parameters.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType()
Returns the content type of the stream to be downloaded.
|
java.io.InputStream |
getInputStream()
Returns an input stream on the file to be downloaded.
|
private java.lang.String contentType
private java.io.File file
public DownloadAction.FileStreamInfo(java.lang.String contentType, java.io.File file)
contentType
- The content type of the file.file
- The file to be downloaded.public java.lang.String getContentType()
getContentType
in interface DownloadAction.StreamInfo
public java.io.InputStream getInputStream() throws java.io.IOException
DownloadAction
.getInputStream
in interface DownloadAction.StreamInfo
java.io.IOException
Copyright ? 2000-2014 - The Apache Software Foundation