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

com.sas.services.publish
Class MailAttachment

com.sas.services.publish.MailAttachment

public class MailAttachment

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
static int ATTACHMENT_PATH_TYPE_DAV
          Attachment specified as a WebDAV URL location
static int ATTACHMENT_PATH_TYPE_FILE
          Attachment specified as a physical filesystem path.
static int ATTACHMENT_PATH_TYPE_NONE
          No path information specified.
static int ATTACHMENT_PATH_TYPE_URL
          Attachment specified as a URL.
 
Constructor Summary
MailAttachment(java.io.InputStream inputStream, java.lang.String contentId, java.lang.String name, java.lang.String contentType)
          Create an input stream attachment object.
MailAttachment(java.lang.String path, java.lang.String contentId, java.lang.String name, java.lang.String contentType)
          Create an file-system attachment object.
MailAttachment(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String contentId, java.lang.String name, java.lang.String contentType)
          Create a WebDAV attachment object.
MailAttachment(java.net.URL url, java.lang.String contentId, java.lang.String name, java.lang.String contentType)
          Create a URL attachment object.
 
Method Summary
 java.lang.String getContentId()
          The Content-Id to use when defining this mail attachment.
 java.lang.String getContentType()
          Return the MIME type of the attachment.
 java.io.InputStream getInputStream()
          Return the input stream that identifies the attachment.
 java.lang.String getName()
          Return the name of the attachment file as it will appear in the mail message.
 java.lang.String getPassword()
           
 java.lang.String getPath()
          Return the name of the attachment file.
 int getType()
          Return the type of path specification.
 java.net.URL getURL()
          Return the name of the attachment file.
 java.lang.String getUser()
           
 

Field Detail

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 Detail

MailAttachment

public MailAttachment(java.lang.String path,
                      java.lang.String contentId,
                      java.lang.String name,
                      java.lang.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(java.lang.String url,
                      java.lang.String user,
                      java.lang.String password,
                      java.lang.String contentId,
                      java.lang.String name,
                      java.lang.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(java.net.URL url,
                      java.lang.String contentId,
                      java.lang.String name,
                      java.lang.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(java.io.InputStream inputStream,
                      java.lang.String contentId,
                      java.lang.String name,
                      java.lang.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 Detail

getType

public int getType()
Return the type of path specification. Supported values include ATTACHMENT_PATH_TYPE_FILE,ATTACHMENT_PATH_TYPE_URLor 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 java.lang.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 java.lang.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 java.lang.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 java.net.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 java.lang.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 java.io.InputStream getInputStream()
Return the input stream that identifies the attachment.

Returns:
The input stream.

getUser

public java.lang.String getUser()

getPassword

public java.lang.String getPassword()

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.