public bool DeleteDraft(PageInfo page)
{
if(page == null) throw new ArgumentNullException("page");
lock(this) {
LocalPageInfo local = LoadLocalPageInfo(page);
if(local == null) return false;
string targetFileFullPath = GetDraftFullPath(local);
if(!File.Exists(targetFileFullPath)) return false;
else {
File.Delete(targetFileFullPath);
// Delete directory if empty
if(Directory.GetFiles(Path.GetDirectoryName(targetFileFullPath)).Length == 0) {
Directory.Delete(Path.GetDirectoryName(targetFileFullPath));
}
return true;
}
}
}