Page 1 of 1

Adding and committing a Directory using the API

Posted: Thu Oct 29, 2009 1:05 am
by fryhard
I would like to add a directory to Vault and commit this operation using the API.

With little effort I am able to add and commit files to vault using this code:

Code: Select all

ChangeSetItemColl changeSetItemColl = ServerOperations.ProcessCommandAdd(pathDirectory, new[] { path });
ServerOperations.ProcessCommandCommit(changeSetItemColl, UnchangedHandler.Checkin, false, LocalCopyType.Leave, false);
But what I would really like to do is:

Code: Select all

ChangeSetItemColl changeSetItemColl = ServerOperations.ProcessCommandAdd(pathDirectory); // Add the path of the directory that we want to commit.
ServerOperations.ProcessCommandCommit(changeSetItemColl, UnchangedHandler.Checkin, false, LocalCopyType.Leave, false);
Is there any way to the above or do I need to run though the directory and its children and build up the ChangeSetItemColl and the commit it?

Thanks

Re: Adding and committing a Directory using the API

Posted: Thu Oct 29, 2009 8:49 am
by shannon
I'm sorry, there isn't a convenience method to do what you'd like. You'll have to build up the ChangeSetItemColl yourself.