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 program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more 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.,
16 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 $RCSfile: CvsAccess.java,v $
19 Created on $Date: 2003/08/18 11:11:10 $
20 */
21 package net.sf.bloof.scm.cvsplugin;
22
23 import net.sf.bloof.scm.ScmAccess;
24 import net.sf.bloof.scm.ScmConnectionMethod;
25
26 /***
27 * Container for access information in order to access a CVS repository
28 * @author Lukasz Pekacki <pekacki@users.sourceforge.net>
29 * @version $Id: CvsAccess.java,v 1.7 2003/08/18 11:11:10 pekacki Exp $
30 */
31 public class CvsAccess implements ScmAccess {
32 /***
33 * Constructs a CvsAccess object
34 * @param aLocation location of the CVS repository
35 * @param aLoginDetails details of the login
36 * @param aModuleName name of the module to log
37 * @param aName name of the access
38 */
39 public CvsAccess(
40 RepositoryLocation aLocation,
41 LoginDetails aLoginDetails,
42 String aModuleName,
43 String aName) {
44 mLocation = aLocation;
45 mLoginDetails = aLoginDetails;
46 mModuleName = aModuleName;
47 mName = aName;
48 }
49 /***
50 * Constructs a CvsAccess object for accessing a local file or a sample file
51 * @param aLocation location of the CVS repository
52 * @param aLogFileName path to the logfile
53 * @param aName name of the access
54 */
55 public CvsAccess(RepositoryLocation aLocation, String aLogFileName, String aName) {
56 mLocation = aLocation;
57 mLogfilePath = aLogFileName;
58 mName = aName;
59 }
60 /***
61 * Constructs a CvsAccess object for a external connection
62 * @param aLocation location of the CVS repository
63 * @param aExternalCommand external to command to be used
64 * @param aModuleName name of the module to log
65 * @param aIsExternal flag for usage of external command constructor
66 * @param aName name of the access
67 */
68 public CvsAccess(
69 RepositoryLocation aLocation,
70 String aModuleName,
71 String aExternalCommand,
72 boolean aIsExternal,
73 String aName) {
74 if (aIsExternal == false) {
75 throw new IllegalArgumentException("This constructor requires a TRUE value for aIsExternal");
76 }
77 mLocation = aLocation;
78 mModuleName = aModuleName;
79 mExternalCommand = aExternalCommand;
80 mName = aName;
81 }
82
83 /***
84 * Returns the methodof the connection with the SCM system
85 * @return ScmConnectionMethod
86 */
87 public ScmConnectionMethod getConnectionMethod() {
88 return mLocation.getConnectionMethod();
89 } /***
90 * Returns the CVSROOT Representation of this Location
91 * @return CVSROOT Representation of this Location
92 */
93 public String getCvsRoot() {
94 return mLocation.getCvsRoot();
95 }
96
97 /***
98 * Returns the externalCommand.
99 * @return String
100 */
101 public String getExternalCommand() {
102 return mExternalCommand;
103 }
104
105 /***
106 * Return the hostname of the SCM system
107 * @return String hostname of the SCM system
108 */
109 public String getHost() {
110 return mLocation.getHostName();
111 }
112
113 /***
114 * Returns the location.
115 * @return RepositoryLocation
116 */
117 public RepositoryLocation getLocation() {
118 return mLocation;
119 }
120 /***
121 * Returns the path to the logfile on the local disk
122 * @return String path to the logfile on the local disk
123 */
124 public String getLogfilePath() {
125 return mLogfilePath;
126 }
127 /***
128 * Returns the login of the user
129 * @return String login of the user
130 */
131 public String getLogin() {
132 return mLocation.getUserName();
133 }
134
135 /***
136 * Returns the loginDetails.
137 * @return LoginDetails
138 */
139 public LoginDetails getLoginDetails() {
140
141 return mLoginDetails;
142 }
143
144 /***
145 * Returns the modulname of the software project
146 * @return String modulname of the software project
147 */
148 public String getModuleName() {
149 return mModuleName;
150 }
151
152 /***
153 * @see net.sf.bloof.scm.ScmAccess#getName()
154 */
155 public String getName() {
156 return mName;
157 }
158
159 /***
160 * Returns the password of the user
161 * @return String password of the user
162 */
163 public String getPassword() {
164 return mLoginDetails.getPassword();
165 }
166
167 /***
168 * Returns the root directory of the SCM system
169 * @return String root directory of the SCM system
170 */
171 public String getRepositoryRoot() {
172 return mLocation.getRepositoryPath();
173 }
174
175 /***
176 * @see java.lang.Object#toString()
177 */
178 public String toString() {
179 return mName;
180 }
181 private String mExternalCommand;
182 private RepositoryLocation mLocation;
183 private String mLogfilePath;
184 private LoginDetails mLoginDetails;
185
186 private String mModuleName;
187 private String mName;
188
189 }
This page was automatically generated by Maven