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();
|
HttpClient httpClient = DavGatewayHttpClientFacade.getInstance();
|
||||||
GetMethod getMethod = new GetMethod("http://davmail.sourceforge.net/version.txt");
|
GetMethod getMethod = new GetMethod("http://davmail.sourceforge.net/version.txt");
|
||||||
try {
|
try {
|
||||||
httpClient.setConnectionTimeout(1000);
|
|
||||||
int status = httpClient.executeMethod(getMethod);
|
int status = httpClient.executeMethod(getMethod);
|
||||||
if (status == HttpStatus.SC_OK) {
|
if (status == HttpStatus.SC_OK) {
|
||||||
versionReader = new BufferedReader(new InputStreamReader(getMethod.getResponseBodyAsStream()));
|
versionReader = new BufferedReader(new InputStreamReader(getMethod.getResponseBodyAsStream()));
|
||||||
|
|
|
@ -148,8 +148,8 @@ public class CaldavConnection extends AbstractConnection {
|
||||||
} catch (SocketException e) {
|
} catch (SocketException e) {
|
||||||
DavGatewayTray.debug("Connection closed");
|
DavGatewayTray.debug("Connection closed");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if (e instanceof HttpException) {
|
if (e.getMessage() != null) {
|
||||||
DavGatewayTray.error(((HttpException) e).getReasonCode() + " " + ((HttpException) e).getReason(), e);
|
DavGatewayTray.error(e.getMessage(), e);
|
||||||
} else {
|
} else {
|
||||||
DavGatewayTray.error(e);
|
DavGatewayTray.error(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,13 +181,6 @@ public class ExchangeSession {
|
||||||
message.append("DavMail login exception: ");
|
message.append("DavMail login exception: ");
|
||||||
if (exc.getMessage() != null) {
|
if (exc.getMessage() != null) {
|
||||||
message.append(exc.getMessage());
|
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 {
|
} else {
|
||||||
message.append(exc);
|
message.append(exc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,7 +172,7 @@ public class ImapConnection extends AbstractConnection {
|
||||||
session.moveFolder(folderName, targetName);
|
session.moveFolder(folderName, targetName);
|
||||||
sendClient(commandId + " OK rename completed");
|
sendClient(commandId + " OK rename completed");
|
||||||
} catch (HttpException e) {
|
} catch (HttpException e) {
|
||||||
sendClient(commandId + " NO " + e.getReason());
|
sendClient(commandId + " NO " + e.getMessage());
|
||||||
}
|
}
|
||||||
} else if ("delete".equalsIgnoreCase(command)) {
|
} else if ("delete".equalsIgnoreCase(command)) {
|
||||||
String folderName = BASE64MailboxDecoder.decode(tokens.nextToken());
|
String folderName = BASE64MailboxDecoder.decode(tokens.nextToken());
|
||||||
|
@ -180,7 +180,7 @@ public class ImapConnection extends AbstractConnection {
|
||||||
session.deleteFolder(folderName);
|
session.deleteFolder(folderName);
|
||||||
sendClient(commandId + " OK delete completed");
|
sendClient(commandId + " OK delete completed");
|
||||||
} catch (HttpException e) {
|
} catch (HttpException e) {
|
||||||
sendClient(commandId + " NO " + e.getReason());
|
sendClient(commandId + " NO " + e.getMessage());
|
||||||
}
|
}
|
||||||
} else if ("uid".equalsIgnoreCase(command)) {
|
} else if ("uid".equalsIgnoreCase(command)) {
|
||||||
if (tokens.hasMoreTokens()) {
|
if (tokens.hasMoreTokens()) {
|
||||||
|
@ -269,7 +269,7 @@ public class ImapConnection extends AbstractConnection {
|
||||||
}
|
}
|
||||||
sendClient(commandId + " OK copy completed");
|
sendClient(commandId + " OK copy completed");
|
||||||
} catch (HttpException e) {
|
} catch (HttpException e) {
|
||||||
sendClient(commandId + " NO " + e.getReason());
|
sendClient(commandId + " NO " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -439,8 +439,8 @@ public class ImapConnection extends AbstractConnection {
|
||||||
DavGatewayTray.debug("Connection closed");
|
DavGatewayTray.debug("Connection closed");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
StringBuilder buffer = new StringBuilder();
|
StringBuilder buffer = new StringBuilder();
|
||||||
if (e instanceof HttpException) {
|
if (e.getMessage() != null) {
|
||||||
buffer.append(((HttpException) e).getReasonCode()).append(" ").append(((HttpException) e).getReason());
|
buffer.append(e.getMessage());
|
||||||
} else {
|
} else {
|
||||||
buffer.append(e);
|
buffer.append(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue