mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-12 22:18:11 -05:00
IMAP: refactor BODYSTRUCTURE generation
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@479 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
285c543d6b
commit
d3aa687124
@ -609,31 +609,30 @@ public class ImapConnection extends AbstractConnection {
|
||||
buffer.append(" ()");
|
||||
}
|
||||
}
|
||||
// body id
|
||||
if (bodyPart.getContentID() == null) {
|
||||
buffer.append(" NIL");
|
||||
} else {
|
||||
buffer.append(" \"").append(bodyPart.getContentID()).append("\"");
|
||||
}
|
||||
if (bodyPart.getDescription() == null) {
|
||||
buffer.append(" NIL");
|
||||
} else {
|
||||
buffer.append(" \"").append(bodyPart.getDescription()).append("\"");
|
||||
}
|
||||
if (bodyPart.getHeader("Content-Transfer-Encoding") == null) {
|
||||
buffer.append(" NIL");
|
||||
} else {
|
||||
buffer.append(" \"").append(bodyPart.getEncoding().toUpperCase()).append("\"");
|
||||
}
|
||||
buffer.append(' ').append(bodyPart.getSize());
|
||||
if (bodyPart.getLineCount() < 0) {
|
||||
buffer.append(" NIL");
|
||||
} else {
|
||||
buffer.append(' ').append(bodyPart.getLineCount()).append('"');
|
||||
}
|
||||
appendBodyStructureValue(buffer, bodyPart.getContentID());
|
||||
appendBodyStructureValue(buffer, bodyPart.getDescription());
|
||||
appendBodyStructureValue(buffer, bodyPart.getEncoding());
|
||||
appendBodyStructureValue(buffer, bodyPart.getSize());
|
||||
appendBodyStructureValue(buffer, bodyPart.getLineCount());
|
||||
buffer.append(')');
|
||||
}
|
||||
|
||||
protected void appendBodyStructureValue(StringBuilder buffer, String value) throws IOException, MessagingException {
|
||||
if (value == null) {
|
||||
buffer.append(" NIL");
|
||||
} else {
|
||||
buffer.append(" \"").append(value.toUpperCase()).append("\"");
|
||||
}
|
||||
}
|
||||
|
||||
protected void appendBodyStructureValue(StringBuilder buffer, int value) throws IOException, MessagingException {
|
||||
if (value < 0) {
|
||||
buffer.append(" NIL");
|
||||
} else {
|
||||
buffer.append(' ').append(value);
|
||||
}
|
||||
}
|
||||
|
||||
static final class SearchConditions {
|
||||
Boolean flagged = null;
|
||||
Boolean answered = null;
|
||||
|
Loading…
Reference in New Issue
Block a user