- SPWeb.Folders.Add() will not throw exception if the folder already exists. If that’s the case it will return that folder object. However the parent folder must already exists, versus in C#, Directory.CreateDirectory() will automatically create the whole tree. I had to write my own function to automatically create the whole tree.
- SPFolder.Delete() and SPFile.Delete() will not throw exception if the folder/file doesn’t exist. So you can just call it directly without checking Exists property. Watch out for checked out file.
- Items deleted through UI will be in Recycle Bin. (Recycle Bin can be disabled.) But items deleted using delete() API will be deleted permanently (there is a SPFile.Recycle() function that does what it’s named). When a file is restored from Recycle Bin, ItemAdded event will be fired. However no event is fired when a folder is restored.