Module io.jooby
Package io.jooby

Class AttachedFile


public class AttachedFile extends FileDownload
Represents a file attachment response.
Since:
2.0.0
Author:
edgar
  • Constructor Details

    • AttachedFile

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

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

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

      public AttachedFile(@NonNull Path file) throws IOException
      Creates a new file attachment.
      Parameters:
      file - File content.
      Throws:
      IOException - For IO exception while reading file.