001package 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 022import java.io.File; 023 024import org.apache.maven.scm.provider.accurev.util.WorkspaceUtils; 025 026/** 027 * 028 */ 029public class AccuRevInfo 030{ 031 032 private File basedir; 033 034 private String user; 035 036 private String workSpace; 037 038 private String basis; 039 040 private String top; 041 042 private String server; 043 044 private int port; 045 046 public int getPort() 047 { 048 return port; 049 } 050 051 public void setPort( int port ) 052 { 053 this.port = port; 054 } 055 056 public String getServer() 057 { 058 return server; 059 } 060 061 public void setServer( String server ) 062 { 063 this.server = server; 064 } 065 066 public String getUser() 067 { 068 return user; 069 } 070 071 public void setUser( String user ) 072 { 073 this.user = user; 074 } 075 076 public String getWorkSpace() 077 { 078 return workSpace; 079 } 080 081 public void setWorkSpace( String workSpace ) 082 { 083 this.workSpace = workSpace; 084 } 085 086 public String getBasis() 087 { 088 return basis; 089 } 090 091 public void setBasis( String basis ) 092 { 093 this.basis = basis; 094 } 095 096 public String getTop() 097 { 098 return top; 099 } 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}