X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Futil%2Ffreenet%2Ffcp2%2FClientPut.java;h=99931736e7d794c8e381250ad240111c89f1cfe1;hb=953de352675a4ad91fe307d816a4ea7780c94274;hp=b6b91b19fb6d7999a56c0aebd27c3b910aa6b0a6;hpb=e4f461213da0e30faf9e9eb2e97626abff320618;p=jSite.git diff --git a/src/de/todesbaum/util/freenet/fcp2/ClientPut.java b/src/de/todesbaum/util/freenet/fcp2/ClientPut.java index b6b91b1..9993173 100644 --- a/src/de/todesbaum/util/freenet/fcp2/ClientPut.java +++ b/src/de/todesbaum/util/freenet/fcp2/ClientPut.java @@ -1,6 +1,5 @@ /* - * todesbaum-lib - - * Copyright (C) 2006 David Roden + * jSite - ClientPut.java - Copyright © 2006–2012 David Roden * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,7 +24,7 @@ import java.io.Writer; /** * Abstract base class for all put requests. It contains all parameters that put * requests have in common. - * + * * @author David Roden <droden@gmail.com> * @version $Id$ */ @@ -33,7 +32,7 @@ public abstract class ClientPut extends Command { /** The URI of this request. */ protected final String uri; - + /** The client token of this request. */ protected String clientToken = null; @@ -49,6 +48,9 @@ public abstract class ClientPut extends Command { /** The maximum number of retries of this command. */ protected int maxRetries = 0; + /** Whether to generate the keys early. */ + protected boolean earlyEncode = false; + /** The persistence of this request. */ protected Persistence persistence = Persistence.CONNECTION; @@ -60,7 +62,7 @@ public abstract class ClientPut extends Command { /** * Creates a new put request with the specified name, identifier and URI. - * + * * @param name * The name of this request * @param identifier @@ -75,7 +77,7 @@ public abstract class ClientPut extends Command { /** * Returns whether the node should not try to compress the data. - * + * * @return true if the node should not try * to compress the data */ @@ -90,7 +92,7 @@ public abstract class ClientPut extends Command { * archives like ZIP files. Otherwise the node will try to compress the file * which -- depending on the size of the data -- might take a lot of time * and memory. - * + * * @param dontCompress * true if the node should not * try to compress the data @@ -151,6 +153,29 @@ public abstract class ClientPut extends Command { } /** + * Returns whether the data should be encoded early to generate the final + * key as fast as possible. + * + * @return {@code true} if the key should be generated early, {@code false} + * otherwise + */ + public boolean isEarlyEncode() { + return earlyEncode; + } + + /** + * Sets whether the data should be encoded early to generate the final key + * as fast as possible. + * + * @param earlyEncode + * {@code true} if the key should be generated early, {@code + * false} otherwise + */ + public void setEarlyEncode(boolean earlyEncode) { + this.earlyEncode = earlyEncode; + } + + /** * Returns the priority class of this request. * @return The priority class of this request */ @@ -203,6 +228,7 @@ public abstract class ClientPut extends Command { writer.write("Verbosity=" + verbosity.getValue() + LINEFEED); if (maxRetries != 0) writer.write("MaxRetries=" + maxRetries + LINEFEED); + writer.write("EarlyEncode=" + earlyEncode); if (priorityClass != null) writer.write("PriorityClass=" + priorityClass.getValue() + LINEFEED); writer.write("GetCHKOnly=" + getCHKOnly + LINEFEED);