Package muntjac :: Package terminal :: Module class_resource :: Class ClassResource
[hide private]
[frames] | no frames]

Class ClassResource

source code

                           object --+        
                                    |        
                   resource.IResource --+    
                                        |    
application_resource.IApplicationResource --+
                                            |
                                           ClassResource

ClassResource is a named resource accessed with the class loader.

This can be used to access resources such as icons, files, etc.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self, *args)
Creates a new application resource instance.
source code
 
getMIMEType(self)
Gets the MIME type of this resource.
source code
 
getApplication(self)
Gets the application of this resource.
source code
 
getFilename(self)
Gets the virtual filename for this resource.
source code
 
getStream(self)
Gets resource as stream.
source code
 
getBufferSize(self)
Gets the size of the download buffer used for this resource.
source code
 
setBufferSize(self, bufferSize)
Sets the size of the download buffer used for this resource.
source code
 
getCacheTime(self)
Gets the length of cache expiration time.
source code
 
setCacheTime(self, cacheTime)
Sets the length of cache expiration time.
source code

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

Class Variables [hide private]

Inherited from application_resource.IApplicationResource: DEFAULT_CACHETIME

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args)
(Constructor)

source code 

Creates a new application resource instance. The resource id is relative to the location of the application class.

Parameters:
  • args - tuple of the form
    • (resourceName, application)
      1. the Unique identifier of the resource within the application
      2. the application this resource will be added to
    • (associatedClass, resourceName, application)
      1. the class of the which the resource is associated.
      2. the Unique identifier of the resource within the application
      3. the application this resource will be added to
Overrides: object.__init__

getMIMEType(self)

source code 

Gets the MIME type of this resource.

Returns:
the MIME type of the resource.
Overrides: resource.IResource.getMIMEType

getApplication(self)

source code 

Gets the application of this resource.

Overrides: application_resource.IApplicationResource.getApplication

getFilename(self)

source code 

Gets the virtual filename for this resource.

Returns:
the file name associated to this resource.
Overrides: application_resource.IApplicationResource.getFilename

getStream(self)

source code 

Gets resource as stream.

Overrides: application_resource.IApplicationResource.getStream

getBufferSize(self)

source code 

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

Returns:
the size of the buffer in bytes.
Overrides: application_resource.IApplicationResource.getBufferSize
(inherited documentation)

setBufferSize(self, bufferSize)

source code 

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

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

getCacheTime(self)

source code 

Gets the 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
Overrides: application_resource.IApplicationResource.getCacheTime
(inherited documentation)

setCacheTime(self, cacheTime)

source code 

Sets the 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 negative value disables the caching of this stream.

Parameters:
  • cacheTime - the cache time in milliseconds.