Shares is a feature that dates all the way to Vault 1 and maybe even earlier. It's still around in Vault 2010, but mainly for legacy purposes. If you are new to Vault, odds are you never even heard of shares. Even though the feature isn't used often, the fact that it's there affects other parts of the system.
This article isn't about whether shares are good or bad, and I'm not going to advocate use or non-use. I'm just going to go over the purely technical details.
A share is the idea that a file can live in multiple folders equally. The word "equally" is what makes things unique. It's not like Windows where a file lives in only 1 location and you can create shortcuts. With Vault, the file truly lives in multiple locations. There is no shortcut, there is no primary folder, there is no folder prioritization. The file lives in each folder equally. A file has to live in at least one folder, but there is no upper limit.
Likewise, a shared file is the exact same file in all locations. The file is not copied to different folders or anything like that. They are truly the same object. Change anything about the file in one location, and you change it for all locations.
Here are some of the ways that shares impact other Vault features:
- It's harder to get the folder that a file lives in or to "jump to" a file. Even if the file lives in only 1 folder, it could live in multiple folders.
- There's no Folder property on a File object.
- When you delete a file you are really just deleting it from the share. The file will still be around if it lives in other shares. To truly delete a file, you need to delete it from every folder that it lives in.
- When you move a file, you are just changing the location of one of the shares.
- If you set security on a folder, all files in the folder get updated with the folder's security settings. This is still true even if the file is shared. So it's a "last one wins model" where the file has the security settings of the parent folder that updated security last.
- On a user's local folder, a shared file gets downloaded to multiple locations as separate Windows files. However, on the Vault Server's file store, there is only 1 copy.
- At the API level, you can find all the file shares with GetFoldersByFileMasterId. The Folders are not returned in any order, so don't assume any sort of prioritization. In fact, the order my change from call to call.