X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Ffcp%2Fhighlevel%2FHighLevelProgress.java;h=6a71de6fb970405b58d5a3bff5bfd45e98e622ee;hb=248e7be817e97f0e6d1ae88e8f015cd9eafa0113;hp=403ac30cc523103ef665008bc24d32dc3f05141c;hpb=7b73e6e23b03d9412e9dcc0ff3b4f681baa301c5;p=jFCPlib.git
diff --git a/src/net/pterodactylus/fcp/highlevel/HighLevelProgress.java b/src/net/pterodactylus/fcp/highlevel/HighLevelProgress.java
index 403ac30..6a71de6 100644
--- a/src/net/pterodactylus/fcp/highlevel/HighLevelProgress.java
+++ b/src/net/pterodactylus/fcp/highlevel/HighLevelProgress.java
@@ -30,13 +30,14 @@ package net.pterodactylus.fcp.highlevel;
* request has failed or succeeded. Other fields are not set. If the request is
* not yet finished, {@link #isFetchable()} will tell you whether the request
* has progressed to a state that allows other clients to fetch the inserted
- * data. This is of course only valid for Put and PutDir requests. If none of
- * those methods return true
, you can use the block count
- * methods to get detailed progress statistics. When progress you received is a
- * {@link DownloadResult} you do not need to check
+ * data. This is of course only valid for Put and PutDir requests. Alternatively
+ * {@link #getURI()} can return a non-null
value which signals
+ * that the request generated a URI. If none of those methods return
+ * true
, you can use the block count methods to get detailed
+ * progress statistics. When progress you received is a {@link DownloadResult}
+ * you do not need to check
*
* @author David âBombeâ Roden <bombe@freenetproject.org>
- * @version $Id$
*/
public class HighLevelProgress extends HighLevelResult {
@@ -46,6 +47,9 @@ public class HighLevelProgress extends HighLevelResult {
/** Whether a Put request should be fetchable now. */
private boolean fetchable;
+ /** The generated URI, in case of a Put request. */
+ private String uri;
+
/** The number of total blocks. */
private int totalBlocks;
@@ -90,6 +94,20 @@ public class HighLevelProgress extends HighLevelResult {
}
/**
+ * Creates a new high-level progress for a Put or PutDir request that
+ * generated a URI.
+ *
+ * @param identifier
+ * The identifier of the request
+ * @param uri
+ * The URI of the request
+ */
+ public HighLevelProgress(String identifier, String uri) {
+ this(identifier);
+ this.uri = uri;
+ }
+
+ /**
* Creates a new high-level progress with the given values.
*
* @param identifier
@@ -164,6 +182,26 @@ public class HighLevelProgress extends HighLevelResult {
}
/**
+ * Returns the URI that was generated by the request. Of course only Put and
+ * PutDir requests will generated URIs.
+ *
+ * @return The generated URI
+ */
+ public String getURI() {
+ return uri;
+ }
+
+ /**
+ * Sets the URI generated by the request.
+ *
+ * @param uri
+ * The generated URI
+ */
+ void setURI(String uri) {
+ this.uri = uri;
+ }
+
+ /**
* Returns the number of total blocks.
*
* @return The number of total blocks