0

I need to create a folder in svn using svnkit jar. I tried with the following code

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

Any idea plz suggest

Dhinakar
  • 4,061
  • 6
  • 36
  • 68

1 Answers1

2

Please try the following code

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

It will work use it

Prasath Bala
  • 698
  • 1
  • 7
  • 12