Remove deprecated HttpException api

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@492 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-04-01 22:58:03 +00:00
parent f6e98e3a77
commit 4fdca92f08
4 changed files with 7 additions and 15 deletions

View File

@ -137,7 +137,6 @@ public class DavGateway {
HttpClient httpClient = DavGatewayHttpClientFacade.getInstance();
GetMethod getMethod = new GetMethod("http://davmail.sourceforge.net/version.txt");
try {
httpClient.setConnectionTimeout(1000);
int status = httpClient.executeMethod(getMethod);
if (status == HttpStatus.SC_OK) {
versionReader = new BufferedReader(new InputStreamReader(getMethod.getResponseBodyAsStream()));

View File

@ -148,8 +148,8 @@ public class CaldavConnection extends AbstractConnection {
} catch (SocketException e) {
DavGatewayTray.debug("Connection closed");
} catch (IOException e) {
if (e instanceof HttpException) {
DavGatewayTray.error(((HttpException) e).getReasonCode() + " " + ((HttpException) e).getReason(), e);
if (e.getMessage() != null) {
DavGatewayTray.error(e.getMessage(), e);
} else {
DavGatewayTray.error(e);
}

View File

@ -181,13 +181,6 @@ public class ExchangeSession {
message.append("DavMail login exception: ");
if (exc.getMessage() != null) {
message.append(exc.getMessage());
} else if (exc instanceof HttpException) {
message.append(((HttpException) exc).getReasonCode());
String httpReason = ((HttpException) exc).getReason();
if (httpReason != null) {
message.append(" ");
message.append(httpReason);
}
} else {
message.append(exc);
}

View File

@ -172,7 +172,7 @@ public class ImapConnection extends AbstractConnection {
session.moveFolder(folderName, targetName);
sendClient(commandId + " OK rename completed");
} catch (HttpException e) {
sendClient(commandId + " NO " + e.getReason());
sendClient(commandId + " NO " + e.getMessage());
}
} else if ("delete".equalsIgnoreCase(command)) {
String folderName = BASE64MailboxDecoder.decode(tokens.nextToken());
@ -180,7 +180,7 @@ public class ImapConnection extends AbstractConnection {
session.deleteFolder(folderName);
sendClient(commandId + " OK delete completed");
} catch (HttpException e) {
sendClient(commandId + " NO " + e.getReason());
sendClient(commandId + " NO " + e.getMessage());
}
} else if ("uid".equalsIgnoreCase(command)) {
if (tokens.hasMoreTokens()) {
@ -269,7 +269,7 @@ public class ImapConnection extends AbstractConnection {
}
sendClient(commandId + " OK copy completed");
} catch (HttpException e) {
sendClient(commandId + " NO " + e.getReason());
sendClient(commandId + " NO " + e.getMessage());
}
}
} else {
@ -439,8 +439,8 @@ public class ImapConnection extends AbstractConnection {
DavGatewayTray.debug("Connection closed");
} catch (Exception e) {
StringBuilder buffer = new StringBuilder();
if (e instanceof HttpException) {
buffer.append(((HttpException) e).getReasonCode()).append(" ").append(((HttpException) e).getReason());
if (e.getMessage() != null) {
buffer.append(e.getMessage());
} else {
buffer.append(e);
}