Example usage for javax.mail Message isMimeType

List of usage examples for javax.mail Message isMimeType

Introduction

In this page you can find the example usage for javax.mail Message isMimeType.

Prototype

public boolean isMimeType(String mimeType) throws MessagingException;

Source Link

Document

Is this Part of the specified MIME type?

Usage

From source file:org.wso2.carbon.registry.es.utils.EmailUtil.java

/**
 * This method is used to extract verification URL from the e-mail message.
 *
 * @param   message    re-mail message.// w  w  w . jav a2 s .c o  m
 * @return  verification URL to be redirect to.
 */
private static String getBodyFromMessage(Message message) throws IOException, MessagingException {
    if (message.isMimeType("text/plain")) {
        String[] arr = message.getContent().toString().split("\\r?\\n");
        for (int x = 0; x <= arr.length; x++) {
            if (arr[x].contains("https://")) {
                return arr[x];
            }
        }

    }
    return "";
}