20 private readonly
string _processedDataDirectory;
25 public event EventHandler<DataProviderNewDataRequestEventArgs>
NewDataRequest;
32 _defaultDataProvider =
new();
33 _processedDataDirectory =
Config.
Get(
"processed-data-directory") ??
string.Empty;
34 Log.
Trace($
"ProcessedDataProvider(): processed data directory to use {_processedDataDirectory}, exists: {Directory.Exists(_processedDataDirectory)}");
47 if (_processedDataDirectory.Length != 0 && key.StartsWith(
Globals.
DataFolder, StringComparison.OrdinalIgnoreCase))
49 result = _defaultDataProvider.Fetch(Path.Combine(_processedDataDirectory, key.Remove(0,
Globals.
DataFolder.Length).TrimStart(
'/',
'\\')));
52 Log.
Trace($
"ProcessedDataProvider.Fetch({key}): fetched from processed data directory");
57 return result ?? _defaultDataProvider.Fetch(key);
66 GC.SuppressFinalize(
this);
72 protected virtual void Dispose(
bool disposing)
76 _defaultDataProvider.Dispose();