Package com.vaadin.flow.server.streams
Interface ElementRequestHandler
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
DownloadHandler
,UploadHandler
- All Known Implementing Classes:
AbstractDownloadHandler
,AbstractFileUploadHandler
,ClassDownloadHandler
,FileDownloadHandler
,FileUploadHandler
,InMemoryUploadHandler
,InputStreamDownloadHandler
,ServletResourceDownloadHandler
,TemporaryFileUploadHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Request handler callback for handing client-server or server-client data
transfer scoped to a specific (owner) element.
-
Method Summary
Modifier and TypeMethodDescriptiondefault DisabledUpdateMode
Controls whether request handler is invoked when the owner element is disabled.default String
Optional URL postfix allows appending an application-controlled string, e.g.void
handleRequest
(VaadinRequest request, VaadinResponse response, VaadinSession session, Element owner) Request handler callback for handing client-server or server-client data transfer scoped to a specific (owner) element.default boolean
Whether to invoke this request handler even if the owning element is currently inert.
-
Method Details
-
handleRequest
void handleRequest(VaadinRequest request, VaadinResponse response, VaadinSession session, Element owner) throws IOException Request handler callback for handing client-server or server-client data transfer scoped to a specific (owner) element. Note: when handling requests via this API, you need to take care of typical stream handling issues, e.g. exceptions yourself. However, you do not need to close the stream yourself, Flow will handle that for you when needed.- Parameters:
request
- VaadinRequest request to handleresponse
- VaadinResponse response to handlesession
- VaadinSession current VaadinSessionowner
- Element owner element- Throws:
IOException
- if an IO error occurred during data transfer
-
getUrlPostfix
Optional URL postfix allows appending an application-controlled string, e.g. the logical name of the target file, to the end of the otherwise random-looking download URL. If defined, requests that would otherwise be routable are still rejected if the postfix is missing or invalid. Postfix changes the last segment in the resource url.- Returns:
- String optional URL postfix, or
null
for "".
-
isAllowInert
default boolean isAllowInert()Whether to invoke this request handler even if the owning element is currently inert.- Returns:
true
to invoke for inert elements,false
otherwise. Defaults tofalse
.
-
getDisabledUpdateMode
Controls whether request handler is invoked when the owner element is disabled.- Returns:
- the currently set DisabledUpdateMode for this request handler. Defaults to ONLY_WHEN_ENABLED.
-