using System;
using StubCore.Plugins.FileOperations;

namespace StubCore.Plugins.Repositories
{
    public class DataRepository
    {
        private readonly string _path;     
        private readonly string _filesFolder = "Data";

        public DataRepository(string file, string folder, bool isRootLevel)
        {
            _path = isRootLevel ? String.Format("{0}/{1}", _filesFolder, file) : String.Format("{0}/{1}/{2}", _filesFolder, folder, file);
        }

        public string Get()
        {
            var _file = new FileDataOperations();
            return _file.GetFile(_path);
        }
       
        public bool UpdateProfileList(string input)
        {
            var _file = new FileDataOperations();
            return _file.SaveFile(_path, input);
        }

    }
}
