# Class EmailRepository

java.lang.Object
org.pentaho.reporting.libraries.repository.email.EmailRepository

All Implemented Interfaces:
  `Repository`

public class EmailRepository extends Object implements Repository
Creation-Date: 17.09.2008, 15:00:00

Author:
  Pedro Alves - WebDetails

## Constructor Summary

Constructors
Constructor
Description
`EmailRepository(javax.mail.internet.MimeMessage htmlEmail)`
`EmailRepository(javax.mail.internet.MimeMessage htmlEmail, MimeRegistry mimeRegistry)`
`EmailRepository(javax.mail.Session session)`
`EmailRepository(MimeRegistry mimeRegistry, javax.mail.Session mailSession)`

## Method Summary

Modifier and Type
Method
Description
`javax.mail.internet.MimeBodyPart`
`getBodypart()`
`javax.mail.internet.MimeMessage`
`getEmail()`
`MimeRegistry`
`getMimeRegistry()`
Returns the repositories MimeRegistry, which is used return basic content-type information about the items stored in this repository.
`javax.mail.internet.MimeMultipart`
`getMultipart()`
`ContentLocation`
`getRoot()`
Returns the repositories root directory entry.
`boolean`
`isTreatHtmlContentAsBody()`
`void`
`setTreatHtmlContentAsBody(boolean treatHtmlContentAsBody)`
`void`
`writeEmail(OutputStream out)`

### Methods inherited from class Object

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

## Constructor Details

### EmailRepository

public EmailRepository(MimeRegistry mimeRegistry, javax.mail.Session mailSession) throws ContentIOException, javax.mail.MessagingException

Throws:
  `ContentIOException`
  `javax.mail.MessagingException`

### EmailRepository

public EmailRepository(javax.mail.internet.MimeMessage htmlEmail, MimeRegistry mimeRegistry) throws ContentIOException, IOException, javax.mail.MessagingException

Throws:
  `ContentIOException`
  `IOException`
  `javax.mail.MessagingException`

### EmailRepository

public EmailRepository(javax.mail.internet.MimeMessage htmlEmail) throws ContentIOException, IOException, javax.mail.MessagingException

Throws:
  `ContentIOException`
  `IOException`
  `javax.mail.MessagingException`

### EmailRepository

public EmailRepository(javax.mail.Session session) throws ContentIOException, javax.mail.MessagingException

Throws:
  `ContentIOException`
  `javax.mail.MessagingException`

## Method Details

### getRoot

public ContentLocation getRoot() throws ContentIOException
Description copied from interface: `Repository`
Returns the repositories root directory entry.

Specified by:
  `getRoot` in interface `Repository`
Returns:
  the root directory.
Throws:
  `ContentIOException` - if an error occurs.

### getMimeRegistry

public MimeRegistry getMimeRegistry()
Description copied from interface: `Repository`
Returns the repositories MimeRegistry, which is used return basic content-type information about the items stored in this repository.

Specified by:
  `getMimeRegistry` in interface `Repository`
Returns:
  the mime registry.
See Also:
  - `MimeRegistry`

### writeEmail

public void writeEmail(OutputStream out) throws ContentIOException

Throws:
  `ContentIOException`

### getEmail

public javax.mail.internet.MimeMessage getEmail()

### getMultipart

public javax.mail.internet.MimeMultipart getMultipart()

### isTreatHtmlContentAsBody

public boolean isTreatHtmlContentAsBody()

### setTreatHtmlContentAsBody

public void setTreatHtmlContentAsBody(boolean treatHtmlContentAsBody)

### getBodypart

public javax.mail.internet.MimeBodyPart getBodypart()