org.apache.struts.actions
public static class DownloadAction.ResourceStreamInfo extends java.lang.Object implements DownloadAction.StreamInfo
StreamInfo
interface which
simplifies the downloading of a web application resource.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
contentType
The content type for this stream.
|
private javax.servlet.ServletContext |
context
The servlet context for the resource to be downloaded.
|
private java.lang.String |
path
The path to the resource to be downloaded.
|
Constructor and Description |
---|
DownloadAction.ResourceStreamInfo(java.lang.String contentType,
javax.servlet.ServletContext context,
java.lang.String path)
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 resource to be downloaded.
|
private java.lang.String contentType
private javax.servlet.ServletContext context
private java.lang.String path
public DownloadAction.ResourceStreamInfo(java.lang.String contentType, javax.servlet.ServletContext context, java.lang.String path)
contentType
- The content type of the file.context
- The servlet context for the resource.path
- The path to the resource 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