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

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

public class DownloadFile
extends AbstractDownloadObject

Class in which download target is file.

See Also:
Serialized Form

Field Summary
protected  java.io.File file
          File to be downloaded.
private static long serialVersionUID
          Serial versionUID.
 
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
DownloadFile(java.io.File file)
          Constructor which has the file as an argument. Sets the argument in the download file.
DownloadFile(java.lang.String name, java.io.File file)
          Constructor which has the file name and file as argument. Sets it the argument in download file.
 
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

file

protected java.io.File file
File to be downloaded.

Constructor Detail

DownloadFile

public DownloadFile(java.io.File file)
Constructor which has the file as the argument. Sets the argument in the download file.

Parameters:
file - File.

DownloadFile

public DownloadFile(java.lang.String name,
                    java.io.File file)
Constructor which has the file name and file as the argument. Sets the argument in the download file.

Parameters:
name - File name.
file - File.
Method Detail

getLengthOfData

public int getLengthOfData()
Fetches download size.

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

getStreamInternal

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

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