Reformat source code, new line length for comments (79), some trailing whitespace...
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / URIGenerated.java
1 /*
2  * jFCPlib - URIGenerated.java - Copyright © 2008 David Roden
3  *
4  * This program is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU General Public License as published by the Free Software
6  * Foundation; either version 2 of the License, or (at your option) any later
7  * version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16  * Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18
19 package net.pterodactylus.fcp;
20
21 /**
22  * The “URIGenerated” message signals the client that an URI was generated for
23  * a {@link ClientPut} (or {@link ClientPutDiskDir} or
24  * {@link ClientPutComplexDir} ) request.
25  *
26  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
27  */
28 public class URIGenerated extends BaseMessage implements Identifiable {
29
30         /**
31          * Creates a new “URIGenerated” message that wraps the received message.
32          *
33          * @param receivedMessage
34          *            The received message
35          */
36         URIGenerated(FcpMessage receivedMessage) {
37                 super(receivedMessage);
38         }
39
40         /**
41          * Returns the identifier of the request that generated an URI.
42          *
43          * @return The identifier of the request
44          */
45         @Override
46         public String getIdentifier() {
47                 return getField("Identifier");
48         }
49
50         /**
51          * Returns the URI that was generated by the request.
52          *
53          * @return The URI that was generated by the request
54          */
55         public String getURI() {
56                 return getField("URI");
57         }
58
59         /**
60          * Returns whether the request that generated the URI is on the global
61          * queue or on the client-local queue.
62          *
63          * @return <code>true</code> if the request is on the global queue,
64          *         <code>false</code> if it is on the client-local queue
65          */
66         public boolean isGlobal() {
67                 return Boolean.parseBoolean(getField("Global"));
68         }
69
70 }