@Test public void getTextFromPart_withHtmlWithCharsetInContentTypeRawDataBody_shouldReturnHtmlText() throws Exception { part.setHeader(MimeHeader.HEADER_CONTENT_TYPE, "text/html; charset=UTF-8"); BinaryMemoryBody body = new BinaryMemoryBody( "<html><body>Sample text body</body></html>".getBytes(), MimeUtil.ENC_8BIT); part.setBody(body); String result = MessageExtractor.getTextFromPart(part); assertEquals("<html><body>Sample text body</body></html>", result); }
public static String getTextFromPart(Part part) { return getTextFromPart(part, NO_TEXT_SIZE_LIMIT); }
MessageExtractor { public static String getTextFromPart(Part part) { return getTextFromPart(part, NO_TEXT_SIZE_LIMIT); } }
MessageExtractor { public static String getTextFromPart(Part part) { return getTextFromPart(part, NO_TEXT_SIZE_LIMIT); } private  MessageExtractor(); }
MessageExtractor { public static String getTextFromPart(Part part) { return getTextFromPart(part, NO_TEXT_SIZE_LIMIT); } private  MessageExtractor(); static String getTextFromPart(Part part); static String getTextFromPart(Part part, long textSizeLimit); static boolean hasMissingParts(Part part); static void findViewablesAndAttachments(Part part,
                                                   @Nullable List<Viewable> outputViewableParts,
                                                   @Nullable List<Part> outputNonViewableParts,
                                                   @Nullable List<ICalPart> outputICalendarParts); static Set<Part> getTextParts(Part part); static List<Part> collectAttachments(Message message); static Set<Part> collectTextParts(Message message); }
MessageExtractor { public static String getTextFromPart(Part part) { return getTextFromPart(part, NO_TEXT_SIZE_LIMIT); } private  MessageExtractor(); static String getTextFromPart(Part part); static String getTextFromPart(Part part, long textSizeLimit); static boolean hasMissingParts(Part part); static void findViewablesAndAttachments(Part part,
                                                   @Nullable List<Viewable> outputViewableParts,
                                                   @Nullable List<Part> outputNonViewableParts,
                                                   @Nullable List<ICalPart> outputICalendarParts); static Set<Part> getTextParts(Part part); static List<Part> collectAttachments(Message message); static Set<Part> collectTextParts(Message message); static final long NO_TEXT_SIZE_LIMIT; }