Init
This commit is contained in:
31
Shared/Models/Stateless/Methods/Index.cs
Normal file
31
Shared/Models/Stateless/Methods/Index.cs
Normal file
@ -0,0 +1,31 @@
|
||||
namespace View_by_Distance.Shared.Models.Stateless.Methods;
|
||||
|
||||
internal abstract class Index
|
||||
{
|
||||
|
||||
internal static string GetJson(string jsonFileFullName, FileInfo fileInfo)
|
||||
{
|
||||
string result;
|
||||
string fileSegment = "FileSegment";
|
||||
string fileSegmentCollection = "FileSegmentCollection";
|
||||
result = File.ReadAllText(jsonFileFullName).Replace("Goolgle", "Google");
|
||||
if (result.Contains(fileSegment) || result.Contains(fileSegmentCollection))
|
||||
{
|
||||
if (fileInfo is null)
|
||||
fileInfo = new FileInfo(jsonFileFullName);
|
||||
result = result.Replace(fileSegmentCollection, nameof(Properties.IIndex.RelativePaths)).Replace("\\\\", "/");
|
||||
File.WriteAllText(fileInfo.FullName, result);
|
||||
File.SetLastWriteTime(fileInfo.FullName, fileInfo.LastWriteTime);
|
||||
}
|
||||
if (result.Contains("/u0"))
|
||||
{
|
||||
if (fileInfo is null)
|
||||
fileInfo = new FileInfo(jsonFileFullName);
|
||||
result = result.Replace("/u0", "\\u0");
|
||||
File.WriteAllText(fileInfo.FullName, result);
|
||||
File.SetLastWriteTime(fileInfo.FullName, fileInfo.LastWriteTime);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user