KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > lib > cvsclient > request > EntryRequest


1 /*****************************************************************************
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14
15  * The Original Software is the CVS Client Library.
16  * The Initial Developer of the Original Software is Robert Greig.
17  * Portions created by Robert Greig are Copyright (C) 2000.
18  * All Rights Reserved.
19
20  * Contributor(s): Robert Greig.
21  *****************************************************************************/

22 package org.netbeans.lib.cvsclient.request;
23
24 import org.netbeans.lib.cvsclient.admin.*;
25
26 /**
27  * Sends an entry to the server, to tell the server which version of a file
28  * is on the local machine. The filename is relative to the most recent
29  * Directory request. Note that if an <pre>Entry</pre> request is sent
30  * without <pre>Modified</pre>, <pre>Is-Modified</pre> or <pre>Unchanged</pre>
31  * it means that the file is lost. Also note that if <pre>Modified</pre>,
32  * <pre>Is-Modified</pre> or </pre>Unchanged</pre> is sent with <pre>Entry
33  * </pre> then </pre>Entry</pre> must be sent first.
34  * @author Robert Greig
35  * @see org.netbeans.lib.cvsclient.request.DirectoryRequest
36  * @see org.netbeans.lib.cvsclient.request.ModifiedRequest
37  * @see org.netbeans.lib.cvsclient.request.ModifiedRequest
38  * @see org.netbeans.lib.cvsclient.request.UnchangedRequest
39  */

40 public class EntryRequest extends Request {
41     /**
42      * The Entry sent by this request
43      */

44     private Entry entry;
45
46     /**
47      * Create an EntryRequest
48      * @param theEntry the Entry to send
49      */

50     public EntryRequest(Entry theEntry) {
51         if (theEntry == null)
52             throw new IllegalArgumentException JavaDoc("EntryRequest: Entry must not " +
53                                                "be null");
54         entry = theEntry;
55     }
56
57     /**
58      * Get the request String that will be passed to the server
59      * @return the request String
60      * @throws UnconfiguredRequestException if the request has not been
61      * properly configured
62      */

63     public String JavaDoc getRequestString() throws UnconfiguredRequestException {
64         return "Entry " + entry.toString() + "\n"; //NOI18N
65
}
66
67     /**
68      * Is a response expected from the server?
69      * @return true if a response is expected, false if no response if
70      * expected
71      */

72     public boolean isResponseExpected() {
73         return false;
74     }
75
76     public Entry getEntry() {
77         return entry;
78     }
79
80 }
Popular Tags