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

Dav: experimental, try to reset session timeout with a GET method

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1666 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-04-13 21:34:00 +00:00
parent e81f0c3f91
commit 1a92e17d07

View File

@ -51,6 +51,7 @@ import javax.mail.util.SharedByteArrayInputStream;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.io.*;
import java.net.NoRouteToHostException;
import java.net.URL;
import java.net.UnknownHostException;
import java.text.ParseException;
@ -103,6 +104,25 @@ public class DavExchangeSession extends ExchangeSession {
protected static final String USERS = "/users/";
@Override
public boolean isExpired() throws NoRouteToHostException, UnknownHostException {
// experimental: try to reset session timeout
GetMethod getMethod = null;
try {
getMethod = new GetMethod(URIUtil.encodePath(getFolderPath("")));
httpClient.executeMethod(getMethod);
} catch (IOException e) {
LOGGER.warn(e.getMessage());
} finally {
if (getMethod != null) {
getMethod.releaseConnection();
}
}
return super.isExpired();
}
/**
* Convert logical or relative folder path to exchange folder path.
*