Class StreamResource

Stream resource is a resource provided to the client directly by the application. The strean resource is fetched from URI that is most often in the context of the application or window. The resource is automatically registered to window in creation.

Synopsis

Since

3.0

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

StreamResource(StreamResource.StreamSource, String, Application)

Create new stream resource for downloading from stream.

getApplication()

Description copied from interface: getApplication

Get the application of the resource

getBufferSize()

Parameters

return

int The size of the buffer in bytes.

Description copied from interface: getBufferSize

Get the size of the download buffer used for this resource.

If the buffer size is 0, the buffer size is decided by the terminal adapter. The default value is 0.

getCacheTime()

Parameters

return

Cache time in milliseconds

Description copied from interface: getCacheTime

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.

getFilename()

Parameters

return

String

Returns the filename.

getStream()

See Also
getStream()
Description copied from interface: getStream

Get resource as stream

getStreamSource()

Parameters

return

Source of the StreamResource.

Returns the source for this StreamResource. StreamSource is queried when the resource is about to be streamed to the client.

setBufferSize(int)

Parameters

bufferSize

The size of the buffer in bytes.

Set the size of the download buffer used for this resource.

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.

setFilename(String)

Parameters

filename

The filename to set

Sets the filename.

setMIMEType(String)

Set the mime type of the resource

setStreamSource(StreamResource.StreamSource)

Parameters

streamSource

The source to set

Sets the source for this StreamResource. StreamSource is queried when the resource is about to be streamed to the client.