public HttpResponseMessage GetFolderStatus(string syncFolder) { _fileManager = new FileSystemFileManager(syncFolder); List <FolderFileState> remoteFiles = new List <FolderFileState>(); var files = _fileManager.GetFilenames(); foreach (string file in files) { remoteFiles.Add(new FolderFileState() .FileName(file) .Hash(_fileManager.GetHash(file)) .CurrentStatus(FileStatusType.Synced)); } FolderState folderState = new FolderState() .RemotePath(syncFolder); foreach (var f in remoteFiles) { folderState.RemoteFile(f); } string s = folderState.Definition; var resp = new HttpResponseMessage { Content = new StringContent(s, System.Text.Encoding.UTF8, "application/xml") }; return(resp); }
public void UpdateServerFileStatus(string fileName, string CRC, FileStatusType status) { Console.WriteLine("FolderStatus - UpdateServerFileStatus"); DeleteFileInServerStatus(fileName); _folderState.RemoteFile(new FolderFileState() .FileName(fileName) .Hash(CRC) .CurrentStatus(status)); Console.WriteLine("FolderStatus - UpdateServerFileStatus - before SaveStatus"); SaveStatus(); Console.WriteLine("FolderStatus - UpdateServerFileStatus - after SaveStatus"); }