internal bool OkToDeleteFile(FolderTrimmer.FolderDeletionInfo folderInfo, string fileName) { string relativePath = (string)folderInfo.Context; string pathOnLocalNode; if (string.IsNullOrEmpty(relativePath)) { pathOnLocalNode = Path.Combine(this.sourceFolder, fileName); } else { pathOnLocalNode = Path.Combine( this.sourceFolder, relativePath, fileName); } return(false == FabricFile.Exists(pathOnLocalNode)); }
internal void SetFolderDeletionContext(FolderTrimmer.FolderDeletionInfo folderInfo, FolderTrimmer.FolderDeletionInfo parentFolderInfo, string folderNameWithoutPath) { if (null == parentFolderInfo) { folderInfo.Context = string.Empty; } else { string parentRelativePath = (string)parentFolderInfo.Context; if (string.IsNullOrEmpty(parentRelativePath)) { folderInfo.Context = folderNameWithoutPath; } else { folderInfo.Context = Path.Combine(parentRelativePath, folderNameWithoutPath); } } }