diff --git a/GBase/FileHandling/FileHandler.cs b/GBase/FileHandling/FileHandler.cs index 89697d8..96645d3 100644 --- a/GBase/FileHandling/FileHandler.cs +++ b/GBase/FileHandling/FileHandler.cs @@ -4,6 +4,9 @@ using System.Threading; using System.Threading.Tasks; +using GBase.DataHandling.Factories; +using GBase.Interfaces.DataHandling; +using GBase.Interfaces.DataHandling.Xml; using GBase.Interfaces.FileHandling; namespace GBase.FileHandling @@ -13,6 +16,22 @@ namespace GBase.FileHandling /// public class FileHandler : IFileHandler { + private readonly IXmlDataHandlerFactory _dataHandlerFactory; + + /// + /// Internal file handler + /// + /// Factory for the + public FileHandler(IXmlDataHandlerFactory xmlDataHandlerFactory) + { + _dataHandlerFactory = xmlDataHandlerFactory; + } + + /// + /// The of this + /// + private IDataHandler DataHandler { get; set; } + /// /// Initialize this /// @@ -21,7 +40,10 @@ namespace GBase.FileHandling /// True if successful, false if not public async Task Init(string path, CancellationToken cancellationToken) { - throw new System.NotImplementedException(); + DataHandler = _dataHandlerFactory.Create(); + + bool success = await DataHandler.Init(false, cancellationToken); + return success; } /// @@ -30,7 +52,7 @@ namespace GBase.FileHandling /// A to await public async ValueTask DisposeAsync() { - throw new System.NotImplementedException(); + await DataHandler.DisposeAsync(); } } } \ No newline at end of file