public CheckFileInfo GetCheckFileInfo(string userId, string userName, string name) { try { string[] splitArray = _FileInfo.FullName.Split("."); string fileType = (splitArray == null || splitArray.Length == 0)?"docx":splitArray[splitArray.Length - 1].ToLower(); CheckFileInfo cfi = new CheckFileInfo(); cfi.BreadcrumbBrandName = fileType == null?"Drive Docs":HostNameByType(fileType); cfi.SupportsCoauth = true; cfi.BaseFileName = name; cfi.UserFriendlyName = userName; cfi.UserId = userId; lock (_FileInfo) { if (_FileInfo.Exists) { cfi.Size = _FileInfo.Length; } else { FilesService.CreateBlankFile(_FileInfo.FullName); _FileInfo = new FileInfo(_FileInfo.FullName); cfi.Size = _FileInfo.Length; } } cfi.Version = DateTime.Now.ToString("s"); cfi.SupportsCoauth = true; cfi.SupportsCobalt = false; cfi.SupportsFolders = true; cfi.SupportsLocks = false; cfi.SupportsScenarioLinks = false; cfi.SupportsSecureStore = false; cfi.SupportsUpdate = true; cfi.UserCanWrite = true; cfi.LicenseCheckForEditIsEnabled = true; cfi.ClientUrl = Config.WebDAV_Server + "/files/docx/1.docx"; cfi.SupportsGetLock = true; cfi.DownloadUrl = Config.OfficeEditorUrl + "/updateAndDownload/" + SessionId; Config.logger.LogDebug("GetCheckFileInfo of file {0} Success", name); return(cfi); } catch (Exception e) { Config.logger.LogError("GetCheckFileInfo of file {0} fail, error: {1}", name, e.Message); throw e; } }