// Token: 0x0600108C RID: 4236 RVA: 0x00060A94 File Offset: 0x0005EC94
        private string ReadCookieString(string path, string domain)
        {
            if (!File.Exists(path) && !this.hasDownloadedCookiesFromMailbox)
            {
                GroupMetricsMailboxFileStore groupMetricsMailboxFileStore = GroupMetricsMailboxFileStore.FromMailboxGuid(base.OrgId, base.MailboxGuid);
                if (groupMetricsMailboxFileStore != null)
                {
                    this.hasDownloadedCookiesFromMailbox = groupMetricsMailboxFileStore.DownloadCookies(this.currentCookiePathCollection);
                }
            }
            string    result = null;
            Exception ex     = null;

            try
            {
                using (StreamReader streamReader = new StreamReader(path))
                {
                    result = streamReader.ReadLine();
                }
            }
            catch (FileNotFoundException ex2)
            {
                ex = ex2;
            }
            catch (IOException ex3)
            {
                ex = ex3;
            }
            catch (UnauthorizedAccessException ex4)
            {
                ex = ex4;
            }
            catch (SecurityException ex5)
            {
                ex = ex5;
            }
            if (ex != null && base.OrgId == OrganizationId.ForestWideOrgId)
            {
                GroupMetricsGenerator.EventLogger.LogEvent(InfoWorkerEventLogConstants.Tuple_UnableToReadGroupMetricsCookie, null, new object[]
                {
                    this.GetOrganizationIdString(),
                    path,
                    domain,
                    ex.GetType().FullName,
                    ex.Message
                });
                return(string.Empty);
            }
            return(result);
        }
        // Token: 0x06001087 RID: 4231 RVA: 0x000604D8 File Offset: 0x0005E6D8
        internal void SaveCookies(IList <GroupMetricsCookie> cookies)
        {
            base.Logger.TraceDebug(null, "Calling SaveCookies", new object[0]);
            string[] array = new string[cookies.Count];
            int      num   = 0;

            foreach (GroupMetricsCookie groupMetricsCookie in cookies)
            {
                string domain     = groupMetricsCookie.Domain;
                string cookiePath = this.GetCookiePath(domain);
                array[num++] = cookiePath;
                this.SaveCookie(cookiePath, domain, groupMetricsCookie);
            }
            GroupMetricsMailboxFileStore groupMetricsMailboxFileStore = GroupMetricsMailboxFileStore.FromMailboxGuid(base.OrgId, base.MailboxGuid);

            if (groupMetricsMailboxFileStore != null)
            {
                groupMetricsMailboxFileStore.UploadCookies(array);
            }
        }
        // Token: 0x0600108E RID: 4238 RVA: 0x00060C78 File Offset: 0x0005EE78
        private void DeleteCookieFile(string path, string domain)
        {
            Exception ex = null;

            try
            {
                File.Delete(path);
            }
            catch (FileNotFoundException)
            {
            }
            catch (IOException ex2)
            {
                ex = ex2;
            }
            catch (UnauthorizedAccessException ex3)
            {
                ex = ex3;
            }
            catch (SecurityException ex4)
            {
                ex = ex4;
            }
            if (ex != null)
            {
                GroupMetricsGenerator.EventLogger.LogEvent(InfoWorkerEventLogConstants.Tuple_UnableToRemoveCorruptGroupMetricsCookie, null, new object[]
                {
                    this.GetOrganizationIdString(),
                    path,
                    domain,
                    ex.GetType().FullName,
                    ex.Message
                });
            }
            GroupMetricsMailboxFileStore groupMetricsMailboxFileStore = GroupMetricsMailboxFileStore.FromMailboxGuid(base.OrgId, base.MailboxGuid);

            if (groupMetricsMailboxFileStore != null)
            {
                groupMetricsMailboxFileStore.DeleteCookie(path);
            }
        }