All Downloads are FREE. Search and download functionalities are using the official Maven repository.

skinny.mailer.RichMimeBodyPart.scala Maven / Gradle / Ivy

There is a newer version: 2.5.2
Show newest version
package skinny.mailer

import javax.mail.internet.MimeBodyPart
import javax.mail.util.SharedByteArrayInputStream

/**
 * Enriched MimeBodyPart.
 */
case class RichMimeBodyPart(underlying: MimeBodyPart) {

  /**
   * if getContent returns type of SharedByteArrayInputStream, get it
   * @return
   */
  def contentStream: Option[SharedByteArrayInputStream] = underlying.getContent match {
    case is: SharedByteArrayInputStream => Some(is)
    case _ => None
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy