Use | “OR” with DefaultAcquisitionOption to Download & CheckOut with AcquireFiles

By Wayne Brill

The Vault 2014 API documentation does not explicitly describe how to  download and checkout a file using AcquireFiles. To do this you can "OR" together the AcquisitionOption enumeration Checkout and Download .

Here is an update to the downloadFile function in the VaultBrowser SDK sample that does a checkout and download.

 

private static void downloadFile        (VDF.Vault.Currency.Connections.Connection                                       connection,         VDF.Vault.Currency.Entities.FileIteration                                            file,                                string folderPath)    {        VDF.Vault.Settings.AcquireFilesSettings            settings = new VDF.Vault.Settings.               AcquireFilesSettings(connection);             settings.AddEntityToAcquire(file);             settings.DefaultAcquisitionOption =          VDF.Vault.Settings.AcquireFilesSettings.                  AcquisitionOption.Checkout |         VDF.Vault.Settings.AcquireFilesSettings.                     AcquisitionOption.Download;                 settings.LocalPath =  new VDF.Currency.            FolderPathAbsolute(folderPath);              connection.FileManager.AcquireFiles(settings);    }