SVN auth
[fedora-idea.git] / plugins / svn4idea / src / org / jetbrains / idea / svn / RootUrlInfo.java
blob4a79ea15ed02d770eafecd9f2c1ac66c0d05a457
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.jetbrains.idea.svn;
18 import com.intellij.openapi.vfs.VirtualFile;
19 import org.tmatesoft.svn.core.SVNURL;
21 import java.io.File;
23 public class RootUrlInfo implements RootUrlPair {
24 private final SVNURL myRepositoryUrlUrl;
25 private final String myRepositoryUrl;
26 private final SVNURL myAbsoluteUrlAsUrl;
27 private final WorkingCopyFormat myFormat;
29 private final File myIoFile;
30 private final VirtualFile myVfile;
31 // vcs root
32 private final VirtualFile myRoot;
34 public RootUrlInfo(final SVNURL repositoryUrl, final SVNURL absoluteUrlAsUrl, final WorkingCopyFormat format, final VirtualFile vfile,
35 final VirtualFile root) {
36 myRepositoryUrlUrl = repositoryUrl;
37 myFormat = format;
38 myVfile = vfile;
39 myRoot = root;
40 myIoFile = new File(myVfile.getPath());
41 final String asString = repositoryUrl.toString();
42 myRepositoryUrl = asString.endsWith("/") ? asString.substring(0, asString.length() - 1) : asString;
43 myAbsoluteUrlAsUrl = absoluteUrlAsUrl;
46 public String getRepositoryUrl() {
47 return myRepositoryUrl;
50 public SVNURL getRepositoryUrlUrl() {
51 return myRepositoryUrlUrl;
54 public String getAbsoluteUrl() {
55 return myAbsoluteUrlAsUrl.toString();
58 public SVNURL getAbsoluteUrlAsUrl() {
59 return myAbsoluteUrlAsUrl;
62 public WorkingCopyFormat getFormat() {
63 return myFormat;
66 public File getIoFile() {
67 return myIoFile;
70 // vcs root
71 public VirtualFile getRoot() {
72 return myRoot;
75 public VirtualFile getVirtualFile() {
76 return myVfile;
79 public String getUrl() {
80 return myAbsoluteUrlAsUrl.toString();