i2p.susi.webmail

## Class Draft

- java.lang.Object
- - i2p.susi.webmail.Mail
  - - i2p.susi.webmail.Draft

-     class Draft
      extends Mail

  Represents a draft email message with attachments and Bcc support. Differences from Mail: - Never multipart, body is always text/plain UTF-8 - Attachments are just headers containing name, type, encoding, and path to file - Bcc is a header

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `HDR_BCC`

    - ### Fields inherited from class i2p.susi.webmail.Mail

      `cc, contentType, date, dateOnly, dateString, error, formattedDate, HEADER_MATCH, localFormattedDate, markForDeletion, messageID, quotedDate, reply, sender, shortSender, shortSubject, subject, to, uidl`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Draft(String uidl)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addAttachment(Attachment a)`
    `void` | `clearAttachments()`
    `StringBuilder` | `encodeAttachments()`
    `List<Attachment>` | `getAttachments()`
    `String[]` | `getBcc()`
    `long` | `getSize()` Includes size of attachments
    `boolean` | `hasAttachment()`
    `void` | `removeAttachment(int index)`
    `void` | `setBody(Buffer rb)` Overridden to process attachment and Bcc headers
    `void` | `setSize(long size)`

    - ### Methods inherited from class i2p.susi.webmail.Mail

      `appendRecipients, appendRecipients, getAddress, getAttachmentType, getBody, getHeader, getPart, getRecipientsFromList, getRecipientsFromList, hasBody, hasHeader, hasPart, isNew, isSpam, setHeader, setNew, validateAddress`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### HDR_BCC

          public static final String HDR_BCC

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Draft

          public Draft(String uidl)

  - ### Method Detail

    - #### addAttachment

          public int addAttachment(Attachment a)

    - #### clearAttachments

          public void clearAttachments()

    - #### encodeAttachments

          public StringBuilder encodeAttachments()

    - #### getAttachments

          public List<Attachment> getAttachments()

      Returns:
        non-null, not a copy

    - #### getBcc

          public String[] getBcc()

      Returns:
        may be null

    - #### getSize

          public long getSize()

      Includes size of attachments
      Overrides:
        `getSize` in class `Mail`
      Returns:
        0 if unknown

    - #### hasAttachment

          public boolean hasAttachment()

      Overrides:
        `hasAttachment` in class `Mail`

    - #### removeAttachment

          public void removeAttachment(int index)

    - #### setBody

          public void setBody(Buffer rb)

      Overridden to process attachment and Bcc headers
      Overrides:
        `setBody` in class `Mail`

    - #### setSize

          public void setSize(long size)

      Overrides:
        `setSize` in class `Mail`