@Test public void testUnfold() throws Exception { Assert.assertEquals("", MimeUtil.unfold("")); Assert.assertEquals("x", MimeUtil.unfold("x")); Assert.assertEquals(" x ", MimeUtil.unfold(" x ")); Assert.assertEquals("", MimeUtil.unfold("\r")); Assert.assertEquals("", MimeUtil.unfold("\n")); Assert.assertEquals("", MimeUtil.unfold("\r\n")); Assert.assertEquals(" ", MimeUtil.unfold(" \n")); Assert.assertEquals(" ", MimeUtil.unfold("\n ")); Assert.assertEquals(" ", MimeUtil.unfold(" \r\n")); Assert.assertEquals(" ", MimeUtil.unfold("\r\n ")); Assert.assertEquals("this is a test", MimeUtil.unfold("this is\r\n a test")); Assert.assertEquals("this is a test", MimeUtil.unfold("this is\r\n a test")); Assert.assertEquals("this is a test", MimeUtil.unfold("this\r\n is a test")); Assert.assertEquals("this is a test", MimeUtil .unfold("this \r\n is a test")); Assert.assertEquals("this is a test", MimeUtil .unfold("this\r\n is\r\n a\r\n test")); }
public static String unfold(String s) { final int length = s.length(); for (int idx = 0; idx < length; idx++) { char c = s.charAt(idx); if (c == '\r' || c == '\n') { return unfold0(s, idx); } } return s; }
MimeUtil { public static String unfold(String s) { final int length = s.length(); for (int idx = 0; idx < length; idx++) { char c = s.charAt(idx); if (c == '\r' || c == '\n') { return unfold0(s, idx); } } return s; } }
MimeUtil { public static String unfold(String s) { final int length = s.length(); for (int idx = 0; idx < length; idx++) { char c = s.charAt(idx); if (c == '\r' || c == '\n') { return unfold0(s, idx); } } return s; } private  MimeUtil(); }
MimeUtil { public static String unfold(String s) { final int length = s.length(); for (int idx = 0; idx < length; idx++) { char c = s.charAt(idx); if (c == '\r' || c == '\n') { return unfold0(s, idx); } } return s; } private  MimeUtil(); static boolean isSameMimeType(String pType1, String pType2); static boolean isMessage(String pMimeType); static boolean isMultipart(String pMimeType); static boolean isBase64Encoding(String pTransferEncoding); static boolean isQuotedPrintableEncoded(String pTransferEncoding); static String createUniqueBoundary(); static String createUniqueMessageId(String hostName); static String formatDate(Date date, TimeZone zone); static String fold(String s, int usedCharacters); static String unfold(String s); static String unscrambleHeaderValue(String headerValue); }
MimeUtil { public static String unfold(String s) { final int length = s.length(); for (int idx = 0; idx < length; idx++) { char c = s.charAt(idx); if (c == '\r' || c == '\n') { return unfold0(s, idx); } } return s; } private  MimeUtil(); static boolean isSameMimeType(String pType1, String pType2); static boolean isMessage(String pMimeType); static boolean isMultipart(String pMimeType); static boolean isBase64Encoding(String pTransferEncoding); static boolean isQuotedPrintableEncoded(String pTransferEncoding); static String createUniqueBoundary(); static String createUniqueMessageId(String hostName); static String formatDate(Date date, TimeZone zone); static String fold(String s, int usedCharacters); static String unfold(String s); static String unscrambleHeaderValue(String headerValue); static final String ENC_QUOTED_PRINTABLE; static final String ENC_BINARY; static final String ENC_BASE64; static final String ENC_8BIT; static final String ENC_7BIT; }