From: David ‘Bombe’ Roden Date: Sun, 17 May 2009 20:00:37 +0000 (+0200) Subject: Implement getGetRequests by using a filter. X-Git-Tag: v0.1.1~59 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=5e6ccd8ae5879a82c3e4086baa8847d2ba48dfa6;p=jFCPlib.git Implement getGetRequests by using a filter. --- 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; + } + }); } /**