org.apache.struts.actions

Class DownloadAction.ResourceStreamInfo

public static class DownloadAction.ResourceStreamInfo extends Object implements DownloadAction.StreamInfo

A concrete implementation of the StreamInfo interface which simplifies the downloading of a web application resource.
Field Summary
StringcontentType
The content type for this stream.
ServletContextcontext
The servlet context for the resource to be downloaded.
Stringpath
The path to the resource to be downloaded.
Constructor Summary
ResourceStreamInfo(String contentType, ServletContext context, String path)
Constructs an instance of this class, based on the supplied parameters.
Method Summary
StringgetContentType()
Returns the content type of the stream to be downloaded.
InputStreamgetInputStream()
Returns an input stream on the resource to be downloaded.

Field Detail

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.

Constructor Detail

ResourceStreamInfo

public ResourceStreamInfo(String contentType, ServletContext context, String path)
Constructs an instance of this class, based on the supplied parameters.

Parameters: contentType The content type of the file. context The servlet context for the resource. path The path to the resource to be downloaded.

Method Detail

getContentType

public String getContentType()
Returns the content type of the stream to be downloaded.

Returns: The content type of the stream.

getInputStream

public InputStream getInputStream()
Returns an input stream on the resource to be downloaded. This stream will be closed by the DownloadAction.

Returns: The input stream for the resource to be downloaded.

Copyright © 2000-2008 - The Apache Software Foundation