Improve network down detection for Caldav

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@564 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-05-15 12:38:24 +00:00
parent 7cb45c2d48
commit 023736018c
3 changed files with 8 additions and 3 deletions

View File

@ -30,6 +30,7 @@ import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.UnknownHostException;
import java.net.NoRouteToHostException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@ -217,11 +218,15 @@ public class ExchangeSession {
}
public boolean isExpired() {
public boolean isExpired() throws NoRouteToHostException, UnknownHostException {
boolean isExpired = false;
try {
DavGatewayHttpClientFacade.executePropFindMethod(
httpClient, URIUtil.encodePath(inboxUrl), 0, DISPLAY_NAME);
} catch (UnknownHostException exc) {
throw exc;
} catch (NoRouteToHostException exc) {
throw exc;
} catch (IOException e) {
isExpired = true;
}

View File

@ -198,7 +198,7 @@ EXCEPTION_INVALID_RECIPIENT=Invalid recipient: {0}
EXCEPTION_UNSUPPORTED_VALUE=Unsupported value: {0}
EXCEPTION_INVALID_CONTENT_TYPE=Invalid content type: {0}
EXCEPTION_INVALID_SEARCH_PARAMETERS=Invalid search parameters: {0}
EXCEPTION_NETWORK_DOWN=All network interfaces down !
EXCEPTION_NETWORK_DOWN=All network interfaces down or host unreachable !
EXCEPTION_DAVMAIL_CONFIGURATION=DavMail configuration exception: \n{0}
EXCEPTION_UNKNOWN_HOST=Unknown host {0}
EXCEPTION_CONNECTION_FAILED=Unable to connect to OWA at {0}, status code {1}, check configuration

View File

@ -197,7 +197,7 @@ EXCEPTION_INVALID_RECIPIENT=Destinataire invalide : {0}
EXCEPTION_UNSUPPORTED_VALUE=Valeur non supportée : {0}
EXCEPTION_INVALID_CONTENT_TYPE=Type de contenu invalide : {0}
EXCEPTION_INVALID_SEARCH_PARAMETERS=Paremètres de recherche invalides : {0}
EXCEPTION_NETWORK_DOWN=Toutes les interfaces réseaux sont indisponibles !
EXCEPTION_NETWORK_DOWN=Toutes les interfaces réseaux sont indisponibles ou serveur non joignable !
EXCEPTION_DAVMAIL_CONFIGURATION=Erreur de configuration DavMail : \n{0}
EXCEPTION_UNKNOWN_HOST=Nom de serveur {0} invalide
EXCEPTION_CONNECTION_FAILED=Connection OWA à {0} impossible, code retour {1}, vérifier la configuration