private void ReplacePolicySetFile(LocalPolicySetCache policySetCache) { if (null == policySetCache) return; PolicyFileWriter fileWriter = new PolicyFileWriter(); fileWriter.WriteFile(policySetCache, policySetCache.FileName, false); }
public IPolicySetCache NewPolicySet(string name) { LocalPolicySetCache lps = null; if (System.IO.Path.IsPathRooted(name)) lps = new LocalPolicySetCache(name); else lps = new LocalPolicySetCache(m_LocalBasePath_User + name + (m_runtime ? Definitions.CompiledPolicyFileExtension : Definitions.PolicyFileExtension)); lps.NewVersion(""); m_policySets.Add(lps); return lps; }
public virtual IPolicySetCache GetPolicySet(string name) { InitPolicies(); foreach (IPolicySetCache ps in PolicySets) { if (ps.Id == name) return ps; } if (System.IO.File.Exists(name)) { LocalPolicySetCache lps = new LocalPolicySetCache(name); if ((m_runtime && !lps.RuntimeType)) { //Dont allow .policy files in the 'runtimepolicy' cache, but //runtimepolicies are allowed in the cache where 'policy' files live. return null; } // This causes a lot of memory leak, so commenting it for now // m_policySets.Add(lps); return lps; } return null; }
public IPolicyXml GetPolicySetXml(string name) { Logger.LogInfo(string.Format("GetPolicySetXml: {0}", name)); LocalPolicySetCache lps = new LocalPolicySetCache(); return lps.GetExistingPolicySetXml(name); }
protected virtual void AddPolicySet(string policysetFile) { LocalPolicySetCache lps = new LocalPolicySetCache(policysetFile); if (lps.InitialisedOK) { if ((m_runtime && lps.RuntimeType) || (!m_runtime && !lps.RuntimeType)) { Logger.LogInfo(string.Format("Adding PolicySet to cache for policy: {0}", policysetFile)); m_policySets.Add(lps); } } }