32 lines
837 B
C#
Raw Normal View History

2021-09-10 17:57:24 +01:00
using System.IO;
namespace AssortHelpers.Helpers
{
public static class DiskHelpers
{
public static void CreateDirIfDoesntExist(string path)
{
if (!Directory.Exists($"{path}"))
{
//create dump dir
Directory.CreateDirectory($"{path}");
}
}
public static string[] GetJsonFiles(string path)
{
return Directory.GetFiles(path, "*.json", SearchOption.AllDirectories);
}
2022-01-13 15:25:49 +00:00
public static string CreateWorkingFolder(string folderName)
{
var workingPath = Directory.GetCurrentDirectory();
// create input folder
var inputPath = $"{workingPath}//{folderName}";
CreateDirIfDoesntExist(inputPath);
return inputPath;
}
2021-09-10 17:57:24 +01:00
}
}