2014-10-08 84 views
0

我需要使用svnkit jar在svn中創建一個文件夾。我試着用下面的代碼如何在svn中使用svnkit jar創建一個文件夾java

  String url = Config.svnurl + "/" + qcuser + "/" + "Completedjobs"; 
      try { 
       SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url)); 
       ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(Config.svnusername, Config.svnuserpwd); 
       repository.setAuthenticationManager(authManager); 
      } catch (SVNException e) { 
       e.printStackTrace(); 
       System.exit(1); 
      } 

任何想法PLZ建議

回答

2

請嘗試以下代碼

 SVNCommitClient commitClient = ourClientManager.getCommitClient(); 
     commitClient.setIgnoreExternals(false); 
     SVNNodeKind nodeKind = null; 
     try { 
      nodeKind = repository.checkPath("", -1); 
     } catch (SVNException ex) { 
      Logger.getLogger(Reassignscreen.class.getName()).log(Level.SEVERE, null, ex); 
     } 
     if (nodeKind == SVNNodeKind.NONE) { 
      System.err.println("There is no entry at '" + url + "'."); 
      commitClient.doMkDir(new SVNURL[]{SVNURL.parseURIDecoded(url)}, "New Folder"); 
     } 

它將工作使用它

相關問題