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

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.