This commit is contained in:
2021-11-29 18:19:58 +00:00
parent 3f3304dcda
commit 762ebc676b
3 changed files with 47 additions and 28 deletions

View File

@@ -348,17 +348,9 @@ namespace AyaNova.Util
internal static long BackupFilesDriveAvailableSpace()
{
try
{
return new System.IO.DriveInfo(Path.GetPathRoot(BackupFilesFolder)).AvailableFreeSpace;
}
catch (Exception ex)
{
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("FileUtil::UtilityFilesDriveAvailableSpace");
log.LogError(ex, "FileUtil::UtilityFilesDriveAvailableSpace error getting available space");
return 0;
}
return new System.IO.DriveInfo(Path.GetPathRoot(BackupFilesFolder)).AvailableFreeSpace;
}
#endregion Utility file handling
@@ -594,17 +586,7 @@ namespace AyaNova.Util
internal static long AttachmentFilesDriveAvailableSpace()
{
try
{
return new System.IO.DriveInfo(Path.GetPathRoot(AttachmentFilesFolder)).AvailableFreeSpace;
}
catch (Exception ex)
{
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("FileUtil::AttachmentFilesDriveAvailableSpace");
log.LogError(ex, "FileUtil::AttachmentFilesDriveAvailableSpace error getting available space");
return 0;
}
return new System.IO.DriveInfo(Path.GetPathRoot(AttachmentFilesFolder)).AvailableFreeSpace;
}
internal static IEnumerable<string> GetAllAttachmentFilePaths()
@@ -822,8 +804,10 @@ namespace AyaNova.Util
return ret;
}
public static string StringPathDecodeEnvironmentVariables(string path){
if(string.IsNullOrWhiteSpace(path)){
public static string StringPathDecodeEnvironmentVariables(string path)
{
if (string.IsNullOrWhiteSpace(path))
{
return string.Empty;
}