mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
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:
parent
f6e98e3a77
commit
4fdca92f08
@ -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()));
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user