Module io.jooby
Package io.jooby

Class FileDownload

java.lang.Object
io.jooby.FileDownload
Direct Known Subclasses:
AttachedFile, InlineFile

public class FileDownload extends Object
Represents a file download.
Since:
2.9.0
Author:
edgar, imeszaros
  • Constructor Details

    • FileDownload

      public FileDownload(FileDownload.Mode mode, @NonNull InputStream content, @NonNull String fileName, long fileSize)
      Creates a new file attachment.
      Parameters:
      mode - Download mode.
      content - File content.
      fileName - Filename.
      fileSize - File size or -1 if unknown.
    • FileDownload

      public FileDownload(FileDownload.Mode mode, @NonNull InputStream content, @NonNull String fileName)
      Creates a new file attachment.
      Parameters:
      mode - Download mode.
      content - File content.
      fileName - Filename.
    • FileDownload

      public FileDownload(FileDownload.Mode mode, @NonNull byte[] content, @NonNull String fileName)
      Creates a new file attachment.
      Parameters:
      mode - Download mode.
      content - File content.
      fileName - Filename.
    • FileDownload

      public FileDownload(FileDownload.Mode mode, @NonNull Path file, @NonNull String fileName) throws IOException
      Creates a new file attachment.
      Parameters:
      mode - Download mode.
      file - File content.
      fileName - Filename.
      Throws:
      IOException - For IO exception while reading file.
    • FileDownload

      public FileDownload(FileDownload.Mode mode, @NonNull Path file) throws IOException
      Creates a new file attachment.
      Parameters:
      mode - Download mode.
      file - File content.
      Throws:
      IOException - For IO exception while reading file.
  • Method Details