Update FSUtils.cs

pull/1/head
Ogoun 5 years ago
parent 1e0b3bd664
commit 61163cf910

@ -31,7 +31,7 @@ namespace ZeroLevel.Services.FileSystem
return Path.Combine(folderName, fn); return Path.Combine(folderName, fn);
} }
public static string GetAppLocalDirectory(string folderName) public static string GetAppLocalTempDirectory(string folderName)
{ {
folderName = Path.Combine(Configuration.BaseDirectory, "temp", folderName); folderName = Path.Combine(Configuration.BaseDirectory, "temp", folderName);
if (false == Directory.Exists(folderName)) if (false == Directory.Exists(folderName))
@ -41,6 +41,16 @@ namespace ZeroLevel.Services.FileSystem
return folderName; return folderName;
} }
public static string GetAppLocalDbDirectory(string dbFolderName = null)
{
dbFolderName = Path.Combine(Configuration.BaseDirectory, dbFolderName ?? "db");
if (false == Directory.Exists(dbFolderName))
{
Directory.CreateDirectory(dbFolderName);
}
return dbFolderName;
}
#region FileName & Path correction #region FileName & Path correction
private static string _invalid_path_characters = new string(Path.GetInvalidPathChars()); private static string _invalid_path_characters = new string(Path.GetInvalidPathChars());
@ -241,7 +251,7 @@ namespace ZeroLevel.Services.FileSystem
deleted = true; deleted = true;
} }
} }
catch(Exception ex) catch (Exception ex)
{ {
Log.SystemError(ex, $"[FSUtils.RemoveFolder] Fault remove folder {path}"); Log.SystemError(ex, $"[FSUtils.RemoveFolder] Fault remove folder {path}");
try_counter++; try_counter++;

Loading…
Cancel
Save

Powered by TurnKey Linux.