34 lines
712 B
C#
34 lines
712 B
C#
using SzLib;
|
|
|
|
namespace SzCli;
|
|
|
|
public class LocalFileManager : ISzFileManager
|
|
{
|
|
public string DataPath
|
|
{
|
|
get
|
|
{
|
|
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "data");
|
|
if (!Directory.Exists(path))
|
|
{
|
|
Directory.CreateDirectory(path);
|
|
}
|
|
|
|
return path;
|
|
}
|
|
}
|
|
|
|
public bool SaveFile(string path, string fileContent)
|
|
{
|
|
try
|
|
{
|
|
File.WriteAllText(path, fileContent);
|
|
return true;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Console.WriteLine($"Error saving file: {e.Message}");
|
|
return false;
|
|
}
|
|
}
|
|
} |