API Call(s) To Detect New Files

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear


Posts: 3
Joined: Thu Jan 04, 2018 3:52 pm
PostPosted: Thu Jan 04, 2018 3:59 pm
It is my understanding that the API has the ability to detect new files. Can you point us to what classes do that or some examples of how to do that?

Posts: 3544
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
PostPosted: Thu Jan 04, 2018 4:47 pm
The Vault Client API doesn't have anything that would automatically notify code through an event or something, but does have a call you can make to scan for changes within a working folder.

What are you looking to achieve? Do you want to see new files committed to the repository or looking to see any new files added to a local working folder on disk?

Regardless, in either case, you'd have to write something to 'poll' the source looking for changes.
Jeff Clausius
SourceGear

Posts: 3
Joined: Thu Jan 04, 2018 3:52 pm
PostPosted: Thu Jan 04, 2018 11:01 pm
Something similar to the "Detect new files" option when you right-click on a folder in vault.
We are looking for files added to the working folder by Redgate's Sql Source Control.
We want to try to automate the procedure of adding those files to Vault.
We currently use the "Detect New Files" option in the GUI.

Posts: 3544
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
PostPosted: Fri Jan 05, 2018 9:44 am
Ahh... I misunderstood. Thought you were looking for something to automatically notify you when something was added. ( I've edited my original response. )

Are you using Vault 10 with SQL Source Control? We did add new commands to the command line client in order to integrate using their template solution, which if I recall uses an xml template as some sort of config file maping Vault commands so SQL SourceControl can shell out to the command line client to do an operation.

In Vault 10, the command line client's 'DETECTNEW' command will do a scan and return back the changes made in a working folder. Is that what you're looking for? Or are you looking to use the API to write your own client?
Jeff Clausius
SourceGear

Posts: 3
Joined: Thu Jan 04, 2018 3:52 pm
PostPosted: Fri Jan 05, 2018 1:58 pm
Thank you...we did find ServerOperations.ProcessCommandDetectNew after some digging and were able to create the automated tool we were hoping for.

Posts: 3544
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
PostPosted: Fri Jan 05, 2018 2:29 pm
Excellent! Thanks for reporting back.
Jeff Clausius
SourceGear

Return to Questions (API)

Who is online

Users browsing this forum: No registered users and 1 guest