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  public class AccuRevInfo
27  {
28  
29      private File basedir;
30  
31      private String user;
32  
33      private String workSpace;
34  
35      private String basis;
36  
37      private String top;
38  
39      private String server;
40  
41      private int port;
42  
43      public int getPort()
44      {
45          return port;
46      }
47  
48      public void setPort( int port )
49      {
50          this.port = port;
51      }
52  
53      public String getServer()
54      {
55          return server;
56      }
57  
58      public void setServer( String server )
59      {
60          this.server = server;
61      }
62  
63      public String getUser()
64      {
65          return user;
66      }
67  
68      public void setUser( String user )
69      {
70          this.user = user;
71      }
72  
73      public String getWorkSpace()
74      {
75          return workSpace;
76      }
77  
78      public void setWorkSpace( String workSpace )
79      {
80          this.workSpace = workSpace;
81      }
82  
83      public String getBasis()
84      {
85          return basis;
86      }
87  
88      public void setBasis( String basis )
89      {
90          this.basis = basis;
91      }
92  
93      public String getTop()
94      {
95          return top;
96      }
97  
98      public void setTop( String top )
99      {
100         this.top = top;
101     }
102 
103     public File getBasedir()
104     {
105         return basedir;
106     }
107 
108     public AccuRevInfo( File basedir )
109     {
110 
111         this.basedir = basedir;
112     }
113 
114     public boolean isWorkSpace()
115     {
116         return getWorkSpace() != null;
117     }
118 
119 
120     public boolean isLoggedIn()
121     {
122         return !( this.user == null || "(not logged in)".equals( this.user ) );
123     }
124 
125     public boolean isWorkSpaceTop()
126     {
127         return WorkspaceUtils.isSameFile( this.getBasedir(), this.getTop() );
128 
129     }
130 
131 }