private void UpdateCompressionSettings() { if (base.Fields.IsModified("GzipLevel")) { string metabasePath = this.DataObject.MetabasePath; Gzip.SetIisGzipLevel(IisUtility.WebSiteFromMetabasePath(metabasePath), GzipLevel.High); Gzip.SetVirtualDirectoryGzipLevel(metabasePath, this.DataObject.GzipLevel); if (Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version.Major >= 6) { try { Gzip.SetIisGzipMimeTypes(); } catch (Exception ex) { TaskLogger.Trace("Exception occurred in SetIisGzipMimeTypes(): {0}", new object[] { ex.Message }); this.WriteWarning(Strings.SetIISGzipMimeTypesFailure); throw; } } } }
private void UpdateCompressionSettings() { if (this.GzipLevel == GzipLevel.Error) { base.WriteError(new TaskException(Strings.GzipCannotBeSetToError), ErrorCategory.NotSpecified, null); return; } if (this.GzipLevel == GzipLevel.Low) { this.WriteWarning(Strings.GzipLowDoesNotUseDynamicCompression); } string metabasePath = this.DataObject.MetabasePath; Gzip.SetIisGzipLevel(IisUtility.WebSiteFromMetabasePath(metabasePath), GzipLevel.High); Gzip.SetVirtualDirectoryGzipLevel(metabasePath, this.DataObject.GzipLevel); if (Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version.Major >= 6) { try { Gzip.SetIisGzipMimeTypes(); } catch (Exception ex) { TaskLogger.Trace("Exception occurred in SetIisGzipMimeTypes(): {0}", new object[] { ex.Message }); this.WriteWarning(Strings.SetIISGzipMimeTypesFailure); throw; } } }
protected override void InternalProcessMetabase() { OwaVirtualDirectoryHelper.CreateOwaCalendarVDir(this.DataObject.MetabasePath, base.Role); if (base.Role == VirtualDirectoryRole.Mailbox) { OwaVirtualDirectoryHelper.CreateLegacyVDirs(this.DataObject.MetabasePath, false); try { OwaVirtualDirectoryHelper.EnableIsapiFilter(this.DataObject, false); goto IL_EB; } catch (Exception ex) { TaskLogger.Trace("Exception occurred in EnableIsapiFilter(): {0}", new object[] { ex.Message }); this.WriteWarning(Strings.OwaMetabaseIsapiInstallFailure); throw; } } if (!Datacenter.IsMultiTenancyEnabled()) { OwaVirtualDirectoryHelper.CreateOwaIntegratedVDir(this.DataObject.MetabasePath, base.Role); this.DataObject.IntegratedFeaturesEnabled = new bool?(true); } OwaVirtualDirectoryHelper.CreateOmaVDir(this.DataObject.MetabasePath, base.Role); try { OwaVirtualDirectoryHelper.EnableIsapiFilter(this.DataObject, true); } catch (Exception ex2) { TaskLogger.Trace("Exception occurred in EnableIsapiFilterForCafe(): {0}", new object[] { ex2.Message }); this.WriteWarning(Strings.OwaMetabaseIsapiInstallFailure); throw; } try { IL_EB: WebAppVirtualDirectoryHelper.UpdateMetabase(this.DataObject, this.DataObject.MetabasePath, base.Role == VirtualDirectoryRole.Mailbox); } catch (Exception ex3) { TaskLogger.Trace("Exception occurred in UpdateMetabase(): {0}", new object[] { ex3.Message }); this.WriteWarning(Strings.OwaMetabaseGetPropertiesFailure); throw; } if (base.Role == VirtualDirectoryRole.Mailbox && Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version.Major >= 6) { try { Gzip.SetIisGzipMimeTypes(); } catch (Exception ex4) { TaskLogger.Trace("Exception occurred in SetIisGzipMimeTypes(): {0}", new object[] { ex4.Message }); this.WriteWarning(Strings.SetIISGzipMimeTypesFailure); throw; } } }