如何使用svnkit jar java在svn中创建文件夹

如何使用svnkit jar java在svn中创建文件夹,java,svn,svnkit,Java,Svn,Svnkit,我需要使用svnkit jar在svn中创建一个文件夹。我尝试了以下代码 String url = Config.svnurl + "/" + qcuser + "/" + "Completedjobs"; try { SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url));

我需要使用svnkit jar在svn中创建一个文件夹。我尝试了以下代码

           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);
            }
        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");
        }

如果您有任何想法,请尝试以下代码

           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);
            }
        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");
        }
用它会有用的