Package com.vaadin.flow.server.streams
Class UploadEvent
java.lang.Object
com.vaadin.flow.server.streams.UploadEvent
Class containing data on requested client upload to server.
- Since:
- 24.8
-
Constructor Summary
ConstructorsConstructorDescriptionUploadEvent
(VaadinRequest request, VaadinResponse response, VaadinSession session, String fileName, long contentLength, String contentType, Element owningElement, org.apache.commons.fileupload2.core.FileItemInput item, jakarta.servlet.http.Part part) Create a new download event with required data. -
Method Summary
Modifier and TypeMethodDescriptionGet the content type for the data to download.Get the set file name for current upload.long
Get the content type for the data to download.Returns an input stream from which the request content can be read.Get ownerComponent
for this event.Get the owning element for the upload related to this event.GetVaadinRequest
for download event.GetVaadinResponse
for download event.GetVaadinSession
for download event.getUI()
Return the UI for this upload event.
-
Constructor Details
-
UploadEvent
public UploadEvent(VaadinRequest request, VaadinResponse response, VaadinSession session, String fileName, long contentLength, String contentType, Element owningElement, org.apache.commons.fileupload2.core.FileItemInput item, jakarta.servlet.http.Part part) Create a new download event with required data.- Parameters:
request
- current requestresponse
- current response to write response data tosession
- current sessionfileName
- defined download file namecontentType
- content type string for uploadcontentLength
- size of the uploadowningElement
- element owning this uploaditem
- multipart stream file item,null
for xhr or parts multipart streampart
- multipart part item,null
for xhr or multipart file stream
-
-
Method Details
-
getInputStream
Returns an input stream from which the request content can be read.- Returns:
- the input stream from which the contents of the request can be read
-
getRequest
GetVaadinRequest
for download event.- Returns:
- vaadin request
-
getResponse
GetVaadinResponse
for download event.- Returns:
- vaadin response
-
getSession
GetVaadinSession
for download event.- Returns:
- vaadin session
-
getFileName
Get the set file name for current upload.The file name will only be available for multipart uploads.
- Returns:
- file name
-
getContentType
Get the content type for the data to download.The content type will only be available for multipart uploads.
- Returns:
- set content type
-
getFileSize
public long getFileSize()Get the content type for the data to download.- Returns:
- set content type
-
getOwningComponent
Get ownerComponent
for this event.- Returns:
- owning component or null in none defined
-
getOwningElement
Get the owning element for the upload related to this event.- Returns:
- owning element
-
getUI
Return the UI for this upload event.- Returns:
- UI for upload event
-