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:
parent
e81f0c3f91
commit
1a92e17d07
|
@ -51,6 +51,7 @@ import javax.mail.util.SharedByteArrayInputStream;
|
||||||
import javax.xml.stream.XMLStreamException;
|
import javax.xml.stream.XMLStreamException;
|
||||||
import javax.xml.stream.XMLStreamReader;
|
import javax.xml.stream.XMLStreamReader;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.net.NoRouteToHostException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
@ -103,6 +104,25 @@ public class DavExchangeSession extends ExchangeSession {
|
||||||
|
|
||||||
protected static final String USERS = "/users/";
|
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.
|
* Convert logical or relative folder path to exchange folder path.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue