List of shared paths

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

Moderator: SourceGear

Post Reply
andreypir
Posts: 11
Joined: Thu Feb 28, 2008 6:16 pm

List of shared paths

Post by andreypir » Mon Jul 28, 2008 12:42 am

Which API function can I use to get a list of paths where a file is shared? The list is shown on the Share Links tab of file properties in the Vault client. I tried this:

string[] GetSharedPath(VaultClientFile file)
{
VaultFileProperties prop = file.GetFileProperties();
return prop.SharedPaths;
}

but this always returns null. I also tried

string[] GetSharedPath(VaultClientFile file)
{
return ServerOperations.client.ClientInstance.GetSharedPaths(file.ID);
}

but this returns empty array. Version 4.1.2.

shannon

Re: List of shared paths

Post by shannon » Mon Jul 28, 2008 1:35 pm

Try getting the file properties this way:
_clientInstance.GetFileProperties(serverPath, file.ObjVerID)

andreypir
Posts: 11
Joined: Thu Feb 28, 2008 6:16 pm

Re: List of shared paths

Post by andreypir » Tue Jul 29, 2008 4:53 pm

Thank you, that works

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: List of shared paths

Post by lbauer » Thu Aug 07, 2008 8:15 am

Let us know if you have additional questions.
Linda Bauer
SourceGear
Technical Support Manager

javaguy
Posts: 10
Joined: Wed May 20, 2009 10:21 am

Re: List of shared paths

Post by javaguy » Mon Jan 25, 2010 6:05 am

I'm in a similar position. Interestingly ServerOperations.client.ClientInstance.GetSharedPaths(file.ID) seemed to work
fine until I restarted my Vault server.

Could you explain the serverPath parameter please? I've tried a few things and keep getting an exception on the call.

shannon

Re: List of shared paths

Post by shannon » Mon Jan 25, 2010 8:15 am

It's whatever repository path the server would understand for that file. For most files, the server and the client agree on the repository path, but complications occur if you have uncommitted changes (i.e. a rename or move) for that file.

We pass file.ServerSynchedFullPath, give that a try.

Post Reply