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

fix : ExchangeSession pool did not work with Exchange 2007

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@248 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2008-12-23 22:01:29 +00:00
parent 8dd5e178c9
commit 0b3d0c89f6

View File

@ -105,24 +105,16 @@ public class ExchangeSession {
public boolean isExpired() {
boolean isExpired = false;
HttpMethod testMethod = null;
try {
testMethod = DavGatewayHttpClientFacade.executeFollowRedirects(wdr.retrieveSessionInstance(),
URIUtil.encodePath(currentFolderUrl));
String queryString = testMethod.getQueryString();
wdr.propfindMethod(0);
int status = wdr.getStatusCode();
if (testMethod.getStatusCode() != HttpStatus.SC_OK) {
isExpired = true;
} else if (queryString != null && queryString.contains("reason=")) {
if (status != HttpStatus.SC_MULTI_STATUS) {
isExpired = true;
}
} catch (IOException e) {
isExpired = true;
} finally {
if (testMethod != null) {
testMethod.releaseConnection();
}
}
return isExpired;