org.apache.struts.actions
Class DownloadAction.ResourceStreamInfo
java.lang.Object
org.apache.struts.actions.DownloadAction.ResourceStreamInfo
- DownloadAction
- DownloadAction.StreamInfo
public static class DownloadAction.ResourceStreamInfo
extends java.lang.Object
A concrete implementation of the StreamInfo
interface which
simplifies the downloading of a web application resource.
private String | contentType - The content type for this stream.
|
private ServletContext | context - The servlet context for the resource to be downloaded.
|
private String | path - The path to the resource to be downloaded.
|
ResourceStreamInfo(String contentType, ServletContext context, String path) - 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 resource to be downloaded.
|
contentType
private String contentType
The content type for this stream.
context
private ServletContext context
The servlet context for the resource to be downloaded.
path
private String path
The path to the resource to be downloaded.
ResourceStreamInfo
public ResourceStreamInfo(String contentType,
ServletContext context,
String path)
Constructs an instance of this class, based on the supplied
parameters.
contentType
- The content type of the file.context
- The servlet context for the resource.path
- The path to the resource to be downloaded.
getInputStream
public InputStream getInputStream()
throws IOException
Returns an input stream on the resource to be downloaded. This stream
will be closed by the DownloadAction
.
- getInputStream in interface DownloadAction.StreamInfo
- The input stream for the resource to be downloaded.
Copyright B) 2000-2007 - The Apache Software Foundation