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.
List of shared paths
Moderator: SourceGear
Re: List of shared paths
Try getting the file properties this way:
_clientInstance.GetFileProperties(serverPath, file.ObjVerID)
_clientInstance.GetFileProperties(serverPath, file.ObjVerID)
Re: List of shared paths
Thank you, that works
Re: List of shared paths
Let us know if you have additional questions.
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager
Re: List of shared paths
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.
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.
Re: List of shared paths
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.
We pass file.ServerSynchedFullPath, give that a try.