EDA - StoragePaths

This commit is contained in:
2022-05-17 08:29:19 -07:00
parent 0a2f97fd93
commit fd7fad62fb
4 changed files with 16 additions and 30 deletions

View File

@ -675,7 +675,6 @@ public class Background : Models.Properties.IBackground, IBackground, IDisposabl
string? modifiedDate;
string edaObjectFile;
string goldDirectory;
string unitDirectory;
string replace = "$$$";
string edaObjectDirectory;
DateTime lastModifiedDate;
@ -791,28 +790,15 @@ public class Background : Models.Properties.IBackground, IBackground, IDisposabl
{ File.SetCreationTime(fileName, lastModifiedDate); File.SetLastWriteTime(fileName, lastModifiedDate); }
catch (Exception) { }
}
if (string.IsNullOrEmpty(configuration.Settings.StoragePath) || !Directory.Exists(Path.GetPathRoot(configuration.Settings.StoragePath)))
if (!common.StoragePaths.Any())
continue;
if (!Directory.Exists(common.StoragePath))
_ = Directory.CreateDirectory(common.StoragePath);
if (!common.StoragePath.Contains(common.UnitName) && (common.StoragePath.Contains(@"01EquipmentIntegration") || common.StoragePath.Contains(@"02BusinessIntegration")))
foreach (string? storagePath in common.StoragePaths)
{
common.StoragePath = common.StoragePath.Replace("Traces", "Empty");
if (!Directory.Exists(common.StoragePath))
_ = Directory.CreateDirectory(common.StoragePath);
if (common.UnitName != "PRF01")
{
unitDirectory = string.Concat(Path.GetDirectoryName(common.StoragePath), @"\", common.UnitName);
common.StoragePath = string.Concat(unitDirectory, @"\BadPath");
if (!Directory.Exists(common.StoragePath))
_ = Directory.CreateDirectory(common.StoragePath);
common.StoragePath = string.Concat(unitDirectory, @"\LogFile");
if (!Directory.Exists(common.StoragePath))
_ = Directory.CreateDirectory(common.StoragePath);
common.StoragePath = string.Concat(unitDirectory, @"\PollPath");
if (!Directory.Exists(common.StoragePath))
_ = Directory.CreateDirectory(common.StoragePath);
}
if (string.IsNullOrEmpty(storagePath) || !Directory.Exists(Path.GetPathRoot(storagePath)))
continue;
if (Directory.Exists(storagePath))
continue;
_ = Directory.CreateDirectory(storagePath);
}
}
}