|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.terminal.ClassResource
public class ClassResource
ClassResource
is a named resource accessed with the class
loader.
This can be used to access resources such as icons, files, etc.
Class.getResource(java.lang.String)
,
Serialized FormField Summary |
---|
Fields inherited from interface com.vaadin.terminal.ApplicationResource |
---|
DEFAULT_CACHETIME |
Constructor Summary | |
---|---|
ClassResource(Class<?> associatedClass,
String resourceName,
Application application)
Creates a new application resource instance. |
|
ClassResource(String resourceName,
Application application)
Creates a new application resource instance. |
Method Summary | |
---|---|
Application |
getApplication()
Gets the application of this resource. |
int |
getBufferSize()
Gets the size of the download buffer used for this resource. |
long |
getCacheTime()
Gets the length of cache expiration time. |
String |
getFilename()
Gets the virtual filename for this resource. |
String |
getMIMEType()
Gets the MIME type of this resource. |
DownloadStream |
getStream()
Gets resource as stream. |
void |
setBufferSize(int bufferSize)
Sets the size of the download buffer used for this resource. |
void |
setCacheTime(long cacheTime)
Sets the length of cache expiration time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassResource(String resourceName, Application application)
resourceName
- the Unique identifier of the resource within the application.application
- the application this resource will be added to.public ClassResource(Class<?> associatedClass, String resourceName, Application application)
associatedClass
- the class of the which the resource is associated.resourceName
- the Unique identifier of the resource within the application.application
- the application this resource will be added to.Method Detail |
---|
public String getMIMEType()
getMIMEType
in interface Resource
Resource.getMIMEType()
public Application getApplication()
getApplication
in interface ApplicationResource
ApplicationResource.getApplication()
public String getFilename()
getFilename
in interface ApplicationResource
ApplicationResource.getFilename()
public DownloadStream getStream()
getStream
in interface ApplicationResource
ApplicationResource.getStream()
public int getBufferSize()
ApplicationResource
If the buffer size is 0, the buffer size is decided by the terminal adapter. The default value is 0.
getBufferSize
in interface ApplicationResource
public void setBufferSize(int bufferSize)
bufferSize
- the size of the buffer in bytes.public long getCacheTime()
ApplicationResource
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
.
getCacheTime
in interface ApplicationResource
public void setCacheTime(long cacheTime)
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.
cacheTime
- the cache time in milliseconds.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |