Expose lots of constructors and accessors
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / TestDDAReply.java
1 /*
2  * jFCPlib - TestDDAReply.java - Copyright © 2008 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 2 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, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18
19 package net.pterodactylus.fcp;
20
21 /**
22  * The “TestDDAReply” is sent as a response to {@link TestDDARequest}. If you
23  * specified that you wanted to read files from that directory
24  * {@link #getReadFilename()} will give you a filename. Similarly, if you
25  * specified that you want to write in the directory
26  * {@link #getWriteFilename()} will give you a filename to write
27  * {@link #getContentToWrite()} to.
28  *
29  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
30  */
31 public class TestDDAReply extends BaseMessage {
32
33         /**
34          * Creates a “TestDDAReply” message that wraps the received message.
35          *
36          * @param receivedMessage
37          *            The received message
38          */
39         public TestDDAReply(FcpMessage receivedMessage) {
40                 super(receivedMessage);
41         }
42
43         /**
44          * Returns the directory the TestDDRequest was made for.
45          *
46          * @return The directory to test
47          */
48         public String getDirectory() {
49                 return getField("Directory");
50         }
51
52         /**
53          * Returns the filename you have to read to proof your ability to read that
54          * specific directory.
55          *
56          * @return The name of the file to read
57          */
58         public String getReadFilename() {
59                 return getField("ReadFilename");
60         }
61
62         /**
63          * Returns the filename you have to write to to proof your ability to write
64          * to that specific directory.
65          *
66          * @return The name of the file write to
67          */
68         public String getWriteFilename() {
69                 return getField("WriteFilename");
70         }
71
72         /**
73          * If you requested a test for writing permissions you have to write the
74          * return value of this method to the file given by
75          * {@link #getWriteFilename()}.
76          *
77          * @return The content to write to the file
78          */
79         public String getContentToWrite() {
80                 return getField("ContentToWrite");
81         }
82
83 }