|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.terminal.StreamResource
public class StreamResource
StreamResource
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.
Nested Class Summary | |
---|---|
static interface |
StreamResource.StreamSource
Interface implemented by the source of a StreamResource. |
Field Summary |
---|
Fields inherited from interface com.vaadin.terminal.ApplicationResource |
---|
DEFAULT_CACHETIME |
Constructor Summary | |
---|---|
StreamResource(StreamResource.StreamSource streamSource,
String filename,
Application application)
Creates a new stream resource for downloading from stream. |
Method Summary | |
---|---|
Application |
getApplication()
Gets the application of the 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 filename. |
String |
getMIMEType()
Gets the MIME type of the resource. |
DownloadStream |
getStream()
Gets resource as stream. |
StreamResource.StreamSource |
getStreamSource()
Returns the source for this StreamResource . |
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. |
void |
setFilename(String filename)
Sets the filename. |
void |
setMIMEType(String MIMEType)
Sets the mime type of the resource. |
void |
setStreamSource(StreamResource.StreamSource streamSource)
Sets the source for this StreamResource . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamResource(StreamResource.StreamSource streamSource, String filename, Application application)
streamSource
- the source Stream.filename
- the name of the file.application
- the Application object.Method Detail |
---|
public String getMIMEType()
Resource
getMIMEType
in interface Resource
Resource.getMIMEType()
public void setMIMEType(String MIMEType)
MIMEType
- the MIME type to be set.public StreamResource.StreamSource getStreamSource()
StreamResource
. StreamSource is
queried when the resource is about to be streamed to the client.
public void setStreamSource(StreamResource.StreamSource streamSource)
StreamResource
.
StreamSource
is queried when the resource is about to be
streamed to the client.
streamSource
- the source to set.public String getFilename()
getFilename
in interface ApplicationResource
public void setFilename(String filename)
filename
- the filename to set.public Application getApplication()
ApplicationResource
getApplication
in interface ApplicationResource
ApplicationResource.getApplication()
public DownloadStream getStream()
ApplicationResource
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 |