Class MailService.Attachment

java.lang.Object
com.google.appengine.api.mail.MailService.Attachment
Enclosing interface:
MailService

public static class MailService.Attachment extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Attachment(String fileName, byte[] data)
    Attachments are an optional part of messages, but if present, all information about them must be provided.
    Attachment(String fileName, byte[] data, @Nullable String contentID)
    Attachments are an optional part of messages, but if present, all information about them must be provided.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable String
     
    byte[]
    Gets the content of this attachment.
    Gets the file name of this attachment.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Attachment

      public Attachment(String fileName, byte[] data)
      Attachments are an optional part of messages, but if present, all information about them must be provided.
      Parameters:
      fileName - The attachment must have a filename associated with it. The extension on that filename must be present and not blocked, or there will be a failure at send time.
      data - An array with arbitrary byte content. The array must be be present, but may be of zero length.
      Throws:
      IllegalArgumentException - if either fileName or data are missing.
    • Attachment

      public Attachment(String fileName, byte[] data, @Nullable String contentID)
      Attachments are an optional part of messages, but if present, all information about them must be provided.
      Parameters:
      fileName - The attachment must have a filename associated with it. The extension on that filename must be present and blocked, or there will be a failure at send time.
      data - An array with arbitrary byte content. The array must be be present, but may be of zero length.
      contentID - The attachment's content ID. May be null.
      Throws:
      IllegalArgumentException - if either fileName or data are missing.
  • Method Details

    • getFileName

      public String getFileName()
      Gets the file name of this attachment.
      Returns:
      The file name of this attachment.
    • getData

      public byte[] getData()
      Gets the content of this attachment.
      Returns:
      The raw data of this attachment.
    • getContentID

      public @Nullable String getContentID()