From 807741b54ef70dcaf80b8da7a280124998c89f18 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:01:20 +0200 Subject: [PATCH] =?utf8?q?Add=20=E2=80=9CgetPutRequests=E2=80=9D=20method.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/net/pterodactylus/fcp/highlevel/FcpClient.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/net/pterodactylus/fcp/highlevel/FcpClient.java b/src/net/pterodactylus/fcp/highlevel/FcpClient.java index a958f07..f90ab77 100644 --- a/src/net/pterodactylus/fcp/highlevel/FcpClient.java +++ b/src/net/pterodactylus/fcp/highlevel/FcpClient.java @@ -651,6 +651,31 @@ public class FcpClient { } /** + * Returns all currently visible persistent put requests. + * + * @param global + * true to return put requests from the global + * queue, false to only show requests from the + * client-local queue + * @return All put requests + * @throws IOException + * if an I/O error occurs + * @throws FcpException + * if an FCP error occurs + */ + public Collection getPutRequests(final boolean global) throws IOException, FcpException { + return Filters.filteredCollection(getRequests(global), new Filter() { + + /** + * {@inheritDoc} + */ + public boolean filterObject(Request request) { + return request instanceof PutRequest; + } + }); + } + + /** * Returns all currently visible persistent requests. * * @param global -- 2.7.4