From dc21124beb8e6941cdb36ac9bb1bebb950536677 Mon Sep 17 00:00:00 2001 From: mguessan Date: Thu, 9 Sep 2010 19:51:25 +0000 Subject: [PATCH] Fixes from audit git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1435 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSession.java | 16 +++++++++++----- src/java/davmail/imap/ImapConnection.java | 4 +++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index 91988b3e..958c88b1 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -1198,6 +1198,12 @@ public abstract class ExchangeSession { */ public abstract void moveFolder(String folderName, String targetName) throws IOException; + /** + * Move item from source path to target path. + * @param sourcePath item source path + * @param targetPath item target path + * @throws IOException on error + */ public abstract void moveItem(String sourcePath, String targetPath) throws IOException; protected abstract void moveToTrash(Message message) throws IOException; @@ -2487,11 +2493,11 @@ public abstract class ExchangeSession { } } - protected static final String[] VCARD_N_PROPERTIES = {"sn", "givenName", "middlename", "personaltitle", "namesuffix"}; - protected static final String[] VCARD_ADR_HOME_PROPERTIES = {"homepostofficebox", null, "homeStreet", "homeCity", "homeState", "homePostalCode", "homeCountry"}; - protected static final String[] VCARD_ADR_WORK_PROPERTIES = {"postofficebox", "roomnumber", "street", "l", "st", "postalcode", "co"}; - protected static final String[] VCARD_ADR_OTHER_PROPERTIES = {"otherpostofficebox", null, "otherstreet", "othercity", "otherstate", "otherpostalcode", "othercountry"}; - protected static final String[] VCARD_ORG_PROPERTIES = {"o", "department"}; + static final String[] VCARD_N_PROPERTIES = {"sn", "givenName", "middlename", "personaltitle", "namesuffix"}; + static final String[] VCARD_ADR_HOME_PROPERTIES = {"homepostofficebox", null, "homeStreet", "homeCity", "homeState", "homePostalCode", "homeCountry"}; + static final String[] VCARD_ADR_WORK_PROPERTIES = {"postofficebox", "roomnumber", "street", "l", "st", "postalcode", "co"}; + static final String[] VCARD_ADR_OTHER_PROPERTIES = {"otherpostofficebox", null, "otherstreet", "othercity", "otherstate", "otherpostalcode", "othercountry"}; + static final String[] VCARD_ORG_PROPERTIES = {"o", "department"}; protected void convertContactProperties(Map properties, String[] contactProperties, List values) { for (int i = 0; i < values.size() && i < contactProperties.length; i++) { diff --git a/src/java/davmail/imap/ImapConnection.java b/src/java/davmail/imap/ImapConnection.java index 0696ff99..fab84574 100644 --- a/src/java/davmail/imap/ImapConnection.java +++ b/src/java/davmail/imap/ImapConnection.java @@ -657,9 +657,11 @@ public class ImapConnection extends AbstractConnection { } else if (param.startsWith("BODY[") || param.startsWith("BODY.PEEK[") || "RFC822.HEADER".equals(param)) { // get full param if (param.indexOf('[') >= 0) { + StringBuilder paramBuffer = new StringBuilder(param); while (paramTokens.hasMoreTokens() && param.indexOf(']') < 0) { - param += ' ' + paramTokens.nextToken(); + paramBuffer.append(' ').append(paramTokens.nextToken()); } + param = paramBuffer.toString(); } // parse buffer size int startIndex = 0;