Package com.vaadin.flow.server.streams
Interface UploadHeaderCallback
- All Superinterfaces:
Serializable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Callback for validating the leading bytes of an upload, used with
AbstractUploadHandler.validateHeader(int, UploadHeaderCallback).
Call UploadEvent.reject(String) to refuse the upload. See
UploadValidator.validateHeader(UploadEvent, ByteBuffer) for the phase
semantics.
-
Method Summary
Modifier and TypeMethodDescriptionvoidvalidate(UploadEvent event, ByteBuffer header) Validates the header (leading bytes) of an upload, rejecting it viaUploadEvent.reject(String)if it must not be stored.
-
Method Details
-
validate
Validates the header (leading bytes) of an upload, rejecting it viaUploadEvent.reject(String)if it must not be stored.- Parameters:
event- the current uploadheader- a read-only view of the leading bytes of the upload, up to the requested size (fewer if the upload is smaller); only valid for the duration of the call- Throws:
IOException- if validation fails; treated as a transfer error
-