Class DownloadStream

Downloadable stream.

Synopsis

Since

3.0

Inheritance Path.  java.lang.Object-> com.itmill.toolkit.terminal.DownloadStream

DownloadStream(InputStream, String, String)

Creates a new instance of DownloadStream

DEFAULT_CACHETIME

Default cache time.

MAX_CACHETIME

Maximum cache time.

getBufferSize()

Parameters

return

int The size of the buffer in bytes.

Get the size of the download buffer.

getCacheTime()

Parameters

return

Cache time in milliseconds

Get lenght of cache expiration time. This gives the adapter the possibility cache streams sent to the client. The caching may be made in adapter or at the client if the client supports caching. Default is DEFAULT_CACHETIME.

getContentType()

Parameters

return

type of the stream content.

Get stream content type.

getFileName()

Parameters

return

The name of the file.

Returns the file name.

getParameter(String)

Parameters

name

Name of the parameter to set.

return

Value of the parameter or null if the parameter does not exist.

Get a paramater for download stream. Parameters are optional information about the downloadable stream and their meaning depends on the used adapter. For example in WebAdapter they are interpreted as HTTP response headers.

getParameterNames()

Parameters

return

Iteraror of names or null if no parameters are set.

Get the names of the parameters.

getStream()

Parameters

return

output stream.

Get downloadable stream.

setBufferSize(int)

Parameters

bufferSize

The size of the buffer in bytes.

Set the size of the download buffer.

setCacheTime(long)

Parameters

cacheTime

The cache time in milliseconds.

Set lenght of cache expiration time. This gives the adapter the possibility cache streams sent to the client. The caching may be made in adapter or at the client if the client supports caching. Zero or negavive value disbales the caching of this stream.

setContentType(String)

Parameters

contentType

The contentType to set

Set stream content type.

setFileName(String)

Parameters

fileName

The file name to set

Sets the file name.

setParameter(String, String)

Parameters

name

Name of the parameter to set.

value

Value of the parameter to set.

Set a paramater for download stream. Parameters are optional information about the downloadable stream and their meaning depends on the used adapter. For example in WebAdapter they are interpreted as HTTP response headers. If the parameters by this name exists, the old value is replaced.

setStream(InputStream)

Parameters

stream

The stream to set

Sets the stream.