Java Code Examples for org.tigris.subversion.svnclientadapter.SVNUrl#getParent()

The following examples show how to use org.tigris.subversion.svnclientadapter.SVNUrl#getParent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChooseRootUrlDialog.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
    * 
 * @param parent
    * @param url : the url from which we want to get the root url 
 */
public ChooseRootUrlDialog(Shell parent, SVNUrl url) {
	super(parent);
       this.url = url;
       
       List list = new ArrayList();
       
       // we want the user can select "no root url", ie a blank url
       list.add(""); // we cannot add null, we would have a NullPointerException //$NON-NLS-1$
       SVNUrl possibleRoot = this.url;
       while (possibleRoot != null) {
           list.add(possibleRoot);
           possibleRoot = possibleRoot.getParent();
       }        
       
       setTitle(Policy.bind("ChooseRootUrlDialog.rootUrlDialogTitle")); //$NON-NLS-1$
       setAddCancelButton(true);
       setLabelProvider(new LabelProvider());
       setMessage(Policy.bind("ChooseRootUrlDialog.chooseRootUrl")); //$NON-NLS-1$
       setContentProvider(new ListContentProvider());
       setInput(list);
}
 
Example 2
Source File: RevisionSetupsSupport.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private SVNDiffSummary[] getCachedSummaries (SVNUrl url, SVNRevision leftRevision, SVNRevision rightRevision) {
    String revisionString = "@" + leftRevision + ":" + rightRevision;
    boolean direct = true;
    while (url != null) {
        SVNDiffSummary[] sums = diffSummaryCache.get(url.toString() + revisionString);
        if (sums != null) {
            return direct ? sums : new SVNDiffSummary[0];
        }
        direct = false;
        url = url.getParent();
    }
    return null;
}
 
Example 3
Source File: RevisionSetupsSupport.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private boolean parentMissing (SVNUrl url, SVNRevision revision) {
    while (url != null) {
        if (missingURLs.contains(url.toString() + "@" + revision)) {
            return true;
        }
        url = url.getParent();
    }
    return false;
}
 
Example 4
Source File: ProjectProperties.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private static String resolveUrl(String url, ISVNLocalResource svnResource) {
	String resolvedUrl = null;
	
	// Relative to repository root, with navigators.
	if (url.startsWith("^/")) {
		SVNUrl repositoryUrl = svnResource.getRepository().getUrl();
		String path = url.substring(1);
		while (path.startsWith("/..")) {
			if (repositoryUrl.getParent() == null) break;
			repositoryUrl = repositoryUrl.getParent();
			path = path.substring(3);
		}
		resolvedUrl = repositoryUrl + path;
	}
	
	// Relative to host.
	else if (url.startsWith("/")) {
		String resourceUrl = svnResource.getUrl().toString();
		String protocol = svnResource.getUrl().getProtocol();
		int start = protocol.length();
		while (resourceUrl.substring(start, start + 1).equals(":") || resourceUrl.substring(start, start + 1).equals("/"))
			start++;
		int end = resourceUrl.indexOf("/", start);
		if (end == -1) resolvedUrl = resourceUrl + url;
		else resolvedUrl = resourceUrl.substring(0, end) + url;
	}
	
	//  Non-relative
	else resolvedUrl = url;
	
	return resolvedUrl;
}