From e2c1db46cbda97297edd37778ff1c3cfa96bd91b Mon Sep 17 00:00:00 2001 From: Vasily Karyaev Date: Mon, 24 Sep 2012 09:56:45 +0400 Subject: [PATCH] slight addition to the previous commit --- .../java/com/ecwid/mailchimp/MailChimpAPIConnection.java | 6 ------ src/main/java/com/ecwid/mailchimp/MailChimpClient.java | 6 +++++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/ecwid/mailchimp/MailChimpAPIConnection.java b/src/main/java/com/ecwid/mailchimp/MailChimpAPIConnection.java index 0a15ae5..111cca4 100644 --- a/src/main/java/com/ecwid/mailchimp/MailChimpAPIConnection.java +++ b/src/main/java/com/ecwid/mailchimp/MailChimpAPIConnection.java @@ -37,10 +37,4 @@ public interface MailChimpAPIConnection extends Closeable { * or if the service point response was unsuccessful (>= 300 status code) */ public String post(String url, String payload) throws IOException; - - /** - * Release resources associated with the connection. - */ - @Override - public void close(); } diff --git a/src/main/java/com/ecwid/mailchimp/MailChimpClient.java b/src/main/java/com/ecwid/mailchimp/MailChimpClient.java index ef538bf..4fc75b8 100644 --- a/src/main/java/com/ecwid/mailchimp/MailChimpClient.java +++ b/src/main/java/com/ecwid/mailchimp/MailChimpClient.java @@ -134,6 +134,10 @@ private String buildUrl(MailChimpMethod method) throws UnsupportedEncodingExc */ @Override public void close() { - connection.close(); + try { + connection.close(); + } catch(IOException e) { + log.log(Level.WARNING, "Could not close connection", e); + } } }