Skip navigation links


com.essbase.eas.ui.email
Class EmailAttachment

java.lang.Object
  extended by com.essbase.eas.ui.email.EmailAttachment


public class EmailAttachment
extends java.lang.Object

Models an email attachment. Wraps a javax.activation.DataSource around an String, File, or URL.


Field Summary
static java.lang.String ATTACHMENT
          Send as an attachment
static java.lang.String HTMLTEXT
          html text
static java.lang.String INLINE
          Send attachment inline
static java.lang.String PLAINTEXT
          normal text
static java.lang.String XMLTEXT
          used for XML text

 

Constructor Summary
EmailAttachment(byte[] bytes, java.lang.String name, java.lang.String type)
          Construct an EmailAttachment from a byte[] array
EmailAttachment(byte[] bytes, java.lang.String name, java.lang.String type, java.lang.String description, java.lang.String disposition)
          Construct an EmailAttachment from a byte[] array
EmailAttachment(java.io.File file)
          Construct an EmailAttachment of a File.
EmailAttachment(java.io.File file, boolean delete)
           
EmailAttachment(java.io.File file, java.lang.String description, java.lang.String disposition)
          Constructs an EmailAttachment of a File that has a description and a disposition.
EmailAttachment(java.io.File file, java.lang.String description, java.lang.String disposition, boolean delete)
           
EmailAttachment(java.io.File file, java.lang.String description, java.lang.String disposition, java.lang.String contentId, boolean delete)
           
EmailAttachment(java.io.File file, java.lang.String name, java.lang.String description, java.lang.String disposition, java.lang.String contentId, boolean delete)
           
EmailAttachment(java.io.InputStream in, java.lang.String name, java.lang.String type, java.lang.String description, java.lang.String disposition)
          Construct an EmailAttachment of an InputStream.
EmailAttachment(java.lang.String content)
          Construct a default String attachment with no name as inline text
EmailAttachment(java.lang.String content, java.lang.String nameOrType, boolean isType)
          Construct a String attachment setting either name or type.
EmailAttachment(java.lang.String content, java.lang.String name, java.lang.String type, java.lang.String description, java.lang.String disposition)
          Construct an EmailAttachment from a String.
EmailAttachment(java.lang.String content, java.lang.String name, java.lang.String type, java.lang.String description, java.lang.String disposition, java.lang.String charset)
          Construct an EmailAttachment from a String.
EmailAttachment(java.net.URL url)
          Construct an EmailAttachment of a URL.
EmailAttachment(java.net.URL url, java.lang.String description, java.lang.String disposition)
          Constructs an EmailAttachment of a File that has a description and a disposition.
EmailAttachment(java.net.URL url, java.lang.String name, java.lang.String contentId, java.lang.String disposition)
          Construct an EmailAttachment of a URL.
EmailAttachment(java.net.URL url, java.lang.String name, java.lang.String contentId, java.lang.String disposition, boolean delete)
          Construct an EmailAttachment of a URL.

 

Method Summary
 void dispose()
           
 java.lang.String getContentId()
          Get the content id for this attachment
 java.lang.String getContentType()
          Get the content type for this attachment
 javax.activation.DataSource getDataSource()
          Get the java.activation.DataSource represented by this object
 java.lang.String getDescription()
          Get the description for this attachment
 java.lang.String getDisposition()
          Get the disposition for this attachment
 java.lang.String getName()
          Get the name for this attachment
 void setDeleteOnExit()
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

ATTACHMENT

public static final java.lang.String ATTACHMENT
Send as an attachment
See Also:
Constant Field Values

INLINE

public static final java.lang.String INLINE
Send attachment inline
See Also:
Constant Field Values

PLAINTEXT

public static final java.lang.String PLAINTEXT
normal text
See Also:
Constant Field Values

HTMLTEXT

public static final java.lang.String HTMLTEXT
html text
See Also:
Constant Field Values

XMLTEXT

public static final java.lang.String XMLTEXT
used for XML text
See Also:
Constant Field Values

Constructor Detail

EmailAttachment

public EmailAttachment(java.lang.String content)
Construct a default String attachment with no name as inline text
Parameters:
content - A String representing the inline attachment content in the UTF-8 charset.

EmailAttachment

public EmailAttachment(java.lang.String content,
                       java.lang.String nameOrType,
                       boolean isType)
Construct a String attachment setting either name or type. If name is used then type is determined by using a MIME type map. This constructor defaults to sending an attachment
Parameters:
content - A String with characters in the iso-8859-1 charset.
nameOrType - a String representing a name or a type
isType - a boolean true means that nameOrType represents the MIME Content-Type of the String.

EmailAttachment

