2 * jSite2 - ClientPutDiskDir.java -
3 * Copyright © 2008 David Roden
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package net.pterodactylus.fcp;
23 * The “ClientPutDiskDir” message is used to insert a complete directory from
24 * the disk to a single key.
26 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
28 public class ClientPutDiskDir extends FcpMessage {
31 * Creates a new “ClientPutDiskDir” message.
34 * The URI to insert the file to
36 * The identifier of the request
38 * The name of the directory to insert
40 public ClientPutDiskDir(String uri, String identifier, String directory) {
41 super("ClientPutDiskDir");
43 setField("Identifier", identifier);
44 setField("Filename", directory);
48 * The verbosity of the request. Depending on this parameter you will
49 * received only the bare minimum of messages for the request (i.e. “it
50 * completed”) or a whole lot more.
54 * The verbosity of the request
56 public void setVerbosity(Verbosity verbosity) {
57 setField("Verbosity", String.valueOf(verbosity));
61 * The number of retries for a request if the initial try failed.
64 * The maximum number of retries after failure, or
65 * <code>-1</code> to retry forever.
67 public void setMaxRetries(int maxRetries) {
68 setField("MaxRetries", String.valueOf(maxRetries));
72 * Sets the priority of the request.
75 * The priority of the request
77 public void setPriority(Priority priority) {
78 setField("PriorityClass", String.valueOf(priority));
82 * Determines whether the node should really insert the data or generate the
86 * <code>true</code> to generate the final CHK only,
87 * <code>false</code> to really insert the data
89 public void setGetCHKOnly(boolean getCHKOnly) {
90 setField("GetCHKOnly", String.valueOf(getCHKOnly));
94 * Determines whether this request appears on the global queue.
97 * <code>true</code> to put the request on the global queue,
98 * <code>false</code> for the client-local queue.
100 public void setGlobal(boolean global) {
101 setField("Global", String.valueOf(global));
105 * Determines whether the node should skip compression because the file has
106 * already been compressed.
108 * @param dontCompress
109 * <code>true</code> to skip compression of the data in the
110 * node, <code>false</code> to allow compression
112 public void setDontCompress(boolean dontCompress) {
113 setField("DontCompress", String.valueOf(dontCompress));
117 * Sets an optional client token. This client token is mentioned in progress
118 * and other request-related messages and can be used to identify this
124 public void setClientToken(String clientToken) {
125 setField("ClientToken", clientToken);
129 * Sets the persistence of this request.
132 * The persistence of this request
134 public void setPersistence(Persistence persistence) {
135 setField("Persistence", String.valueOf(persistence));
139 * Sets the name of the default file. The default file is shown when the key
140 * is requested with an additional name.
143 * The name of the default file
145 public void setDefaultName(String defaultName) {
146 setField("DefaultName", defaultName);
150 * Sets whether unreadable files allow the insert to continue.
152 * @param allowUnreadableFiles
153 * <code>true</code> to just ignore unreadable files,
154 * <code>false</code> to let the insert fail when an unreadable
155 * file is encountered
157 public void setAllowUnreadableFiles(boolean allowUnreadableFiles) {
158 setField("AllowUnreadableFiles", String.valueOf(allowUnreadableFiles));