Class AttachmentOptions

java.lang.Object
io.qameta.allure.AttachmentOptions

public final class AttachmentOptions extends Object
Additional options for an attachment.

When file extension is not set, it will be detected from the attachment content type when possible. Use an empty string as file extension to force no extension.

  • Constructor Details

    • AttachmentOptions

      public AttachmentOptions()
  • Method Details

    • empty

      public static AttachmentOptions empty()
      Creates empty attachment options. The file extension will be detected from the attachment content type when possible.
      Returns:
      empty attachment options
    • withFileExtension

      public static AttachmentOptions withFileExtension(String fileExtension)
      Creates attachment options with the file extension.
      Parameters:
      fileExtension - the attachment file extension
      Returns:
      attachment options
    • getFileExtension

      public String getFileExtension()
      Gets attachment file extension.
      Returns:
      attachment file extension
    • setFileExtension

      public AttachmentOptions setFileExtension(String fileExtension)
      Sets attachment file extension. Use null to detect the extension from the attachment content type when possible, or an empty string to force no extension.
      Parameters:
      fileExtension - the attachment file extension
      Returns:
      this instance for method chaining