Package io.jmix.flowui.download
Class DownloaderExportHandler
java.lang.Object
com.vaadin.flow.server.streams.TransferProgressAwareHandler<com.vaadin.flow.server.streams.DownloadEvent,R>
com.vaadin.flow.server.streams.AbstractDownloadHandler<DownloaderExportHandler>
io.jmix.flowui.download.DownloaderExportHandler
- All Implemented Interfaces:
com.vaadin.flow.server.streams.DownloadHandler,com.vaadin.flow.server.streams.ElementRequestHandler,SupportDownloadSuccessHandler,TransferProgressNotifier,Serializable
@Component("flowui_DownloaderExportHandler")
@Scope("prototype")
public class DownloaderExportHandler
extends com.vaadin.flow.server.streams.AbstractDownloadHandler<DownloaderExportHandler>
implements TransferProgressNotifier, SupportDownloadSuccessHandler
A handler for managing file download/view requests triggered by
Downloader.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents context information about a file not found error during download.Nested classes/interfaces inherited from interface io.jmix.flowui.download.SupportDownloadSuccessHandler
SupportDownloadSuccessHandler.DownloadSuccessContext, SupportDownloadSuccessHandler.DownloadSuccessHandler -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddTransferProgressListener(com.vaadin.flow.server.streams.TransferProgressListener listener) protected voidapplyErrorHeaders(com.vaadin.flow.server.VaadinResponse response) voidhandleDownloadRequest(com.vaadin.flow.server.streams.DownloadEvent event) inline()booleanbooleanisInline()voidSets a handler that is invoked when a download operation completes successfully.voidMethods inherited from class com.vaadin.flow.server.streams.AbstractDownloadHandler
getContentType, getTransferContextMethods inherited from class com.vaadin.flow.server.streams.TransferProgressAwareHandler
getListeners, notifyError, onProgress, onProgress, onProgress, onProgress, setTransferUI, uiAccess, whenComplete, whenComplete, whenStart, whenStartMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.server.streams.DownloadHandler
handleRequestMethods inherited from interface com.vaadin.flow.server.streams.ElementRequestHandler
getDisabledUpdateMode, getUrlPostfix
-
Field Details
-
downloadContext
-
successHandler
-
fileNotFoundExceptionHandler
-
-
Constructor Details
-
DownloaderExportHandler
-
-
Method Details
-
setDownloadSuccessHandler
public void setDownloadSuccessHandler(@Nullable SupportDownloadSuccessHandler.DownloadSuccessHandler handler) Description copied from interface:SupportDownloadSuccessHandlerSets a handler that is invoked when a download operation completes successfully.- Specified by:
setDownloadSuccessHandlerin interfaceSupportDownloadSuccessHandler- Parameters:
handler- the handler to be invoked on successful download, ornullto remove the current handler
-
setFileNotFoundExceptionHandler
public void setFileNotFoundExceptionHandler(@Nullable Predicate<DownloaderExportHandler.FileNotFoundContext> handler) -
handleDownloadRequest
public void handleDownloadRequest(com.vaadin.flow.server.streams.DownloadEvent event) throws IOException - Specified by:
handleDownloadRequestin interfacecom.vaadin.flow.server.streams.DownloadHandler- Throws:
IOException
-
applyErrorHeaders
protected void applyErrorHeaders(com.vaadin.flow.server.VaadinResponse response) -
addTransferProgressListener
public com.vaadin.flow.shared.Registration addTransferProgressListener(com.vaadin.flow.server.streams.TransferProgressListener listener) - Specified by:
addTransferProgressListenerin interfaceTransferProgressNotifier- Overrides:
addTransferProgressListenerin classcom.vaadin.flow.server.streams.TransferProgressAwareHandler<com.vaadin.flow.server.streams.DownloadEvent,DownloaderExportHandler>
-
isInline
public boolean isInline()- Overrides:
isInlinein classcom.vaadin.flow.server.streams.AbstractDownloadHandler<DownloaderExportHandler>
-
inline
- Overrides:
inlinein classcom.vaadin.flow.server.streams.AbstractDownloadHandler<DownloaderExportHandler>
-
isAllowInert
public boolean isAllowInert()- Specified by:
isAllowInertin interfacecom.vaadin.flow.server.streams.ElementRequestHandler
-