|
|
|
|
@ -7,6 +7,7 @@ using System.IO; |
|
|
|
|
using System.Linq; |
|
|
|
|
using System.Threading; |
|
|
|
|
using System.Threading.Tasks; |
|
|
|
|
using GBase.Api; |
|
|
|
|
using GBase.FileHandling.Exceptions; |
|
|
|
|
using GBase.Interfaces; |
|
|
|
|
using GBase.Interfaces.FileHandling; |
|
|
|
|
@ -60,7 +61,7 @@ namespace GBase.FileHandling |
|
|
|
|
return _files; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IGBaseFile CreateEntryFile<T>(T entry, IGBaseTable table) |
|
|
|
|
public IGBaseFile CreateEntryFile<T>(T entry, IGBaseTable table) where T : IGBaseObject //TODO: Use IGBaseObject as T, add method like GetFilename() |
|
|
|
|
{ |
|
|
|
|
string directoryPath = Path.Combine(_path, table.FolderName); |
|
|
|
|
|
|
|
|
|
@ -68,7 +69,7 @@ namespace GBase.FileHandling |
|
|
|
|
Directory.CreateDirectory(directoryPath); |
|
|
|
|
|
|
|
|
|
//create new entry file |
|
|
|
|
string filePath = $"{Path.Combine(directoryPath, entry.ToString())}.{GBASE_TABLE_FILE_EXTENSION}"; |
|
|
|
|
string filePath = $"{Path.Combine(directoryPath, entry.FileName)}.{GBASE_TABLE_FILE_EXTENSION}"; |
|
|
|
|
|
|
|
|
|
//check if file is already opened |
|
|
|
|
IGBaseFile file = _files.FirstOrDefault(f => f.FilePath.Equals(filePath)); |
|
|
|
|
|