Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

Is there any experience of adding Versioned Shares programatically?

Vote:
 
Is there any experience of adding Versioned Shares programatically? I have checked the SDK and found the VersionFileHandler and VersionDirectoryHandlerClass, but I can't find any coding samples anywhere. The task of adding files into versioned state will be a part of a migration job. Christian Wallgren
#12419
Nov 01, 2005 15:47
Vote:
 
UnifiedDirectory dir = UnifiedFileSystem.GetDirectory("/myshare"); UnifiedFile file = dir.CreateFile("Newfile.doc"); Stream s = file.OpenWrite(); try { //Write to stream here! } finally { s.Close(); } So, you do not need to call any versioning functionality if you don't want to, it will create versions for you automatically. But, if you need to, you have all the functionality on the UnifiedFile class. //check out file.CheckOut(); // is it versioned if(file.IsVersioned) // check who checked it out file.CheckedOutBy //check in file.CheckIn("Made some changes"); //get versions UnifiedFileVersion []versions = file.GetVersions(); And so on..
#14233
Nov 02, 2005 10:32
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.