com.vaadin.flow.server.
Class AbstractStreamResource
- java.lang.Object
-
- com.vaadin.flow.server.AbstractStreamResource
-
All Implemented Interfaces:
Direct Known Subclasses:
public abstract class AbstractStreamResource extends Object implements Serializable
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
Constructors Constructor Description AbstractStreamResource()
-
Method Summary
All Methods Modifier and Type Method Description long
getCacheTime()
Gets the length of cache expiration time.
String
getId()
Gets unique identifier of the resource.
abstract String
getName()
Get the resource name.
AbstractStreamResource
setCacheTime(long cacheTime)
Set cache time in millis.
-
-
-
Method Detail
-
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
public AbstractStreamResource setCacheTime(long cacheTime)
Set cache time in millis. Zero or negative value disables the caching of this stream.
Parameters:
cacheTime
- cache timeReturns:
this resource
-
getId
public String getId()
Gets unique identifier of the resource.
Returns:
the resource unique id
-
getName
public abstract String 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
-
-