Package com.vaadin.flow.server
Class StreamReceiver
- java.lang.Object
-
- com.vaadin.flow.server.AbstractStreamResource
-
- com.vaadin.flow.server.StreamReceiver
-
- All Implemented Interfaces:
Serializable
public class StreamReceiver extends AbstractStreamResource
Represents a receiver for data upload from the client.The instance should be registered via
StreamResourceRegistry.registerResource(AbstractStreamResource). This method returns an object which may be used to get resource URI.- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StreamReceiver(StateNode node, String resourceName, StreamVariable streamVariable)CreatesStreamReceiverinstance forstreamVariableas a data receiver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Get the resource name.StateNodegetNode()Get the node that this stream receiver is linked to.StreamVariablegetStreamVariable()Get theStreamVariablefor this stream receiver.-
Methods inherited from class com.vaadin.flow.server.AbstractStreamResource
getCacheTime, getId, setCacheTime
-
-
-
-
Constructor Detail
-
StreamReceiver
public StreamReceiver(StateNode node, String resourceName, StreamVariable streamVariable)
CreatesStreamReceiverinstance forstreamVariableas a data receiver.resourceNameparameter value will be used in URI (generated when resource is registered) in a way that theresourceNameis the last segment of the path. So this is synthetic file name (not real one).- Parameters:
node- receiver noderesourceName- resource name for registration URIstreamVariable- stream variable for controlling the upload stream
-
-
Method Detail
-
getNode
public StateNode getNode()
Get the node that this stream receiver is linked to.- Returns:
- bound node
-
getStreamVariable
public StreamVariable getStreamVariable()
Get theStreamVariablefor this stream receiver.- Returns:
- stream variable for this receiver
-
getName
public String getName()
Description copied from class:AbstractStreamResourceGet the resource name.The value will be used in URI (generated when resource is registered) in a way that the
nameis the last segment of the path. So this is a synthetic name.- Specified by:
getNamein classAbstractStreamResource- Returns:
- resource name
-
-