org.tigris.subversion.svnclientadapter.utils
public class SVNUrlUtils extends java.lang.Object
Constructor and Description |
---|
SVNUrlUtils() |
Modifier and Type | Method and Description |
---|---|
static SVNUrl |
getCommonRootUrl(SVNUrl[] urls)
get the common root url for given urls
|
static SVNUrl |
getCommonRootUrl(SVNUrl url1,
SVNUrl url2)
get the common root url for given urls
|
static java.lang.String |
getRelativePath(SVNUrl rootUrl,
SVNUrl url)
Get path of url relative to rootUrl
|
static java.lang.String |
getRelativePath(SVNUrl rootUrl,
SVNUrl url,
boolean includeStartingSlash)
Get path of url relative to rootUrl
|
static SVNUrl |
getUrlFromLocalFileName(java.lang.String localFileName,
java.lang.String parentUrl,
java.lang.String parentPathName)
Get url representing the fileName of working copy.
|
static SVNUrl |
getUrlFromLocalFileName(java.lang.String localFileName,
SVNUrl parentUrl,
java.lang.String parentPathName)
Get url representing the fileName of working copy.
|
public static SVNUrl getCommonRootUrl(SVNUrl url1, SVNUrl url2)
url1
- url2
- public static SVNUrl getCommonRootUrl(SVNUrl[] urls)
urls
- public static java.lang.String getRelativePath(SVNUrl rootUrl, SVNUrl url)
rootUrl
- url
- public static java.lang.String getRelativePath(SVNUrl rootUrl, SVNUrl url, boolean includeStartingSlash)
rootUrl
- url
- includeStartingSlash
- whether the realtive url should start with / or notpublic static SVNUrl getUrlFromLocalFileName(java.lang.String localFileName, SVNUrl parentUrl, java.lang.String parentPathName)
SVNUrl rootUrl = new SVNUrl("http://svn.collab.net:81/repos/mydir");
String rootPath = "C:\\Documents and Settings\\User\\My Documents\\Eclipse\\mydir";
String filePath = "C:\\Documents and Settings\\User\\My Documents\\Eclipse\\mydir\\mydir2\\myFile.txt";
SVNUrl expected = new SVNUrl("http://svn.collab.net:81/repos/mydir/mydir2/myFile.txt");
assertEquals(expected,SVNUrlUtils.getUrlFromLocalFileName(filePath, rootUrl, rootPath));
localFileName
- name of the file representing working copy of resourceparentUrl
- svnUrl of a resource preceeding the localFileName in hierarchyparentPathName
- WC fileName of a resource preceeding the localFileName in hierarchypublic static SVNUrl getUrlFromLocalFileName(java.lang.String localFileName, java.lang.String parentUrl, java.lang.String parentPathName)
SVNUrl rootUrl = new SVNUrl("http://svn.collab.net:81/repos/mydir");
String rootPath = "C:\\Documents and Settings\\User\\My Documents\\Eclipse\\mydir";
String filePath = "C:\\Documents and Settings\\User\\My Documents\\Eclipse\\mydir\\mydir2\\myFile.txt";
SVNUrl expected = new SVNUrl("http://svn.collab.net:81/repos/mydir/mydir2/myFile.txt");
assertEquals(expected,SVNUrlUtils.getUrlFromLocalFileName(filePath, rootUrl, rootPath));
localFileName
- name of the file representing working copy of resourceparentUrl
- url string of a resource preceeding the localFileName in hierarchyparentPathName
- WC fileName of a resource preceeding the localFileName in hierarchy