Interface IFileDownloadProvider


public interface IFileDownloadProvider
File providers are used by Saga to provide downloadable files to users of both: web and Mobile. Links to download the files provided by the provider implementations are exposed to web and mobile pages with the FileLink extension link in buttons and other components that support having an ExtensionLink added to them. See ExtensionLink.file(Class)
  • Method Details

    • writeContent

      void writeContent(IInputData inputData, IFileDownload fileDownload)
      Write the content and attributes of the file to the provided file download object, with the aid of any parameters specified in the ExtensionLink.file(Class) method call, and retrieved through the inputData object similar to how it is done in IFrontendComponent.handle(IPage, IInputData)
      Parameters:
      inputData - - map containing the parameters specified in the ExtensionLink.file(Class) method call
      fileDownload - - file download interface to specify the file attributes, and how the content should be written

      Tip: For big files, you may want to consider writing to the output stream in batches, and avoid loading it all into memory, to preserve memory resources and prevent crashing the application.