Class JmixFileDownloader

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Anchor>
io.jmix.flowui.component.filedownloader.JmixFileDownloader
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, Serializable

@Deprecated(since="2.8", forRemoval=true) public class JmixFileDownloader extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Anchor>
Deprecated, for removal: This API element is subject to removal in a future version.
use DownloaderExportHandler with a regular Anchor instead. Will be removed either in the next major release or when Vaadin remove StreamResource.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static class 
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected com.vaadin.flow.function.SerializableConsumer<OutputStream>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected com.vaadin.flow.server.RequestHandler
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    com.vaadin.flow.shared.Registration
    addDownloadFinishedListener(com.vaadin.flow.component.ComponentEventListener<JmixFileDownloader.DownloadFinishedEvent> listener)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a listener that is executed when the file content has been streamed.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected void
    beforeClientResponseDownloadHandler(com.vaadin.flow.component.UI ui)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    downloadFile(com.vaadin.flow.server.StreamResource resource)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    getFileName(com.vaadin.flow.server.VaadinSession session, com.vaadin.flow.server.VaadinRequest request)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the filename of downloaded file.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected void
    onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected void
    runBeforeClientResponse(com.vaadin.flow.function.SerializableConsumer<com.vaadin.flow.component.UI> command)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected void
    runCommand(com.vaadin.flow.server.StreamResource resource)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setCacheMaxAgeSec(int cacheMaxAgeSec)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the maximum time in seconds during which the file will be considered relevant.
    void
    setFileName(String fileName)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    viewDocument(com.vaadin.flow.server.StreamResource resource)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class com.vaadin.flow.component.Composite

    getChildren, getContent, getElement, initContent

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Field Details

    • DOWNLOAD_RESOURCE_PREFIX

      protected static final String DOWNLOAD_RESOURCE_PREFIX
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • CLICK_EXPRESSION

      protected static final String CLICK_EXPRESSION
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • fileName

      protected String fileName
      Deprecated, for removal: This API element is subject to removal in a future version.
    • cacheMaxAgeSec

      protected int cacheMaxAgeSec
      Deprecated, for removal: This API element is subject to removal in a future version.
    • requestHandler

      protected com.vaadin.flow.server.RequestHandler requestHandler
      Deprecated, for removal: This API element is subject to removal in a future version.
    • contentWriter

      protected com.vaadin.flow.function.SerializableConsumer<OutputStream> contentWriter
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isViewDocumentRequest

      protected boolean isViewDocumentRequest
      Deprecated, for removal: This API element is subject to removal in a future version.
    • contentType

      protected String contentType
      Deprecated, for removal: This API element is subject to removal in a future version.
    • fileNotFoundExceptionHandler

      protected Predicate<JmixFileDownloader.FileNotFoundContext> fileNotFoundExceptionHandler
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • JmixFileDownloader

      public JmixFileDownloader()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • setCacheMaxAgeSec

      public void setCacheMaxAgeSec(int cacheMaxAgeSec)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the maximum time in seconds during which the file will be considered relevant. Makes sense for using the built-in PDF viewer in the Chrome browser.
      Parameters:
      cacheMaxAgeSec - the maximum time in seconds during which the file will be considered relevant
      See Also:
    • setFileName

      public void setFileName(String fileName)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getFileName

      public String getFileName(com.vaadin.flow.server.VaadinSession session, com.vaadin.flow.server.VaadinRequest request)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the filename of downloaded file. Override if you want to generate the name dynamically.
      Parameters:
      session - the vaadin session
      request - the vaadin request
      Returns:
      the file name
    • setFileNotFoundExceptionHandler

      public void setFileNotFoundExceptionHandler(Predicate<JmixFileDownloader.FileNotFoundContext> fileNotFoundExceptionHandler)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getFileNotFoundExceptionHandler

      public Predicate<JmixFileDownloader.FileNotFoundContext> getFileNotFoundExceptionHandler()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • addDownloadFinishedListener

      public com.vaadin.flow.shared.Registration addDownloadFinishedListener(com.vaadin.flow.component.ComponentEventListener<JmixFileDownloader.DownloadFinishedEvent> listener)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a listener that is executed when the file content has been streamed. Note that the UI changes done in the listener don't necessarily happen live if you don't have @Push in use or use UI.setPollInterval(int) method.
      Parameters:
      listener - the listener
      Returns:
      the Registration you can use to remove this listener.
    • downloadFile

      public void downloadFile(com.vaadin.flow.server.StreamResource resource)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • viewDocument

      public void viewDocument(com.vaadin.flow.server.StreamResource resource)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • runCommand

      protected void runCommand(com.vaadin.flow.server.StreamResource resource)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • execute

      protected void execute()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • beforeClientResponseDownloadHandler

      protected void beforeClientResponseDownloadHandler(com.vaadin.flow.component.UI ui)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • onDetach

      protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      onDetach in class com.vaadin.flow.component.Component
    • afterWriteHandler

      protected void afterWriteHandler(OutputStream outputStream)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • runBeforeClientResponse

      protected void runBeforeClientResponse(com.vaadin.flow.function.SerializableConsumer<com.vaadin.flow.component.UI> command)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • accessCommand

      protected void accessCommand()
      Deprecated, for removal: This API element is subject to removal in a future version.