From 30ce501106648904c6079bba147103750d801ce4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 10 Sep 2010 06:26:58 +0200 Subject: [PATCH] Let the FCP client implement the Closeable interface. --- src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java index e389f23..d090d64 100644 --- a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java +++ b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java @@ -18,6 +18,7 @@ package net.pterodactylus.fcp.highlevel; +import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.net.InetAddress; @@ -78,7 +79,7 @@ import net.pterodactylus.util.thread.ObjectWrapper; * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> */ -public class FcpClient { +public class FcpClient implements Closeable { /** Object used for synchronization. */ private final Object syncObject = new Object(); @@ -382,6 +383,14 @@ public class FcpClient { } /** + * {@inheritDoc} + */ + @Override + public void close() { + disconnect(); + } + + /** * Returns whether this client is currently connected. * * @return {@code true} if the client is currently connected, {@code false} -- 2.7.4