From 5e6ccd8ae5879a82c3e4086baa8847d2ba48dfa6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 17 May 2009 22:00:37 +0200 Subject: [PATCH] Implement getGetRequests by using a filter. --- src/net/pterodactylus/fcp/highlevel/FcpClient.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/net/pterodactylus/fcp/highlevel/FcpClient.java b/src/net/pterodactylus/fcp/highlevel/FcpClient.java index 12768f5..a958f07 100644 --- a/src/net/pterodactylus/fcp/highlevel/FcpClient.java +++ b/src/net/pterodactylus/fcp/highlevel/FcpClient.java @@ -60,6 +60,8 @@ import net.pterodactylus.fcp.RemovePeer; import net.pterodactylus.fcp.SSKKeypair; import net.pterodactylus.fcp.SimpleProgress; import net.pterodactylus.fcp.WatchGlobal; +import net.pterodactylus.util.filter.Filter; +import net.pterodactylus.util.filter.Filters; import net.pterodactylus.util.thread.ObjectWrapper; /** @@ -637,7 +639,15 @@ public class FcpClient { * if an FCP error occurs */ public Collection getGetRequests(final boolean global) throws IOException, FcpException { - return getRequests(global); + return Filters.filteredCollection(getRequests(global), new Filter() { + + /** + * {@inheritDoc} + */ + public boolean filterObject(Request request) { + return request instanceof GetRequest; + } + }); } /** -- 2.7.4