KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.io.*;
25
26 /**
27  * Tells the server that a particular filename has not been modified in the
28  * checked-out directory.
29  * @author Robert Greig
30  */

31 public class UnchangedRequest extends Request {
32     /**
33      * The filename of the file that is unchanged
34      */

35     private String JavaDoc filename;
36
37     /**
38      * Construct an Unchanged request
39      * @param theFilename the unchanged file's name
40      */

41     public UnchangedRequest(String JavaDoc theFilename) {
42         filename = theFilename;
43     }
44
45     /**
46      * Construct an Unchanged request
47      * @param file the unchanged file
48      */

49     public UnchangedRequest(File file) {
50         filename = file.getName();
51     }
52
53     /**
54      * Get the request String that will be passed to the server
55      * @return the request String
56      * @throws UnconfiguredRequestException if the request has not been
57      * properly configured
58      */

59     public String JavaDoc getRequestString() throws UnconfiguredRequestException {
60         if (filename == null)
61             throw new UnconfiguredRequestException("Filename must be set");
62         return "Unchanged " + filename + "\n"; //NOI18N
63
}
64
65     /**
66      * Is a response expected from the server?
67      * @return true if a response is expected, false if no response if
68      * expected
69      */

70     public boolean isResponseExpected() {
71         return false;
72     }
73 }
Popular Tags