Class StreamingStartEventImpl
java.lang.Object
com.vaadin.flow.server.communication.streaming.StreamingStartEventImpl
- All Implemented Interfaces:
StreamVariable.StreamingEvent,StreamVariable.StreamingStartEvent,Serializable
public final class StreamingStartEventImpl
extends Object
implements StreamVariable.StreamingStartEvent
Implementation for
StreamVariable.StreamingStartEvent.- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStreamingStartEventImpl(String filename, String type, long contentLength) Streaming start event constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidThe owner of the StreamVariable can call this method to inform the implementation that this StreamVariable will not be used to accept more post.final longGet the number of bytes streamed.final longGet the content length.final StringGet the file name for the stream.final StringGet the mime type for the stream.booleanGet if stream resource should be unregistered.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.server.StreamVariable.StreamingEvent
getBytesReceived, getContentLength, getFileName, getMimeType
-
Constructor Details
-
StreamingStartEventImpl
Streaming start event constructor.- Parameters:
filename- filenametype- file typecontentLength- content length
-
-
Method Details
-
disposeStreamVariable
public void disposeStreamVariable()Description copied from interface:StreamVariable.StreamingStartEventThe owner of the StreamVariable can call this method to inform the implementation that this StreamVariable will not be used to accept more post.- Specified by:
disposeStreamVariablein interfaceStreamVariable.StreamingStartEvent
-
isDisposed
public boolean isDisposed()Get if stream resource should be unregistered.- Returns:
- true if stream variable should be unregistered
-
getFileName
Description copied from interface:StreamVariable.StreamingEventGet the file name for the stream.- Specified by:
getFileNamein interfaceStreamVariable.StreamingEvent- Returns:
- the file name of the streamed file if known
-
getMimeType
Description copied from interface:StreamVariable.StreamingEventGet the mime type for the stream.- Specified by:
getMimeTypein interfaceStreamVariable.StreamingEvent- Returns:
- the mime type of the streamed file if known
-
getContentLength
public final long getContentLength()Description copied from interface:StreamVariable.StreamingEventGet the content length.- Specified by:
getContentLengthin interfaceStreamVariable.StreamingEvent- Returns:
- the length of the stream (in bytes) if known, else -1
-
getBytesReceived
public final long getBytesReceived()Description copied from interface:StreamVariable.StreamingEventGet the number of bytes streamed.- Specified by:
getBytesReceivedin interfaceStreamVariable.StreamingEvent- Returns:
- then number of bytes streamed to StreamVariable
-