public EmailAttachment(java.lang.String content,
                       java.lang.String name,
                       java.lang.String type,
                       java.lang.String description,
                       java.lang.String disposition)
Construct an EmailAttachment from a String. Thhe String should be in the iso-8859-1 charset. This constructor can be used for inline attachments
Parameters:
content - A String.
name - A String.
type - A String.
description - A String.
disposition - A String.

EmailAttachment

public EmailAttachment(java.lang.String content,
                       java.lang.String name,
                       java.lang.String type,
                       java.lang.String description,
                       java.lang.String disposition,
                       java.lang.String charset)
Construct an EmailAttachment from a String.
Parameters:
content - A String.
name - A String.
type - A String.
description - A String.
disposition - A String.
charset - A String representing a charset used for encoding the string

EmailAttachment

public EmailAttachment(byte[] bytes,
                       java.lang.String name,
                       java.lang.String type)
Construct an EmailAttachment from a byte[] array
Parameters:
bytes - a byte[] representing data to be attached
name - A String.
type - A String.

EmailAttachment

public EmailAttachment(byte[] bytes,
                       java.lang.String name,
                       java.lang.String type,
                       java.lang.String description,
                       java.lang.String disposition)
Construct an EmailAttachment from a byte[] array
Parameters:
bytes - a byte[] representing data to be attached
name - A String.
type - A String.
description - A String.
disposition - A String.

EmailAttachment

public EmailAttachment(java.io.InputStream in,
                       java.lang.String name,
                       java.lang.String type,
                       java.lang.String description,
                       java.lang.String disposition)
Construct an EmailAttachment of an InputStream.
Parameters:
in - An InputStream
name - A String representing the name for this attachment can be null
type - A String representing the MIME Content-Type
description - A String
disposition - A String representing inline or attachment

EmailAttachment

public EmailAttachment(java.net.URL url)
Construct an EmailAttachment of a URL. The URL will be sent as an attachment.
Parameters:
file - A File to be attached

EmailAttachment

public EmailAttachment(java.net.URL url,
                       java.lang.String name,
                       java.lang.String contentId,
                       java.lang.String disposition)
Construct an EmailAttachment of a URL. The URL is sent as an inline attachment. This is used for inline images in HTML attachments.
Parameters:
url -
name -
contentId -

EmailAttachment

public EmailAttachment(java.net.URL url,
                       java.lang.String name,
                       java.lang.String contentId,
                       java.lang.String disposition,
                       boolean delete)
Construct an EmailAttachment of a URL. The URL is sent as an inline attachment. This is used for inline images in HTML attachments.
Parameters:
url -
name -
contentId -

EmailAttachment

public EmailAttachment(java.net.URL url,
                       java.lang.String description,
                       java.lang.String disposition)
Constructs an EmailAttachment of a File that has a description and a disposition.
Parameters:
file - A File
description - A String
disposition - A String

EmailAttachment

public EmailAttachment(java.io.File file)
Construct an EmailAttachment of a File. The file will be sent as an attachment.
Parameters:
file - A File to be attached

EmailAttachment

public EmailAttachment(java.io.File file,
                       boolean delete)

EmailAttachment

public EmailAttachment(java.io.File file,
                       java.lang.String description,
                       java.lang.String disposition)
Constructs an EmailAttachment of a File that has a description and a disposition.
Parameters:
file - A File
description - A String
disposition - A String

EmailAttachment

public EmailAttachment(java.io.File file,
                       java.lang.String description,
                       java.lang.String disposition,
                       boolean delete)

EmailAttachment

public EmailAttachment(java.io.File file,
                       java.lang.String description,
                       java.lang.String disposition,
                       java.lang.String contentId,
                       boolean delete)

EmailAttachment

public EmailAttachment(java.io.File file,
                       java.lang.String name,
                       java.lang.String description,
                       java.lang.String disposition,
                       java.lang.String contentId,
                       boolean delete)

Method Detail

getDataSource

public javax.activation.DataSource getDataSource()
Get the java.activation.DataSource represented by this object
Returns:
A DataSource

getName

public java.lang.String getName()
Get the name for this attachment
Returns:
A String.

getContentType

public java.lang.String getContentType()
Get the content type for this attachment
Returns:
A String

getDisposition

public java.lang.String getDisposition()
Get the disposition for this attachment
Returns:
A String

getDescription

public java.lang.String getDescription()
Get the description for this attachment
Returns:
A String

getContentId

public java.lang.String getContentId()
Get the content id for this attachment
Returns:
A String

setDeleteOnExit

public void setDeleteOnExit()

dispose

public void dispose()

Skip navigation links


Copyright © 2001, 2012, Oracle. All rights reserved.