Fix up all file headers.
[jSite.git] / src / de / todesbaum / util / freenet / fcp2 / Connection.java
index 82b4a6b..c4cb669 100644 (file)
@@ -1,6 +1,5 @@
 /*
- * todesbaum-lib -
- * Copyright (C) 2006 David Roden
+ * jSite - Connection.java - Copyright © 2006–2012 David Roden
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -216,34 +215,15 @@ public class Connection {
         * Disconnects from the node.
         */
        public void disconnect() {
-               if (nodeWriter != null) {
-                       try {
-                               nodeWriter.close();
-                       } catch (IOException ioe1) {
-                       }
-                       nodeWriter = null;
-               }
-               if (nodeOutputStream != null) {
-                       try {
-                               nodeOutputStream.close();
-                       } catch (IOException ioe1) {
-                       }
-                       nodeOutputStream = null;
-               }
-               if (nodeInputStream != null) {
-                       try {
-                               nodeInputStream.close();
-                       } catch (IOException ioe1) {
-                       }
-                       nodeInputStream = null;
-               }
-               if (nodeSocket != null) {
-                       try {
-                               nodeSocket.close();
-                       } catch (IOException ioe1) {
-                       }
-                       nodeSocket = null;
-               }
+               Closer.close(nodeWriter);
+               nodeWriter = null;
+               Closer.close(nodeOutputStream);
+               nodeOutputStream = null;
+               Closer.close(nodeInputStream);
+               nodeInputStream = null;
+               nodeInputStream = null;
+               Closer.close(nodeSocket);
+               nodeSocket = null;
                synchronized (this) {
                        notify();
                }