DO NOT MERGE: Add TODOs to ImapStore.

Backport of I5a9f246eb81cfca6008f82e8c2ffff8b7f28ba1d

Change-Id: I1422e8ae35e2ba560d1227669b9f720b937033a7
This commit is contained in:
Makoto Onuki 2010-06-01 14:14:21 -07:00
parent 57ab324a11
commit 565f58b9aa

View File

@ -462,6 +462,7 @@ public class ImapStore extends Store {
}
/* package */ static String encodeFolderName(String name) {
// TODO bypass the conversion if name doesn't have special char.
ByteBuffer bb = MODIFIED_UTF_7_CHARSET.encode(name);
byte[] b = new byte[bb.limit()];
bb.get(b);
@ -469,6 +470,7 @@ public class ImapStore extends Store {
}
/* package */ static String decodeFolderName(String name) {
// TODO bypass the conversion if name doesn't have special char.
/*
* Convert the encoded name to US-ASCII, then pass it through the modified UTF-7
* decoder and return the Unicode String.
@ -962,6 +964,11 @@ public class ImapStore extends Store {
String contentType = fetchPart.getContentType();
String contentTransferEncoding = fetchPart.getHeader(
MimeHeader.HEADER_CONTENT_TRANSFER_ENCODING)[0];
// TODO Don't create 2 temp files.
// decodeBody creates BinaryTempFileBody, but we could avoid this
// if we implement ImapStringBody.
// (We'll need to share a temp file. Protect it with a ref-count.)
fetchPart.setBody(MimeUtility.decodeBody(
bodyStream,
contentTransferEncoding));