override public WopiCheckFileInfo GetCheckFileInfo() { WopiCheckFileInfo cfi = new WopiCheckFileInfo(); cfi.BaseFileName = m_fileinfo.Name; cfi.OwnerId = m_login; cfi.UserFriendlyName = m_name; lock (m_fileinfo) { if (m_fileinfo.Exists) { cfi.Size = m_fileinfo.Length; } else { cfi.Size = 0; } } cfi.Version = DateTime.Now.ToString("s"); cfi.SupportsCoauth = false; cfi.SupportsCobalt = false; cfi.SupportsFolders = true; cfi.SupportsLocks = true; cfi.SupportsScenarioLinks = false; cfi.SupportsSecureStore = false; cfi.SupportsUpdate = true; cfi.UserCanWrite = true; return(cfi); }
override public WopiCheckFileInfo GetCheckFileInfo() { WopiCheckFileInfo cfi = new WopiCheckFileInfo(); cfi.BaseFileName = m_fileinfo.Name; cfi.OwnerId = m_login; cfi.UserFriendlyName = m_name; lock (m_fileinfo) { if (m_fileinfo.Exists) { cfi.Size = m_fileinfo.Length; } else { cfi.Size = 0; } } cfi.Version = DateTime.Now.ToString("s"); cfi.SupportsCoauth = true; cfi.SupportsCobalt = false; cfi.SupportsFolders = true; cfi.SupportsLocks = true; cfi.SupportsScenarioLinks = false; cfi.SupportsSecureStore = false; cfi.SupportsUpdate = true; cfi.UserCanWrite = true; return cfi; }
override public WopiCheckFileInfo GetCheckFileInfo() { WopiCheckFileInfo cfi = new WopiCheckFileInfo(); cfi.BaseFileName = m_fileinfo.Name; cfi.OwnerId = m_login; cfi.UserFriendlyName = m_name; lock (m_fileinfo) { if (m_fileinfo.Exists) { cfi.Size = m_fileinfo.Length; } else { cfi.Size = 0; } } cfi.Version = DateTime.Now.ToString("s"); cfi.SupportsCoauth = false; cfi.SupportsCobalt = false; cfi.SupportsFolders = true; cfi.SupportsLocks = true; cfi.SupportsScenarioLinks = false; cfi.SupportsSecureStore = false; cfi.SupportsUpdate = true; cfi.UserCanWrite = true; // var hasher = System.Security.Cryptography.SHA256.Create(); byte[] hashValue; using (Stream s = m_fileinfo.OpenRead()) { hashValue = hasher.ComputeHash(s); } string sha256 = Convert.ToBase64String(hashValue); cfi.SHA256 = sha256; // return(cfi); }