2 * jFCPlib - ClientPutDiskDir.java - Copyright © 2008 David Roden
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 package net.pterodactylus.fcp;
22 * The “ClientPutDiskDir” message is used to insert a complete directory from
23 * the disk to a single key.
25 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
27 public class ClientPutDiskDir extends FcpMessage {
30 * Creates a new “ClientPutDiskDir” message.
33 * The URI to insert the file to
35 * The identifier of the request
37 * The name of the directory to insert
39 public ClientPutDiskDir(String uri, String identifier, String directory) {
40 super("ClientPutDiskDir");
42 setField("Identifier", identifier);
43 setField("Filename", directory);
47 * The verbosity of the request. Depending on this parameter you will
48 * received only the bare minimum of messages for the request (i.e. “it
49 * completed”) or a whole lot more.
53 * The verbosity of the request
55 public void setVerbosity(Verbosity verbosity) {
56 setField("Verbosity", String.valueOf(verbosity));
60 * The number of retries for a request if the initial try failed.
63 * The maximum number of retries after failure, or
64 * <code>-1</code> to retry forever.
66 public void setMaxRetries(int maxRetries) {
67 setField("MaxRetries", String.valueOf(maxRetries));
71 * Sets the priority of the request.
74 * The priority of the request
76 public void setPriority(Priority priority) {
77 setField("PriorityClass", String.valueOf(priority));
81 * Determines whether the node should really insert the data or generate the
85 * <code>true</code> to generate the final CHK only,
86 * <code>false</code> to really insert the data
88 public void setGetCHKOnly(boolean getCHKOnly) {
89 setField("GetCHKOnly", String.valueOf(getCHKOnly));
93 * Sets whether an insert request should be forked when it is cached.
95 * @param forkOnCacheable
96 * {@code true} to fork the insert when it is cached, {@code
99 public void setForkOnCacheable(boolean forkOnCacheable) {
100 setField("ForkOnCacheable", String.valueOf(forkOnCacheable));
104 * Determines whether this request appears on the global queue.
107 * <code>true</code> to put the request on the global queue,
108 * <code>false</code> for the client-local queue.
110 public void setGlobal(boolean global) {
111 setField("Global", String.valueOf(global));
115 * Determines whether the node should skip compression because the file has
116 * already been compressed.
118 * @param dontCompress
119 * <code>true</code> to skip compression of the data in the node,
120 * <code>false</code> to allow compression
122 public void setDontCompress(boolean dontCompress) {
123 setField("DontCompress", String.valueOf(dontCompress));
127 * Sets an optional client token. This client token is mentioned in progress
128 * and other request-related messages and can be used to identify this
134 public void setClientToken(String clientToken) {
135 setField("ClientToken", clientToken);
139 * Sets the persistence of this request.
142 * The persistence of this request
144 public void setPersistence(Persistence persistence) {
145 setField("Persistence", String.valueOf(persistence));
149 * Sets the name of the default file. The default file is shown when the key
150 * is requested with an additional name.
153 * The name of the default file
155 public void setDefaultName(String defaultName) {
156 setField("DefaultName", defaultName);
160 * Sets whether unreadable files allow the insert to continue.
162 * @param allowUnreadableFiles
163 * <code>true</code> to just ignore unreadable files,
164 * <code>false</code> to let the insert fail when an unreadable
165 * file is encountered
167 public void setAllowUnreadableFiles(boolean allowUnreadableFiles) {
168 setField("AllowUnreadableFiles", String.valueOf(allowUnreadableFiles));