View Javadoc
1   package org.apache.maven.scm.provider.accurev;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *    http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.io.File;
23  
24  import org.apache.maven.scm.provider.accurev.util.WorkspaceUtils;
25  
26  /**
27   * 
28   */
29  public class AccuRevInfo
30  {
31  
32      private File basedir;
33  
34      private String user;
35  
36      private String workSpace;
37  
38      private String basis;
39  
40      private String top;
41  
42      private String server;
43  
44      private int port;
45  
46      public int getPort()
47      {
48          return port;
49      }
50  
51      public void setPort( int port )
52      {
53          this.port = port;
54      }
55  
56      public String getServer()
57      {
58          return server;
59      }
60  
61      public void setServer( String server )
62      {
63          this.server = server;
64      }
65  
66      public String getUser()
67      {
68          return user;
69      }
70  
71      public void setUser( String user )
72      {
73          this.user = user;
74      }
75  
76      public String getWorkSpace()
77      {
78          return workSpace;
79      }
80  
81      public void setWorkSpace( String workSpace )
82      {
83          this.workSpace = workSpace;
84      }
85  
86      public String getBasis()
87      {
88          return basis;
89      }
90  
91      public void setBasis( String basis )
92      {
93          this.basis = basis;
94      }
95  
96      public String getTop()
97      {
98          return top;
99      }
100 
101     public void setTop( String top )
102     {
103         this.top = top;
104     }
105 
106     public File getBasedir()
107     {
108         return basedir;
109     }
110 
111     public AccuRevInfo( File basedir )
112     {
113 
114         this.basedir = basedir;
115     }
116 
117     public boolean isWorkSpace()
118     {
119         return getWorkSpace() != null;
120     }
121 
122 
123     public boolean isLoggedIn()
124     {
125         return !( this.user == null || "(not logged in)".equals( this.user ) );
126     }
127 
128     public boolean isWorkSpaceTop()
129     {
130         return WorkspaceUtils.isSameFile( this.getBasedir(), this.getTop() );
131 
132     }
133 
134 }