### *** This class provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.services.publish

# Class MailAttachment

java.lang.Object
com.sas.services.publish.MailAttachment

@SASScope("ALL") @BinaryCompatibilityOnly public class MailAttachment extends Object
Container class for maintaining email attachment information.

This class is a utility class for mail transports and is not intended to be invoked directly by the calling application.

Since:
  1.1.4

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `ATTACHMENT_PATH_TYPE_DAV`
  Attachment specified as a WebDAV URL location
  `static final int`
  `ATTACHMENT_PATH_TYPE_FILE`
  Attachment specified as a physical filesystem path.
  `static final int`
  `ATTACHMENT_PATH_TYPE_NONE`
  No path information specified.
  `static final int`
  `ATTACHMENT_PATH_TYPE_URL`
  Attachment specified as a URL.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MailAttachment(InputStream inputStream, String contentId, String name, String contentType)`
  Create an input stream attachment object.
  `MailAttachment(String path, String contentId, String name, String contentType)`
  Create an file-system attachment object.
  `MailAttachment(String url, String user, String password, String contentId, String name, String contentType)`
  Create a WebDAV attachment object.
  `MailAttachment(URL url, String contentId, String name, String contentType)`
  Create a URL attachment object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getContentId()`
  The Content-Id to use when defining this mail attachment.
  `String`
  `getContentType()`
  Return the MIME type of the attachment.
  `InputStream`
  `getInputStream()`
  Return the input stream that identifies the attachment.
  `String`
  `getName()`
  Return the name of the attachment file as it will appear in the mail message.
  `String`
  `getPassword()`
  `String`
  `getPath()`
  Return the name of the attachment file.
  `int`
  `getType()`
  Return the type of path specification.
  `URL`
  `getURL()`
  Return the name of the attachment file.
  `String`
  `getUser()`

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

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

- ## Field Details

  - ### ATTACHMENT_PATH_TYPE_NONE

    public static final int ATTACHMENT_PATH_TYPE_NONE
    No path information specified. The attachment was specified as an input stream.
    See Also:
      - Constant Field Values

  - ### ATTACHMENT_PATH_TYPE_FILE

    public static final int ATTACHMENT_PATH_TYPE_FILE
    Attachment specified as a physical filesystem path.
    See Also:
      - Constant Field Values

  - ### ATTACHMENT_PATH_TYPE_URL

    public static final int ATTACHMENT_PATH_TYPE_URL
    Attachment specified as a URL.
    See Also:
      - Constant Field Values

  - ### ATTACHMENT_PATH_TYPE_DAV

    public static final int ATTACHMENT_PATH_TYPE_DAV
    Attachment specified as a WebDAV URL location
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### MailAttachment

    public MailAttachment(String path, String contentId, String name, String contentType)
    Create an file-system attachment object.
    Parameters:
      `path` - Complete path, including the filename, of the file to include as an attachment.
      `contentId` - The Content-Id to use when defining this mail attachment. If non-null, then the attachment will be embedded in the mail message. If `null`, the file will not be embedded but will be included as an attachment.
      `name` - The name of the attachment file as it will appear in the mail message. If `null` is specified, the file name will be used.
      `contentType` - The MIME type of the attachment. If `null` is specified, the MIME type will be determined by the file extension or content.

  - ### MailAttachment

    public MailAttachment(String url, String user, String password, String contentId, String name, String contentType)
    Create a WebDAV attachment object.
    Parameters:
      `url` - the URL path as a string that identifies the attachment file on a WebDAV server.
      `contentId` - The Content-Id to use when defining this mail attachment. If non-null, then the attachment will be embedded in the mail message. If `null`, the file will not be embedded but will be included as an attachment.
      `name` - The name of the attachment file as it will appear in the mail message. If `null` is specified, the file name will be used.
      `contentType` - The MIME type of the attachment. If `null` is specified, the MIME type will be determined by the file extension or content.

  - ### MailAttachment

    public MailAttachment(URL url, String contentId, String name, String contentType)
    Create a URL attachment object.
    Parameters:
      `url` - the URL that identifies the attachment file.
      `contentId` - The Content-Id to use when defining this mail attachment. If non-null, then the attachment will be embedded in the mail message. If `null`, the file will not be embedded but will be included as an attachment.
      `name` - The name of the attachment file as it will appear in the mail message. If `null` is specified, the file name will be used.
      `contentType` - The MIME type of the attachment. If `null` is specified, the MIME type will be determined by the file extension or content.

  - ### MailAttachment

    public MailAttachment(InputStream inputStream, String contentId, String name, String contentType)
    Create an input stream attachment object.
    Parameters:
      `inputStream` - The input stream for the attachment.
      `contentId` - The Content-Id to use when defining this mail attachment. If non-null, then the attachment will be embedded in the mail message. If `null`, the file will not be embedded but will be included as an attachment.
      `name` - The name of the attachment file as it will appear in the mail message.
      `contentType` - The MIME type of the attachment.

- ## Method Details

  - ### getType

    public int getType()
    Return the type of path specification. Supported values include `ATTACHMENT_PATH_TYPE_FILE`,`ATTACHMENT_PATH_TYPE_URL`or `ATTACHMENT_PATH_TYPE_NONE`.
    Returns:
      int The type of file specification. The attachment file can be specified by a file system path, a URL or input stream. If specified as an input stream, `ATTACHMENT_PATH_TYPE_NONE` will be returned.

  - ### getContentType

    public String getContentType()
    Return the MIME type of the attachment.
    Returns:
      String The MIME type. This may be `null` in which case the MIME type will be determined by the underlying mail implementation based on the file extension or file content.

  - ### getName

    public String getName()
    Return the name of the attachment file as it will appear in the mail message.
    Returns:
      The name of the attachment file as it will appear in the mail message.

  - ### getPath

    public String getPath()
    Return the name of the attachment file. This should be the full path, including the filename.
    Returns:
      The attachment file name

  - ### getURL

    public URL getURL()
    Return the name of the attachment file. This should be the full path, including the filename.
    Returns:
      The URL that identifies the attachment. This may be `null` if the attachment was specified as a file system path or an input stream.

  - ### getContentId

    public String getContentId()
    The Content-Id to use when defining this mail attachment. If non-null, then the attachment will be embedded in the mail message.
    Returns:
      String The Content-Id for this attachment.

  - ### getInputStream

    public InputStream getInputStream()
    Return the input stream that identifies the attachment.
    Returns:
      The input stream.

  - ### getUser

    public String getUser()

  - ### getPassword

    public String getPassword()