mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 17:31:52 -05:00
Caldav: fix regression in getAllDayLine()
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1006 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
dc4b7cc77e
commit
7778e4ea69
@ -1698,7 +1698,7 @@ public class ExchangeSession {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
write(baos, false);
|
||||
mimeMessage = new MimeMessage(null, new ByteArrayInputStream(baos.toByteArray()));
|
||||
LOGGER.debug("Dowloaded message content for "+imapUid+" ("+baos.size()+")");
|
||||
LOGGER.debug("Downloaded message content for "+imapUid+" ("+baos.size()+ ')');
|
||||
}
|
||||
}
|
||||
return mimeMessage;
|
||||
@ -1858,7 +1858,7 @@ public class ExchangeSession {
|
||||
result = fixICS(new String(baos.toByteArray(), "UTF-8"), true);
|
||||
} else {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
mimeMessage.getDataHandler().writeTo(baos);
|
||||
mimeMessage.writeTo(baos);
|
||||
baos.close();
|
||||
throw new DavMailException("EXCEPTION_INVALID_MESSAGE_CONTENT", new String(baos.toByteArray(), "UTF-8"));
|
||||
}
|
||||
@ -1971,12 +1971,15 @@ public class ExchangeSession {
|
||||
}
|
||||
|
||||
protected String getAllDayLine(String line) throws IOException {
|
||||
int keyIndex = line.indexOf(';');
|
||||
int valueIndex = line.lastIndexOf(':');
|
||||
int valueEndIndex = line.lastIndexOf('T');
|
||||
if (valueIndex < 0 || valueEndIndex < 0) {
|
||||
throw new DavMailException("EXCEPTION_INVALID_ICS_LINE", line);
|
||||
}
|
||||
int keyIndex = line.indexOf(';');
|
||||
if (keyIndex == -1) {
|
||||
keyIndex = valueIndex;
|
||||
}
|
||||
String dateValue = line.substring(valueIndex + 1, valueEndIndex);
|
||||
String key = line.substring(0, Math.min(keyIndex, valueIndex));
|
||||
return key + ";VALUE=DATE:" + dateValue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user