Note that there are some explanatory texts on larger screens.

plurals
  1. POadd folders and commit files using SVNKit
    text
    copied!<p>I've just created a Java project. I want to check-in this project to SVN location with help of SVNKit. </p> <p>I use the below code, which adds a folder to SVN repository. But it didn't create any <code>.svn</code> folder in the folder <code>/Users/test/svnAddDirCheck</code>. </p> <p>I want the files to be cheked-in and also I want to commit some changed files in future. Without checking out the source code, how can I do this ? Can I add these files in SVN as well as I can commit any changed files directly ?</p> <pre><code>@Test public void importWholeDir() throws Exception { try { DAVRepositoryFactory.setup(); SVNRepositoryFactoryImpl.setup(); FSRepositoryFactory.setup(); String svnUrl = "https://abc.com/svn/repos/projects/test/CREATE2"; File dir = new File("/Users/test/svnAddDirCheck"); SVNURL url = SVNURL.parseURIDecoded(svnUrl); String userName = "XXXXXXX"; String userPassword = "XXXXXXXXX"; importDirectoryContentToSubversion(svnUrl, dir.getPath(), userName, userPassword, "directory and file added"); } catch (Exception e) { e.printStackTrace(); } } public static SVNCommitInfo importDirectoryContentToSubversion(final String repositoryURL, final String subVersionedDirectory, final String userName, final String hashedPassword, final String commitMessage) throws SVNException { final SVNClientManager cm = SVNClientManager.newInstance(new DefaultSVNOptions(), userName, hashedPassword); return cm.getCommitClient().doImport(new File(subVersionedDirectory), SVNURL.parseURIEncoded(repositoryURL), "&lt;import&gt; " + commitMessage, null, false, true, SVNDepth.fromRecurse(true)); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload