mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 19:22: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:
parent
4121061c7a
commit
11676ee5fd
@ -107,9 +107,11 @@ public class DavExchangeSession extends ExchangeSession {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isExpired() throws NoRouteToHostException, UnknownHostException {
|
public boolean isExpired() throws NoRouteToHostException, UnknownHostException {
|
||||||
// experimental: try to reset session timeout
|
// experimental: try to reset session timeout
|
||||||
|
if ("Exchange2007".equals(serverVersion)) {
|
||||||
GetMethod getMethod = null;
|
GetMethod getMethod = null;
|
||||||
try {
|
try {
|
||||||
getMethod = new GetMethod(URIUtil.encodePath(getFolderPath("")));
|
getMethod = new GetMethod("/owa/");
|
||||||
|
getMethod.setFollowRedirects(false);
|
||||||
httpClient.executeMethod(getMethod);
|
httpClient.executeMethod(getMethod);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOGGER.warn(e.getMessage());
|
LOGGER.warn(e.getMessage());
|
||||||
@ -118,6 +120,7 @@ public class DavExchangeSession extends ExchangeSession {
|
|||||||
getMethod.releaseConnection();
|
getMethod.releaseConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return super.isExpired();
|
return super.isExpired();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user