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.util.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>
29 public class ClientPutDiskDir extends FcpMessage {
32 * Creates a new “ClientPutDiskDir” message.
35 * The URI to insert the file to
37 * The identifier of the request
39 * The name of the directory to insert
41 public ClientPutDiskDir(String uri, String identifier, String directory) {
42 super("ClientPutDiskDir");
44 setField("Identifier", identifier);
45 setField("Filename", directory);
49 * The verbosity of the request. Depending on this parameter you will
50 * received only the bare minimum of messages for the request (i.e. “it
51 * completed”) or a whole lot more.
55 * The verbosity of the request
57 public void setVerbosity(Verbosity verbosity) {
58 setField("Verbosity", String.valueOf(verbosity));
62 * The number of retries for a request if the initial try failed.
65 * The maximum number of retries after failure, or
66 * <code>-1</code> to retry forever.
68 public void setMaxRetries(int maxRetries) {
69 setField("MaxRetries", String.valueOf(maxRetries));
73 * Sets the priority of the request.
76 * The priority of the request
78 public void setPriority(Priority priority) {
79 setField("PriorityClass", String.valueOf(priority));
83 * Determines whether the node should really insert the data or generate the
87 * <code>true</code> to generate the final CHK only,
88 * <code>false</code> to really insert the data
90 public void setGetCHKOnly(boolean getCHKOnly) {
91 setField("GetCHKOnly", String.valueOf(getCHKOnly));
95 * Determines whether this request appears on the global queue.
98 * <code>true</code> to put the request on the global queue,
99 * <code>false</code> for the client-local queue.
101 public void setGlobal(boolean global) {
102 setField("Global", String.valueOf(global));
106 * Determines whether the node should skip compression because the file has
107 * already been compressed.
109 * @param dontCompress
110 * <code>true</code> to skip compression of the data in the
111 * node, <code>false</code> to allow compression
113 public void setDontCompress(boolean dontCompress) {
114 setField("DontCompress", String.valueOf(dontCompress));
118 * Sets an optional client token. This client token is mentioned in progress
119 * and other request-related messages and can be used to identify this
125 public void setClientToken(String clientToken) {
126 setField("ClientToken", clientToken);
130 * Sets the persistence of this request.
133 * The persistence of this request
135 public void setPersistence(Persistence persistence) {
136 setField("Persistence", String.valueOf(persistence));
140 * Sets the name of the default file. The default file is shown when the key
141 * is requested with an additional name.
144 * The name of the default file
146 public void setDefaultName(String defaultName) {
147 setField("DefaultName", defaultName);
151 * Sets whether unreadable files allow the insert to continue.
153 * @param allowUnreadableFiles
154 * <code>true</code> to just ignore unreadable files,
155 * <code>false</code> to let the insert fail when an unreadable
156 * file is encountered
158 public void setAllowUnreadableFiles(boolean allowUnreadableFiles) {
159 setField("AllowUnreadableFiles", String.valueOf(allowUnreadableFiles));