internal static void WriteTempContent(SpinProxiesRootResponse data, SpinProxiesProxyClass proxyClass) { // For viewing live data try { string content = data.ToJson(); var normalizedProxyClass = proxyClass.ToString().ToLower(); var tempProxyListFilePath = String.Format(tempProxyListFilePathFormat, normalizedProxyClass); lock (locker) { File.WriteAllText(tempProxyListFilePath, content); } } catch { } }
private static void WriteMasterContent(SpinProxiesRootResponse data, SpinProxiesProxyClass proxyClass, bool writeOriginalFile = true) { string content = data.ToJson(); var normalizedProxyClass = proxyClass.ToString().ToLower(); var masterProxyListFilePath = String.Format(masterProxyListFilePathFormat, normalizedProxyClass); lock (locker) { File.WriteAllText(masterProxyListFilePath, content); if (writeOriginalFile) { var projectMasterProxyListFilePath = $"../../../{masterProxyListFilePath}"; if (File.Exists(projectMasterProxyListFilePath)) { File.WriteAllText(projectMasterProxyListFilePath, content); } } } }