1

I want to create a new user in the visual-svn server using java svnkit API.

I want to add that user to one group programatically.

Does anyone know how I can accomplish this?

1
  • 1
    I suspect that you can't, having read this Mar 16 '12 at 12:56
2

Is the SVNKit a requirement for you?

VisualSVN Server can be managed via WMI (Windows Management Instrumentation) interface, so you can write a code in C#, VBScript, VB .Net to manage VisualSVN Server.

MOF file which describes the VisualSVN Server interface resides in the %VISUALSVN_SERVER%\WMI on the computer where VisualSVN Server is installed.

Check the MSDN article: http://msdn.microsoft.com/en-us/library/aa384642

I'm including the following samples for your reference:

  • This C# code will create a Subversion user 'user1' with password 'secret'.

        ManagementClass userClass = new ManagementClass("root\\VisualSVN", "VisualSVN_User", null);
    
        // Obtain in-parameters for the method
        ManagementBaseObject inParams =
            userClass.GetMethodParameters("Create");
    
        // Add the input parameters.
        inParams["Name"] = "user1";
        inParams["Password"] = "secret";
    
        // Execute the method and obtain the return values.
        ManagementBaseObject outParams =
            userClass.InvokeMethod("Create", inParams, null);
    
  • This C# code will create a new repository 'Repo1'.

        ManagementClass repoClass = new ManagementClass("root\\VisualSVN", "VisualSVN_Repository", null);
    
        // Obtain in-parameters for the method
        ManagementBaseObject inParams =
            repoClass.GetMethodParameters("Create");
    
        // Add the input parameters.
        inParams["Name"] = "Repo1";
    
        // Execute the method and obtain the return values.
        ManagementBaseObject outParams =
            repoClass.InvokeMethod("Create", inParams, null);
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.