001    package org.apache.maven.scm.provider.accurev;
002    
003    /*
004     * Licensed to the Apache Software Foundation (ASF) under one
005     * or more contributor license agreements.  See the NOTICE file
006     * distributed with this work for additional information
007     * regarding copyright ownership.  The ASF licenses this file
008     * to you under the Apache License, Version 2.0 (the
009     * "License"); you may not use this file except in compliance
010     * with the License.  You may obtain a copy of the License at
011     *
012     *    http://www.apache.org/licenses/LICENSE-2.0
013     *
014     * Unless required by applicable law or agreed to in writing,
015     * software distributed under the License is distributed on an
016     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017     * KIND, either express or implied.  See the License for the
018     * specific language governing permissions and limitations
019     * under the License.
020     */
021    
022    import java.io.File;
023    
024    import org.apache.maven.scm.provider.accurev.util.WorkspaceUtils;
025    
026    public class AccuRevInfo
027    {
028    
029        private File basedir;
030    
031        private String user;
032    
033        private String workSpace;
034    
035        private String basis;
036    
037        private String top;
038    
039        private String server;
040    
041        private int port;
042    
043        public int getPort()
044        {
045            return port;
046        }
047    
048        public void setPort( int port )
049        {
050            this.port = port;
051        }
052    
053        public String getServer()
054        {
055            return server;
056        }
057    
058        public void setServer( String server )
059        {
060            this.server = server;
061        }
062    
063        public String getUser()
064        {
065            return user;
066        }
067    
068        public void setUser( String user )
069        {
070            this.user = user;
071        }
072    
073        public String getWorkSpace()
074        {
075            return workSpace;
076        }
077    
078        public void setWorkSpace( String workSpace )
079        {
080            this.workSpace = workSpace;
081        }
082    
083        public String getBasis()
084        {
085            return basis;
086        }
087    
088        public void setBasis( String basis )
089        {
090            this.basis = basis;
091        }
092    
093        public String getTop()
094        {
095            return top;
096        }
097    
098        public void setTop( String top )
099        {
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    }