当前位置: 首页>>代码示例>>Java>>正文


Java SVNUrl.appendPath方法代码示例

本文整理汇总了Java中org.tigris.subversion.svnclientadapter.SVNUrl.appendPath方法的典型用法代码示例。如果您正苦于以下问题:Java SVNUrl.appendPath方法的具体用法?Java SVNUrl.appendPath怎么用?Java SVNUrl.appendPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.tigris.subversion.svnclientadapter.SVNUrl的用法示例。


在下文中一共展示了SVNUrl.appendPath方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RepositoryFile

import org.tigris.subversion.svnclientadapter.SVNUrl; //导入方法依赖的package包/类
public RepositoryFile(SVNUrl repositoryUrl, String[] pathSegments, SVNRevision revision) throws MalformedURLException {
    this(repositoryUrl, revision);
    this.pathSegments = pathSegments;    
    repositoryRoot = pathSegments == null;        
    
    if(!repositoryRoot) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < pathSegments.length; i++) {
            sb.append(pathSegments[i]);
            if(i<pathSegments.length-1) {
            sb.append("/"); // NOI18N
            }            
        }
        path = sb.toString();        
        fileUrl = repositoryUrl.appendPath(path);        
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:RepositoryFile.java

示例2: rollback

import org.tigris.subversion.svnclientadapter.SVNUrl; //导入方法依赖的package包/类
/**
 * Overwrites local file with this revision.
 *
 * @param event
 */
