jp.terasoluna.fw.web.struts.actions
Class DownloadInputStream

java.lang.Object
  extended by jp.terasoluna.fw.web.struts.actions.AbstractDownloadObject
      extended by jp.terasoluna.fw.web.struts.actions.DownloadInputStream
All Implemented Interfaces:
java.io.Serializable

public class DownloadInputStream
extends AbstractDownloadObject

Class in which download data is input stream.

See Also:
Serialized Form

Field Summary
private static long serialVersionUID
          Serial versionUID.
protected  java.io.InputStream stream
          Input stream of download contents.
 
Fields inherited from class jp.terasoluna.fw.web.struts.actions.AbstractDownloadObject
additionalHeaders, charset, contentType, DEFAULT_CHARSET, DEFAULT_CONTENT_TYPE, name, NO_DOWNLOAD_CONTENT_ERROR
 
Constructor Summary
DownloadInputStream(java.lang.String name, java.io.InputStream stream)
          Constructor.
 
Method Summary
 int getLengthOfData()
          Fetches download size.
protected  java.io.InputStream getStreamInternal()
          Fetches the stream of download contents internally.
 
Methods inherited from class jp.terasoluna.fw.web.struts.actions.AbstractDownloadObject
addHeader, getAdditionalHeaders, getCharset, getContentType, getName, getStream, setCharset, setContentType, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial versionUID.

See Also:
Constant Field Values

stream

protected transient java.io.InputStream stream
Input stream of download contents.

Constructor Detail

DownloadInputStream

public DownloadInputStream(java.lang.String name,
                           java.io.InputStream stream)
Constructor.

Parameters:
name - Download name.
stream - Input stream.
Method Detail

getLengthOfData

public int getLengthOfData()
Fetches download size.

When it can not be fetched in this class, it returns -1.

Specified by:
getLengthOfData in class AbstractDownloadObject
Returns:
Download size.

getStreamInternal

protected java.io.InputStream getStreamInternal()
                                         throws java.io.IOException
Fetches stream of download contents internally.

Specified by:
getStreamInternal in class AbstractDownloadObject
Returns:
Stream.
Throws:
java.io.IOException