com.vaadin.flow.server.

Class 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:

  • Constructor Details

    • StreamReceiver

      public StreamReceiver(StateNode node, String resourceName, StreamVariable streamVariable)

      Creates StreamReceiver instance for streamVariable as a data receiver.

      resourceName parameter value will be used in URI (generated when resource is registered) in a way that the resourceName is the last segment of the path. So this is synthetic file name (not real one).

      Parameters:

      node - receiver node

      resourceName - resource name for registration URI

      streamVariable - stream variable for controlling the upload stream

  • Method Details

    • getNode

      public StateNode getNode()

      Get the node that this stream receiver is linked to.

      Returns:

      bound node

    • getStreamVariable

      public StreamVariable getStreamVariable()

      Get the StreamVariable for this stream receiver.

      Returns:

      stream variable for this receiver

    • getName

      public String getName()

      Description copied from class: AbstractStreamResource

      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.

      Specified by:

      getName in class AbstractStreamResource

      Returns:

      resource name