Package com.vaadin.flow.server
Class AbstractStreamResource
java.lang.Object
com.vaadin.flow.server.AbstractStreamResource
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
StreamReceiver
,StreamResource
Abstract stream resource class. Extending class may be used for data transfer
in either to the client (dynamic data) or from the client (file upload).
- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Gets the length of cache expiration time.getId()
Gets unique identifier of the resource.abstract String
getName()
Get the resource name.setCacheTime
(long cacheTime) Set cache time in millis.
-
Constructor Details
-
AbstractStreamResource
public AbstractStreamResource()
-
-
Method Details
-
getCacheTime
public long getCacheTime()Gets the length of cache expiration time. This gives the possibility to cache the resource. "Cache-Control" HTTP header will be set based on this value.Default value is
0
. So caching is disabled.- Returns:
- cache time in milliseconds.
-
setCacheTime
Set cache time in millis. Zero or negative value disables the caching of this stream.- Parameters:
cacheTime
- cache time- Returns:
- this resource
-
getId
Gets unique identifier of the resource.- Returns:
- the resource unique id
-
getName
Get the resource name.The value will be used in URI (generated when resource is registered) in a way that the
name
is the last segment of the path. So this is a synthetic name.- Returns:
- resource name
-