From 90ef444ae9f502750c837076f1588483619a4212 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 10 Apr 2008 06:49:58 +0000 Subject: [PATCH] add TestDDAResponse git-svn-id: http://trooper/svn/projects/jSite/trunk@684 c3eda9e8-030b-0410-8277-bc7414b0a119 --- .../pterodactylus/util/fcp/TestDDAResponse.java | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/net/pterodactylus/util/fcp/TestDDAResponse.java diff --git a/src/net/pterodactylus/util/fcp/TestDDAResponse.java b/src/net/pterodactylus/util/fcp/TestDDAResponse.java new file mode 100644 index 0000000..a682e16 --- /dev/null +++ b/src/net/pterodactylus/util/fcp/TestDDAResponse.java @@ -0,0 +1,65 @@ +/* + * jSite2 - TestDDAResponse.java - + * Copyright © 2008 David Roden + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package net.pterodactylus.util.fcp; + +/** + * A “TestDDAResponse” is sent to let the node know that either created a file + * with the content from {@link TestDDAReply#getContentToWrite()} or that you + * read the content of the file given by {@link TestDDAReply#getReadFilename()}. + * + * @author David Roden <droden@gmail.com> + * @version $Id$ + */ +public class TestDDAResponse extends FcpMessage { + + /** + * Creates a new “TestDDAResponse” message that signals that you created the + * file given by {@link TestDDAReply#getWriteFilename()} and wrote the + * contents given by {@link TestDDAReply#getContentToWrite()} to it. + * + * @param directory + * The directory from the {@link TestDDARequest} command + */ + public TestDDAResponse(String directory) { + this(directory, null); + } + + /** + * Creates a new “TestDDAResponse” message that signals that you created the + * file given by {@link TestDDAReply#getWriteFilename()} with the contents + * given by {@link TestDDAReply#getContentToWrite()} to it (when you + * specified that you want to write to the directory) and/or that you read + * the file given by {@link TestDDAReply#getReadFilename()} (when you + * specified you wanted to read the directory). + * + * @param directory + * The directory from the {@link TestDDARequest} command + * @param readContent + * The read content, or null if you did not + * request read access + */ + public TestDDAResponse(String directory, String readContent) { + super("TestDDAResponse"); + if (readContent != null) { + setField("ReadContent", readContent); + } + } + +} -- 2.7.4