*** 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
FieldsModifier and TypeFieldDescriptionstatic final intAttachment specified as a WebDAV URL locationstatic final intAttachment specified as a physical filesystem path.static final intNo path information specified.static final intAttachment specified as a URL. -
Constructor Summary
ConstructorsConstructorDescriptionMailAttachment(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 TypeMethodDescriptionStringThe Content-Id to use when defining this mail attachment.StringReturn the MIME type of the attachment.InputStreamReturn the input stream that identifies the attachment.StringgetName()Return the name of the attachment file as it will appear in the mail message.StringStringgetPath()Return the name of the attachment file.intgetType()Return the type of path specification.URLgetURL()Return the name of the attachment file.StringgetUser()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_NONENo path information specified. The attachment was specified as an input stream.- See Also:
-
ATTACHMENT_PATH_TYPE_FILE
public static final int ATTACHMENT_PATH_TYPE_FILEAttachment specified as a physical filesystem path.- See Also:
-
ATTACHMENT_PATH_TYPE_URL
public static final int ATTACHMENT_PATH_TYPE_URLAttachment specified as a URL.- See Also:
-
ATTACHMENT_PATH_TYPE_DAV
public static final int ATTACHMENT_PATH_TYPE_DAVAttachment specified as a WebDAV URL location- See Also:
-
-
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. Ifnull, 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. Ifnullis specified, the file name will be used.contentType- The MIME type of the attachment. Ifnullis 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. Ifnull, 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. Ifnullis specified, the file name will be used.contentType- The MIME type of the attachment. Ifnullis 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. Ifnull, 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. Ifnullis specified, the file name will be used.contentType- The MIME type of the attachment. Ifnullis 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. Ifnull, 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 includeATTACHMENT_PATH_TYPE_FILE,ATTACHMENT_PATH_TYPE_URLorATTACHMENT_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_NONEwill be returned.
-
getContentType
public String getContentType()Return the MIME type of the attachment.- Returns:
- String The MIME type. This may be
nullin 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
nullif 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()
-