Update license to GPLv3, fix header comments
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / TestDDAResponse.java
1 /*
2  * jFCPlib - TestDDAResponse.java - Copyright © 2008–2016 David Roden
3  *
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 3 of the License, or
7  * (at your option) any later version.
8  *
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.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 package net.pterodactylus.fcp;
19
20 /**
21  * A “TestDDAResponse” is sent to let the node know that either created a file
22  * with the content from {@link TestDDAReply#getContentToWrite()} or that you
23  * read the content of the file given by {@link TestDDAReply#getReadFilename()}
24  * .
25  *
26  * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
27  */
28 public class TestDDAResponse extends FcpMessage {
29
30         /**
31          * Creates a new “TestDDAResponse” message that signals that you created
32          * the file given by {@link TestDDAReply#getWriteFilename()} and wrote the
33          * contents given by {@link TestDDAReply#getContentToWrite()} to it.
34          *
35          * @param directory
36          *            The directory from the {@link TestDDARequest} command
37          */
38         public TestDDAResponse(String directory) {
39                 this(directory, null);
40         }
41
42         /**
43          * Creates a new “TestDDAResponse” message that signals that you created
44          * the file given by {@link TestDDAReply#getWriteFilename()} with the
45          * contents given by {@link TestDDAReply#getContentToWrite()} to it (when
46          * you specified that you want to write to the directory) and/or that you
47          * read the file given by {@link TestDDAReply#getReadFilename()} (when you
48          * specified you wanted to read the directory).
49          *
50          * @param directory
51          *            The directory from the {@link TestDDARequest} command
52          * @param readContent
53          *            The read content, or <code>null</code> if you did not request
54          *            read access
55          */
56         public TestDDAResponse(String directory, String readContent) {
57                 super("TestDDAResponse");
58                 setField("Directory", directory);
59                 if (readContent != null) {
60                         setField("ReadContent", readContent);
61                 }
62         }
63
64 }