1 16 package org.apache.cocoon.mail; 17 18 import javax.mail.MessagingException ; 19 import javax.mail.internet.MimePart ; 20 21 28 public class MailCtPref implements ContentTypePreference { 29 30 38 public int preference(MimePart part) { 39 try { 40 if (part.isMimeType("text/html")) { 41 return 5; 42 } 43 if (part.isMimeType("text/*")) { 44 return 10; 45 } 46 if (part.isMimeType("text")) { 47 return 9; 48 } 49 return 0; 50 } catch (MessagingException messagingexception) { 51 return 0; 52 } 53 } 54 } 55 56 | Popular Tags |