1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 11:12:22 -05:00

Dav: new patch to reset session timeout with a GET method on /owa/

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1668 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-04-14 21:17:40 +00:00
parent 4121061c7a
commit 11676ee5fd

View File

@ -107,9 +107,11 @@ public class DavExchangeSession extends ExchangeSession {
@Override
public boolean isExpired() throws NoRouteToHostException, UnknownHostException {
// experimental: try to reset session timeout
if ("Exchange2007".equals(serverVersion)) {
GetMethod getMethod = null;
try {
getMethod = new GetMethod(URIUtil.encodePath(getFolderPath("")));
getMethod = new GetMethod("/owa/");
getMethod.setFollowRedirects(false);
httpClient.executeMethod(getMethod);
} catch (IOException e) {
LOGGER.warn(e.getMessage());
@ -118,6 +120,7 @@ public class DavExchangeSession extends ExchangeSession {
getMethod.releaseConnection();
}
}
}
return super.isExpired();
}