1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-01-05 18:58:02 -05:00

EWS: new failovers on Timezone settings: use davmail.timezoneId setting or default to GMT Standard Time

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1648 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-03-23 09:42:32 +00:00
parent 00a1baba41
commit 16617d8141

View File

@ -18,6 +18,7 @@
*/
package davmail.exchange.ews;
import davmail.Settings;
import davmail.exception.DavMailAuthenticationException;
import davmail.exception.DavMailException;
import davmail.exception.HttpNotFoundException;
@ -1570,7 +1571,16 @@ public class EwsExchangeSession extends ExchangeSession {
} else {
timezoneId = getTimezoneidFromOptions();
}
if (timezoneId != null) {
// failover: use timezone id from settings file
if (timezoneId == null) {
timezoneId = Settings.getProperty("davmail.timezoneId");
}
// last failover: use GMT
if (timezoneId == null) {
LOGGER.warn("Unable to get user timezone, using GMT Standard Time. Set davmail.timezoneId setting to override this.");
timezoneId = "GMT Standard Time";
}
createCalendarFolder("davmailtemp", null);
EWSMethod.Item item = new EWSMethod.Item();
item.type = "CalendarItem";
@ -1592,7 +1602,6 @@ public class EwsExchangeSession extends ExchangeSession {
this.vTimezone = vCalendar.getVTimezone();
// delete temporary folder
deleteFolder("davmailtemp");
}
} catch (IOException e) {
LOGGER.warn("Unable to get VTIMEZONE info: " + e, e);
}