I need path that was assigned by "Set working folder" popup menu on repository tree node in the standart Vault client.
I.e.
1. I open Vault GUI client
2. I select $/Test node in the folders tree (e.g. there is file1.txt and file2.txt)
3. I right-click on $/Test node and select Set working folder item
4. I write c:\temp\test and press Enter
6. I execute Get latest version for $/Test. All files from $/Test are copied to the c:\temp\test
5. I close Vault GUI client
Is it possible to get string 'c:\temp\test' for instance of VaultClientFolder using Vault Client API from my application?
Code: Select all
ClientInstance ci;
// ci was connected before, default repository was set
System.Collections.ArrayList regexList = new System.Collections.ArrayList();
VaultClientFolderColl vcFolders;
VaultClientFileColl vcFiles;
regexList.Add(new Regex("test1\\.txt"));
ci.Refresh();
ci.GetFileAndFolderListsByRegex(ci.TreeCache.Repository.Root, regexList, true, out vcFiles, out vcFolders);
// I got here instance VaultClientFile for "test1.txt" in the vcFiles
if (vcFiles.Count == 1)
{
VaultClientFile vcf = vcFiles[0] as VaultClientFile;
string localFolder;
localFolder = ci.TreeCache.GetBestWorkingFolder(vcf.Parent);
//localFolder is null here
// I expect that it will contain c:\temp\test
localFolder = ci.TreeCache.GetWorkingFolder(vcf.Parent);
//localFolder is null here
// I expect that it will contain c:\temp\test
VaultClientFolder localFolder = ci.TreeCache.GetBestWorkingFolder(vcf.Parent);
WorkingFolder wf = null;
vcfolder = vcf.Parent;
while ((localFolder == null || wf == null) && vcfolder != null)
{
localFolder = ci.TreeCache.GetWorkingFolder(vcfolder.Parent.FullPath);
wf = ci.GetWorkingFolder(vcfolder.Parent);
vcfolder = vcfolder.Parent;
}
//I enumerate all folders up to root but locaFolder and wf are null :(
}