public DirectoryManager(IFileWriter fileWriter, IFileReader fileReader, IFilePathBuilder filePathBuilder, IDatabase database, IHttpContextAccessor httpContextAccessor) { this.fileWriter = fileWriter; this.fileReader = fileReader; this.filePathBuilder = filePathBuilder; this.database = database; this.currentUserId = httpContextAccessor.HttpContext.GetCurrentUserId(); }
private void SetUpFilePathBuilder() { _filePathBuilder = Substitute.For <IFilePathBuilder>(); _filePathBuilder.BuildFilePath(_deviceName, _humiditySensorType, _date).Returns(_humidityFilePath); _filePathBuilder.BuildFilePath(_deviceName, _rainfallSensorType, _date).Returns(_rainfallFilePath); _filePathBuilder.BuildFilePath(_deviceName, _temperatureSensorType, _date).Returns(_temperatureFilePath); _filePathBuilder.BuildHistoricalFilePath(_deviceName, _humiditySensorType).Returns(_humidityHistoricalFilePath); _filePathBuilder.BuildHistoricalFilePath(_deviceName, _rainfallSensorType).Returns(_rainfallHistoricalFilePath); _filePathBuilder.BuildHistoricalFilePath(_deviceName, _temperatureSensorType).Returns(_temperatureHistoricalFilePath); }
public StorageManager(IFileWriter fileWriter, IFileReader fileReader, IFilePathBuilder filePathBuilder, IDatabase database, IReadOnlyStorageSizeManager storageSizeManager, IHttpContextAccessor httpContextAccessor) { this.fileWriter = fileWriter; this.fileReader = fileReader; this.filePathBuilder = filePathBuilder; this.database = database; this.storageSizeManager = storageSizeManager; this.currentUserId = httpContextAccessor.HttpContext.GetCurrentUserId(); }
public DevicesHandler( IParserProvider parserProvider, IFilePathBuilder filePathBuilder, IBlobClientProvider blobClientProvider, Func <Stream, ZipArchive> zipArchiveProvider, IDeviceDataBuilder deviceDataBuilder) { _parserProvider = parserProvider; _filePathBuilder = filePathBuilder; _blobClientProvider = blobClientProvider; _zipArchiveProvider = zipArchiveProvider; _deviceDataBuilder = deviceDataBuilder; }
private void EnsureDirectoryExists(IFilePathBuilder filePathBuilder) { Directory.CreateDirectory(filePathBuilder.StorageDirectory); }
public FileWorldStateSaver(IFilePathBuilder filePathBuilder) { _filePathBuilder = filePathBuilder; }
/// <summary> /// Create a file system manager /// </summary> /// <param name="rootDirectory">root directory to store app data in /// this will be something like the general local Application data directory/</param> public FileSystemManager(IFilePathBuilder filePathBuilder) { this.filePathBuilder = filePathBuilder; }