From 4e956eb43ea06a3b85b2cf0a9839e7c24e6650fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 22 Oct 2020 19:26:09 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Expose=20URI=20from=20get/put=20requ?= =?utf8?q?ests?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../net/pterodactylus/fcp/highlevel/GetRequest.java | 2 +- .../net/pterodactylus/fcp/highlevel/PutRequest.java | 2 +- .../java/net/pterodactylus/fcp/highlevel/Request.java | 17 ++++++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/pterodactylus/fcp/highlevel/GetRequest.java b/src/main/java/net/pterodactylus/fcp/highlevel/GetRequest.java index b199197..cc29732 100644 --- a/src/main/java/net/pterodactylus/fcp/highlevel/GetRequest.java +++ b/src/main/java/net/pterodactylus/fcp/highlevel/GetRequest.java @@ -33,7 +33,7 @@ public class GetRequest extends Request { * The persistent Get request to wrap */ GetRequest(PersistentGet persistentGet) { - super(persistentGet.getIdentifier(), persistentGet.getClientToken(), persistentGet.isGlobal()); + super(persistentGet.getIdentifier(), persistentGet.getURI(), persistentGet.getClientToken(), persistentGet.isGlobal()); } } diff --git a/src/main/java/net/pterodactylus/fcp/highlevel/PutRequest.java b/src/main/java/net/pterodactylus/fcp/highlevel/PutRequest.java index 2cafce1..0d505e5 100644 --- a/src/main/java/net/pterodactylus/fcp/highlevel/PutRequest.java +++ b/src/main/java/net/pterodactylus/fcp/highlevel/PutRequest.java @@ -33,7 +33,7 @@ public class PutRequest extends Request { * The FCP message to wrap */ PutRequest(PersistentPut persistentPut) { - super(persistentPut.getIdentifier(), persistentPut.getClientToken(), persistentPut.isGlobal()); + super(persistentPut.getIdentifier(), persistentPut.getURI(), persistentPut.getClientToken(), persistentPut.isGlobal()); } } diff --git a/src/main/java/net/pterodactylus/fcp/highlevel/Request.java b/src/main/java/net/pterodactylus/fcp/highlevel/Request.java index 565c8d7..e269761 100644 --- a/src/main/java/net/pterodactylus/fcp/highlevel/Request.java +++ b/src/main/java/net/pterodactylus/fcp/highlevel/Request.java @@ -31,6 +31,9 @@ public abstract class Request { /** The identifier of the request. */ private final String identifier; + /** The URI of the request. */ + private final String uri; + /** The client token of the request. */ private final String clientToken; @@ -78,14 +81,17 @@ public abstract class Request { * * @param identifier * The identifier of the request + * @param uri + * The URI of the request * @param clientToken * The client token of the request * @param global * true if the request is on the global queue, * false otherwise */ - protected Request(String identifier, String clientToken, boolean global) { + protected Request(String identifier, String uri, String clientToken, boolean global) { this.identifier = identifier; + this.uri = uri; this.clientToken = clientToken; this.global = global; } @@ -100,6 +106,15 @@ public abstract class Request { } /** + * Returns the URI of the request. + * + * @return The request’s URI + */ + public String getUri() { + return uri; + } + + /** * Returns the client token of the request. * * @return The request’s client token -- 2.7.4