1 /*
2 Bloof - visualize the evolution of your software project
3 Copyright ( C ) 2003 Lukasz Pekacki <lukasz@pekacki.de>
4 http://bloof.sf.net/
5
6 This file was part of JavaCVS by Nicholas Allen ( nallen@freenet.co.uk ).
7
8 This program is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License along with
17 this program; if not, write to the Free Software Foundation, Inc.,
18 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20 $RCSfile: CvsConnectionMethod.java,v $
21 Created on $Date: 2003/09/06 08:35:09 $
22 */
23
24 package net.sf.bloof.scm.cvsplugin;
25
26 import net.sf.bloof.scm.ScmConnectionMethod;
27
28 /***
29 * Defines the possible types of connection methods.
30 * @author Nicholas Allen
31 * @author Lukasz Pekacki
32 * */
33 public final class CvsConnectionMethod implements ScmConnectionMethod {
34 private CvsConnectionMethod(String aMethod) {
35 mMethod = aMethod;
36 }
37
38 /***
39 * Returns the Type of connection as used in CVSROOT
40 * @return Type of connection as used in CVSROOT
41 */
42 public String getCvsRootMethodName() {
43 if (mMethod != ID_SSH) {
44 return mMethod;
45 } else {
46 return ID_EXT;
47 }
48 }
49 /***
50 * Returns if this connection is a SSH connection or not
51 * @return if this connection is a SSH connection or not
52 */
53 public boolean isSsh() {
54 return mMethod == ID_SSH;
55 }
56
57 /***
58 * @see java.lang.Object#toString( )
59 */
60 public String toString() {
61 return mMethod;
62 }
63
64 /***
65 * Valid connection methods
66 * */
67 public static final String METHOD_LOCAL = "local",
68 ID_PSERVER = "pserver",
69 ID_EXT = "ext",
70 ID_SSH = "ssh",
71 ID_LOGFILE = "logfile",
72 ID_SAMPLE = "sample";
73 /***
74 * CvsConnectionMethod Types
75 * */
76 public static final CvsConnectionMethod LOCAL = new CvsConnectionMethod(METHOD_LOCAL),
77 PSERVER = new CvsConnectionMethod(ID_PSERVER),
78 EXT = new CvsConnectionMethod(ID_EXT),
79 SSH = new CvsConnectionMethod(ID_SSH),
80 LOGFILE = new CvsConnectionMethod(ID_LOGFILE),
81 SAMPLE = new CvsConnectionMethod(ID_SAMPLE);
82 private String mMethod;
83
84 }
This page was automatically generated by Maven