062e6fa2e936eadcd4a231544bea1af592437954
[jSite2.git] / src / net / pterodactylus / util / fcp / TestDDAComplete.java
1 /**
2  * © 2008 INA Service GmbH
3  */
4 package net.pterodactylus.util.fcp;
5
6 /**
7  * The “TestDDAComplete” message signals that the node has finished checking
8  * your read and write access to a certain directory.
9  * 
10  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
11  * @version $Id$
12  */
13 public class TestDDAComplete extends BaseMessage {
14
15         /**
16          * Creates a new “TestDDAComplete” message that wraps the received message.
17          * 
18          * @param receivedMessage
19          *            The received message
20          */
21         TestDDAComplete(FcpMessage receivedMessage) {
22                 super(receivedMessage);
23         }
24
25         /**
26          * Returns the directory the authorization is given for.
27          * 
28          * @return The directory that was tested for read and/or write access
29          */
30         public String getDirectory() {
31                 return getField("Directory");
32         }
33
34         /**
35          * Returns whether read access to the directory is allowed.
36          * 
37          * @return <code>true</code> if the client is allowed to read from that
38          *         directory, <code>false</code> otherwise
39          */
40         public boolean isReadDirectoryAllowed() {
41                 return Boolean.valueOf(getField("ReadDirectoryAllowed"));
42         }
43
44         /**
45          * Returns whether write access to the directory is allowed.
46          * 
47          * @return <code>true</code> if the client is allowed to write into that
48          *         directory, <code>false</code> otherwise
49          */
50         public boolean isWriteDirectoryAllowed() {
51                 return Boolean.valueOf(getField("WriteDirectoryAllowed"));
52         }
53
54 }