Package muntjac :: Package terminal :: Module download_stream :: Class DownloadStream
[hide private]
[frames] | no frames]

Class DownloadStream

source code

object --+
         |
        DownloadStream

Downloadable stream.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self, stream, contentType, fileName)
Creates a new instance of DownloadStream.
source code
 
getStream(self)
Gets downloadable stream.
source code
 
setStream(self, stream)
Sets the stream.
source code
 
getContentType(self)
Gets stream content type.
source code
 
setContentType(self, contentType)
Sets stream content type.
source code
 
getFileName(self)
Returns the file name.
source code
 
setFileName(self, fileName)
Sets the file name.
source code
 
setParameter(self, name, value)
Sets a paramater for download stream.
source code
 
getParameter(self, name)
Gets a paramater for download stream.
source code
 
getParameterNames(self)
Gets the names of the parameters.
source code
 
getCacheTime(self)
Gets length of cache expiration time.
source code
 
setCacheTime(self, cacheTime)
Sets length of cache expiration time.
source code
 
getBufferSize(self)
Gets the size of the download buffer.
source code
 
setBufferSize(self, bufferSize)
Sets the size of the download buffer.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  MAX_CACHETIME = 9223372036854775807
  DEFAULT_CACHETIME = 86400000
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, stream, contentType, fileName)
(Constructor)

source code 

Creates a new instance of DownloadStream.

Overrides: object.__init__

getStream(self)

source code 

Gets downloadable stream.

Returns:
output stream.

setStream(self, stream)

source code 

Sets the stream.

Parameters:
  • stream - The stream to set

getContentType(self)

source code 

Gets stream content type.

Returns:
type of the stream content.

setContentType(self, contentType)

source code 

Sets stream content type.

Parameters:
  • contentType - the contentType to set

getFileName(self)

source code 

Returns the file name.

Returns:
the name of the file.

setFileName(self, fileName)

source code 

Sets the file name.

Parameters:
  • fileName - the file name to set.

setParameter(self, name, value)

source code 

Sets 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.

Parameters:
  • name - the Name of the parameter to set.
  • value - the Value of the parameter to set.

getParameter(self, name)

source code 

Gets 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.

Parameters:
  • name - the Name of the parameter to set.
Returns:
Value of the parameter or null if the parameter does not exist.

getParameterNames(self)

source code 

Gets the names of the parameters.

Returns:
Iterator of names or null if no parameters are set.

getCacheTime(self)

source code 

Gets length 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.

Returns:
Cache time in milliseconds

setCacheTime(self, cacheTime)

source code 

Sets length 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.

Parameters:
  • cacheTime - the cache time in milliseconds.

getBufferSize(self)

source code 

Gets the size of the download buffer.

Returns:
int The size of the buffer in bytes.

setBufferSize(self, bufferSize)

source code 

Sets the size of the download buffer.

Parameters:
  • bufferSize - the size of the buffer in bytes.