package de.todesbaum.util.freenet.fcp2;
+import static java.util.logging.Level.FINE;
+import static java.util.logging.Logger.getLogger;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
+import java.util.logging.Logger;
import net.pterodactylus.util.io.Closer;
import net.pterodactylus.util.io.StreamCopier;
*/
public class Connection {
+ private static final Logger logger = getLogger(Connection.class.getName());
+
/** The listeners that receive events from this connection. */
private List<ConnectionListener> connectionListeners = new ArrayList<ConnectionListener>();
synchronized (this) {
notify();
}
+ logger.log(FINE, "Connection terminated.", new Exception());
fireConnectionTerminated();
}
line = nodeReader.readLine();
// System.err.println("> " + line);
if (line == null) {
+ logger.fine("Connection was closed.");
break;
}
if (message == null) {
throw new IOException("Unexpected line: " + line);
}
} catch (IOException ioe1) {
- // ioe1.printStackTrace();
+ logger.log(FINE, "Exception while reading from node.", ioe1);
} finally {
if (nodeReader != null) {
try {