2 * jSite2 - TestDDAReply.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 “TestDDAReply” is sent as a response to {@link TestDDARequest}. If you
24 * specified that you wanted to read files from that directory
25 * {@link #getReadFilename()} will give you a filename. Similarly, if you
26 * specified that you want to write in the directory {@link #getWriteFilename()}
27 * will give you a filename to write {@link #getContentToWrite()} to.
29 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
32 public class TestDDAReply extends BaseMessage {
35 * Creates a “TestDDAReply” message that wraps the received message.
37 * @param receivedMessage
38 * The received message
40 TestDDAReply(FcpMessage receivedMessage) {
41 super(receivedMessage);
45 * Returns the directory the TestDDRequest was made for.
47 * @return The directory to test
49 public String getDirectory() {
50 return getField("Directory");
54 * Returns the filename you have to read to proof your ability to read that
57 * @return The name of the file to read
59 public String getReadFilename() {
60 return getField("ReadFilename");
64 * Returns the filename you have to write to to proof your ability to write
65 * to that specific directory.
67 * @return The name of the file write to
69 public String getWriteFilename() {
70 return getField("WriteFilename");
74 * If you requested a test for writing permissions you have to write the
75 * return value of this method to the file given by
76 * {@link #getWriteFilename()}.
78 * @return The content to write to the file
80 public String getContentToWrite() {
81 return getField("ContentToWrite");