Formatting fixes.
[jFCPlib.git] / src / net / pterodactylus / fcp / TestDDAResponse.java
1 /*
2  * jSite2 - TestDDAResponse.java -
3  * Copyright © 2008 David Roden
4  *
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.
9  *
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.
14  *
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.
18  */
19
20 package net.pterodactylus.fcp;
21
22 /**
23  * A “TestDDAResponse” is sent to let the node know that either created a file
24  * with the content from {@link TestDDAReply#getContentToWrite()} or that you
25  * read the content of the file given by {@link TestDDAReply#getReadFilename()}.
26  * 
27  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
28  */
29 public class TestDDAResponse extends FcpMessage {
30
31         /**
32          * Creates a new “TestDDAResponse” message that signals that you created the
33          * file given by {@link TestDDAReply#getWriteFilename()} and wrote the
34          * contents given by {@link TestDDAReply#getContentToWrite()} to it.
35          * 
36          * @param directory
37          *            The directory from the {@link TestDDARequest} command
38          */
39         public TestDDAResponse(String directory) {
40                 this(directory, null);
41         }
42
43         /**
44          * Creates a new “TestDDAResponse” message that signals that you created the
45          * file given by {@link TestDDAReply#getWriteFilename()} with the contents
46          * given by {@link TestDDAReply#getContentToWrite()} to it (when you
47          * specified that you want to write to the directory) and/or that you read
48          * the file given by {@link TestDDAReply#getReadFilename()} (when you
49          * specified you wanted to read the directory).
50          * 
51          * @param directory
52          *            The directory from the {@link TestDDARequest} command
53          * @param readContent
54          *            The read content, or <code>null</code> if you did not request
55          *            read access
56          */
57         public TestDDAResponse(String directory, String readContent) {
58                 super("TestDDAResponse");
59                 if (readContent != null) {
60                         setField("ReadContent", readContent);
61                 }
62         }
63
64 }