private static void rollback(final RepositoryRevision.Event[] events) {
    // TODO: confirmation
    SVNUrl repository = events[0].getLogInfoHeader().getRepositoryRootUrl();
    RequestProcessor rp = Subversion.getInstance().getRequestProcessor(repository);
    SvnProgressSupport support = new SvnProgressSupport() {
        @Override
        public void perform() {
            for(RepositoryRevision.Event event : events) {
                File file = event.getFile();
                boolean wasDeleted = event.getChangedPath().getAction() == 'D';
                SVNUrl repoUrl = event.getLogInfoHeader().getRepositoryRootUrl();
                SVNUrl fileUrl = repoUrl.appendPath(event.getChangedPath().getPath());                    
                SVNRevision.Number revision = event.getLogInfoHeader().getLog().getRevision();
                SvnUtils.rollback(file, repoUrl, fileUrl, revision, wasDeleted, getLogger());
            }
        }
    };
    support.start(rp, repository, NbBundle.getMessage(SummaryView.class, "MSG_Rollback_Progress")); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:SummaryView.java

示例3: testImportFolder

import org.tigris.subversion.svnclientadapter.SVNUrl; //导入方法依赖的package包/类
public void testImportFolder() throws Exception {                                        
    File folder = createFolder("folder");
            
    assertTrue(folder.exists());
    
    ISVNClientAdapter c = getNbClient();
    SVNUrl url = getTestUrl().appendPath(getName()); 
    c.mkdir(url, "mrkvadir");        
    url = url.appendPath(folder.getName());
    c.mkdir(url, "mrkvadir");        
    c.doImport(folder, url, "imprd", false);

    assertTrue(folder.exists());
    assertStatus(SVNStatusKind.UNVERSIONED, folder);
    
    ISVNInfo info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    assertNotifiedFiles(new File[] {});        // XXX empty also in svnCA - why?! - no output from cli
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ImportTestHidden.java

示例4: viewFile

import org.tigris.subversion.svnclientadapter.SVNUrl; //导入方法依赖的package包/类
void viewFile (boolean showAnnotations) {
    File originFile = getFile();
    SVNRevision rev = getLogInfoHeader().getLog().getRevision();
    SVNUrl repoUrl = getLogInfoHeader().getRepositoryRootUrl();
    SVNUrl fileUrl = repoUrl.appendPath(getChangedPath().getPath());
    SvnUtils.openInRevision(originFile, repoUrl, fileUrl, rev, rev, showAnnotations);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:RepositoryRevision.java

示例5: rollback

import org.tigris.subversion.svnclientadapter.SVNUrl; //导入方法依赖的package包/类
void rollback () {
    SvnProgressSupport support = new SvnProgressSupport() {
        @Override
        public void perform() {
            File file = getFile();
            boolean wasDeleted = getChangedPath().getAction() == 'D';
            SVNUrl repoUrl = getLogInfoHeader().getRepositoryRootUrl();
            SVNUrl fileUrl = repoUrl.appendPath(getChangedPath().getPath());                    
            SVNRevision.Number revision = getLogInfoHeader().getLog().getRevision();
            SvnUtils.rollback(file, repoUrl, fileUrl, revision, wasDeleted, getLogger());
        }
    };
    support.start(Subversion.getInstance().getRequestProcessor(repositoryRootUrl),
            repositoryRootUrl, NbBundle.getMessage(RepositoryRevision.class, "MSG_Rollback_Progress")); //NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:RepositoryRevision.java

示例6: mkdirs

import org.tigris.subversion.svnclientadapter.SVNUrl; //导入方法依赖的package包/类
public static void mkdirs(File repoDir, String folder) throws SVNClientException, MalformedURLException {
    ISVNClientAdapter client = getClient();
    String url = TestUtilities.formatFileURL(repoDir);
    SVNUrl repoUrl = new SVNUrl(url);
    repoUrl = repoUrl.appendPath(folder);
    client.mkdir(repoUrl, true, "creating folder " + folder);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:TestKit.java

示例7: testMkdirUrlParents

import org.tigris.subversion.svnclientadapter.SVNUrl; //导入方法依赖的package包/类
private void testMkdirUrlParents(String... urlPathSegments) throws Exception {
    ISVNClientAdapter c = getNbClient();        
    SVNUrl url = getRepoUrl();
    for (String pathSegment : urlPathSegments) {
        url = url.appendPath(pathSegment);
    }
    c.mkdir(url, true, "trkvadir");       

    ISVNInfo info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    assertNotifiedFiles(new File[] {});        
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:MkdirTestHidden.java

示例8: testImportFolderNonRecursivelly

import org.tigris.subversion.svnclientadapter.SVNUrl; //导入方法依赖的package包/类
public void testImportFolderNonRecursivelly() throws Exception {                                        
    File folder = createFolder("folder");
    File folder1 = createFolder(folder, "folder1");
    File file = createFile(folder1, "file");
            
    assertTrue(folder.exists());
    assertTrue(folder1.exists());
    assertTrue(file.exists());
    
    ISVNClientAdapter c = getNbClient();
    SVNUrl url = getTestUrl().appendPath(getName());
    c.mkdir(url, "mrkvadir");        
    url = url.appendPath(folder.getName());
    c.mkdir(url, "mrkvadir");        
    c.doImport(folder, url, "imprd", false);

    assertTrue(folder.exists());
    assertTrue(folder1.exists());
    assertTrue(file.exists());
    assertStatus(SVNStatusKind.UNVERSIONED, folder);
    assertStatus(SVNStatusKind.UNVERSIONED, folder1);
    assertStatus(SVNStatusKind.UNVERSIONED, file);
    
    ISVNInfo info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    
    SVNClientException ex = null;
    try {
        info = getInfo(url.appendPath(folder1.getName()));
    } catch (SVNClientException e) {
        ex = e;
    }
    assertNotNull(ex);
    assertNotifiedFiles(new File[] {});        // XXX empty also in svnCA - why?! - no output from cli
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:ImportTestHidden.java

示例9: testImportFolderRecursivelly

import org.tigris.subversion.svnclientadapter.SVNUrl; //导入方法依赖的package包/类
public void testImportFolderRecursivelly() throws Exception {                                        
    File folder = createFolder("folder");
    File folder1 = createFolder(folder, "folder1");
    File file = createFile(folder1, "file");
            
    assertTrue(folder.exists());
    assertTrue(folder1.exists());
    assertTrue(file.exists());
    
    ISVNClientAdapter c = getNbClient();
    SVNUrl url = getTestUrl().appendPath(getName());
    c.mkdir(url, "mrkvadir");        
    url = url.appendPath(folder.getName());
    c.doImport(folder, url, "imprd", true);

    assertTrue(folder.exists());
    assertTrue(folder1.exists());
    assertTrue(file.exists());
    assertStatus(SVNStatusKind.UNVERSIONED, folder);
    assertStatus(SVNStatusKind.UNVERSIONED, folder1);
    assertStatus(SVNStatusKind.UNVERSIONED, file);
    
    ISVNInfo info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    
    url = url.appendPath(folder1.getName());
    info = getInfo(url);
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    
    url = url.appendPath(file.getName());
    info = getInfo(url);        
    assertNotNull(info);        
    assertEquals(url.toString(), TestUtilities.decode(info.getUrl()).toString());
    assertNotifiedFiles(new File[] {folder1, file}); 
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:38,代码来源:ImportTestHidden.java

示例10: perform

import org.tigris.subversion.svnclientadapter.SVNUrl; //导入方法依赖的package包/类
@Override
protected void perform() {
    showDiffError(NbBundle.getMessage(DiffResultsView.class, "MSG_DiffPanel_LoadingDiff")); // NOI18N
    SVNUrl repotUrl = header.getLogInfoHeader().getRepositoryRootUrl();
    SVNUrl fileUrl = repotUrl.appendPath(header.getChangedPath().getPath());
    // through peg revision always except from 'deleting the file', since the file does not exist in the newver revision
    final DiffStreamSource leftSource = new DiffStreamSource(header.getFile(), repotUrl, fileUrl, revision2, revision2);
    final LocalFileDiffStreamSource rightSource = new LocalFileDiffStreamSource(header.getFile(), true);
    this.setCancellableDelegate(new Cancellable() {
        public boolean cancel() {
            leftSource.cancel();
            return true;
        }
    });
    // it's enqueued at ClientRuntime queue and does not return until previous request handled
    leftSource.getMIMEType();  // triggers s1.init()
    if (isCanceled()) {
        showDiffError(NbBundle.getMessage(DiffResultsView.class, "MSG_DiffPanel_NoRevisions")); // NOI18N
        return;
    }
    rightSource.getMIMEType();  // triggers s2.init()
    if (isCanceled()) {
        showDiffError(NbBundle.getMessage(DiffResultsView.class, "MSG_DiffPanel_NoRevisions")); // NOI18N
        return;
    }

    if (currentTask != this) return;

    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            try {
                if (isCanceled()) {
                    showDiffError(NbBundle.getMessage(DiffResultsView.class, "MSG_DiffPanel_NoRevisions")); // NOI18N
                    return;
                }
                final DiffController view = DiffController.createEnhanced(leftSource, rightSource);
                int leftMaxLineNumber = getLastLineIndex(leftSource);
                int rightMaxLineNumber = getLastLineIndex(rightSource);
                if (currentTask == ShowDiffTask.this) {
                    currentDiff = view;
                    setBottomComponent(currentDiff.getJComponent());
                    if (leftMaxLineNumber != -1) {
                        setLocation(Math.min(leftMaxLineNumber, lineNumber), false);
                    }
                    if (rightMaxLineNumber != -1) {
                        setLocation(Math.min(rightMaxLineNumber, lineNumber), true);
                    }
                    parent.refreshComponents(false);
                }
            } catch (IOException e) {
                Subversion.LOG.log(Level.INFO, null, e);
            }
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:56,代码来源:DiffResultsViewForLine.java

示例11: testSSL

import org.tigris.subversion.svnclientadapter.SVNUrl; //导入方法依赖的package包/类
public void testSSL() throws MalformedURLException, IOException {
    SVNUrl url = new SVNUrl("https://feher.lo.nem.lo.com/kuon");
    RepositoryConnection rc = new RepositoryConnection(
            url.toString(),
            "usr", "psswd".toCharArray(), null, false, "/cert/file", "pssphrs".toCharArray(), -1);

    SvnModuleConfig.getDefault().insertRecentUrl(rc);
    String path = "/tmp" + File.separator + "svn" + File.separator + "config" + System.currentTimeMillis();
    System.setProperty("netbeans.t9y.svn.nb.config.path", path);
    SvnConfigFiles scf = SvnConfigFiles.getInstance();
    scf.storeSvnServersSettings(url, ConnectionType.cli);

    File serversFile = new File(path + "/servers");
    long lastMod = serversFile.lastModified();
    Section s = getSection(serversFile);
    assertNotNull(s);

    // values were written
    assertEquals("/cert/file", s.get("ssl-client-cert-file"));
    assertEquals("pssphrs", s.get("ssl-client-cert-password"));

    // nothing was changed ...
    scf.storeSvnServersSettings(url, ConnectionType.cli);
    // ... the file so also the file musn't change
    assertEquals(lastMod, serversFile.lastModified());

    // lets change the credentials ...
    rc = new RepositoryConnection(
            url.toString(),
            "usr", "psswd".toCharArray(), null, false, "/cert/file2", "pssphrs2".toCharArray(), -1);
    SvnModuleConfig.getDefault().insertRecentUrl(rc);
    scf.storeSvnServersSettings(url, ConnectionType.cli);
    s = getSection(serversFile);
    // values were written
    assertNotNull(s);
    assertNotSame(lastMod, serversFile.lastModified());
    assertEquals("/cert/file2", s.get("ssl-client-cert-file"));
    assertEquals("pssphrs2", s.get("ssl-client-cert-password"));

    // lets test a new url
    url = url.appendPath("whatever");
    rc = new RepositoryConnection(
            url.toString(),
            "usr", "psswd".toCharArray(), null, false, "/cert/file3", "pssphrs3".toCharArray(), -1);
    SvnModuleConfig.getDefault().insertRecentUrl(rc);
    lastMod = serversFile.lastModified();
    scf.storeSvnServersSettings(url, ConnectionType.cli);
    s = getSection(serversFile);
    // values were written
    assertNotNull(s);
    assertNotSame(lastMod, serversFile.lastModified());
    assertEquals("/cert/file3", s.get("ssl-client-cert-file"));
    assertEquals("pssphrs3", s.get("ssl-client-cert-password"));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:55,代码来源:SvnConfigFilesTest.java


注:本文中的org.tigris.subversion.svnclientadapter.SVNUrl.appendPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。