public void DeleteRemoteFolder(IFolder folder, SyncItem syncItem, string upperFolderPath)
{
try
{
Logger.Debug("Removing remote folder tree: " + folder.Path);
IList<string> failedIDs = folder.DeleteTree(true, null, true);
if (failedIDs == null || failedIDs.Count != 0)
{
Logger.Error("Failed to completely delete remote folder " + folder.Path);
// TODO Should we retry? Maybe at least once, as a manual recursion instead of a DeleteTree.
}
// Delete the folder from database.
database.RemoveFolder(syncItem);
}
catch (CmisPermissionDeniedException e)
{
// TODO: Add resource
string message = String.Format("フォルダ {0} に対して削除やリネームする権限がないため、サーバからこのフォルダを復元します(フォルダに含まれるファイル数が多い場合、復元に時間がかかります)。", syncItem.LocalPath);
Utils.NotifyUser(message);
// We don't have the permission to delete this folder. Warn and recreate it.
/*
Utils.NotifyUser("You don't have the necessary permissions to delete folder " + folder.Path
+ "\nIf you feel you should be able to delete it, please contact your server administrator");
*/
database.RemoveFolder(syncItem);
DownloadDirectory(folder, syncItem.RemotePath, syncItem.LocalPath);
}
}