private FileMessage ReadSnapshot(FileSnapshot snapshot) { var fileMessage = new FileMessage { Name = snapshot.Name }; try { var fileInfo = new FileInfo(snapshot.Name); if (fileInfo.Exists) { var fileBytes = ExclusiveRead(fileInfo); fileMessage.Content = Encoding.UTF8.GetString(fileBytes); fileMessage.ContentLength = fileBytes.LongLength; } } catch { } return(fileMessage); }
public bool Equals(FileSnapshot other) { return(other != null && other.Name == Name && other.LastModified == LastModified); }