From: David ‘Bombe’ Roden Date: Thu, 22 Oct 2020 17:26:09 +0000 (+0200) Subject: ✨ Expose URI from get/put requests X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4e956eb43ea06a3b85b2cf0a9839e7c24e6650fe;p=jFCPlib.git ✨ Expose URI from get/put requests --- 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