Hi all,

I'm just getting started using SVNKit (v. 1.7.9) and have a question I hope 
someone will be able to answer.

I've been able to read files from the repository without any trouble, but I'm 
unable to write to it apparently because my login does not have write 
permission to the repository root -- even though I'm not writing to the root.

So.  I create the repository object something like this:

    String svnUrl = "http://scm.mydomain.com/repo";;
    SVNRepository repository = SVNRepositoryFactory.create( 
SVNURL.parseURIEncoded( svnUrl ) );
    ISVNAuthenticationManager authManager = new 
BasicAuthenticationManager(username, password);
    repository.setAuthenticationManager( authManager );


Then I try to commit a file something like this:

   String scmPath = "/cs/test";
   String filePath = "/cs/text/mytestfile.txt";

    ISVNEditor svnEditor = repository.getCommitEditor(logMessage, null);
    svnEditor.openRoot(-1);
    svnEditor.openDir(scmPath, -1);

    svnEditor.openFile(filePath, -1);

    svnEditor.applyTextDelta(filePath, null);

    final SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
    final String checksum = deltaGenerator.sendDelta(filePath, new 
ByteArrayInputStream(propertiesBytes), svnEditor, true);

    svnEditor.closeFile(filePath, checksum);

    svnEditor.closeDir();
    svnEditor.closeDir();

    svnEditor.closeEdit();



I get an authentication exception as soon as I do the svnEditor.openFIle() 
call.  I DO have write permission to the entire /cs tree, but not to the 
repository root.  I also get an exception if I try to simply skip calling 
svnEditor.openRoot().

I asked the Subversion administrator to grant me write permission to the 
repository root temporarily, and the code worked beautifully.

So, is there any way we can preserve the permissions and still allow SVNKit to 
write to a subdirectory?

Thanks for any help you can provide.

-Jim-

Reply via email to