internal NPoiExcelFile(Stream stream, IFileUtils utils, bool isXml, string fileName = "") { if (stream == null) { throw new ArgumentNullException(nameof(stream)); } FileName = fileName ?? throw new ArgumentNullException(nameof(fileName)); _utils = utils ?? throw new ArgumentNullException(nameof(utils)); try { if (isXml) { Excel = new XSSFWorkbook(stream); } else { Excel = new HSSFWorkbook(stream); } } catch (Exception exception) { ProcessException(exception, fileName, isXml); } HiddenDataFormat = Excel.GetCreationHelper() .CreateDataFormat() .GetFormat(";;;"); }
/// <summary> /// Initializes a new instance of the <see cref="FileTo"/> class. /// </summary> /// <param name="incomingHeaders">Incoming headers.</param> public FileTo(Dictionary <string, string> incomingHeaders, IFileUtils fileUtils) { this.SetupInternalActions(); this.headers = incomingHeaders.ToToConfig(); this.fileUtils = fileUtils; this.overwrite = bool.Parse(this.headers["Overwrite"]); }
public Startup(IOptions <AppSettings> settings, IFacebookCommentsApiWrapper facebookApi, IDisqusCommentsFormatter disqusFormatter, IFileUtils fileUtils) { _settings = settings?.Value ?? throw new ArgumentNullException(nameof(settings)); _facebookApi = facebookApi ?? throw new ArgumentNullException(nameof(facebookApi)); _diqusFormatter = disqusFormatter ?? throw new ArgumentNullException(nameof(disqusFormatter)); _fileUtils = fileUtils ?? throw new ArgumentNullException(nameof(fileUtils)); }
public FileCommunicationHandler(Communication communication) { _conversionHandler = new ConversionHandler(); _fileUtils = new FileUtils(); _communication = communication; _fileStreamHandler = new FileStreamHandler(_fileUtils); }
public void Init() { _settings = Substitute.For <IOptions <AppSettings> >(); _settings.Value.Returns(new AppSettings()); _facebookApi = Substitute.For <IFacebookCommentsApiWrapper>(); _disqusFormatter = Substitute.For <IDisqusCommentsFormatter>(); _fileUtils = Substitute.For <IFileUtils>(); }
private IFileUtils GetFileUtils() { if (_FileUtils == null) { _FileUtils = new FileUtils(); } return(_FileUtils); }
public void CreateLogFileCommandTest_SetUp() { _dbContext = Substitute.For <IDbContext>(); _logFileValidator = Substitute.For <ILogFileValidator>(); _logFileRepo = Substitute.For <ILogFileRepository>(); _jobRegistrationService = Substitute.For <IJobRegistrationService>(); _fileUtils = Substitute.For <IFileUtils>(); _createLogFileCommand = new CreateLogFileCommand(_dbContext, _logFileValidator, _logFileRepo, _jobRegistrationService, _fileUtils); }
public CreateLogFileCommand(IDbContext dbContext , ILogFileValidator logFileValidator , ILogFileRepository logFileRepo , IJobRegistrationService jobRegistrationService , IFileUtils fileUtils) { _dbContext = dbContext; _logFileValidator = logFileValidator; _logFileRepo = logFileRepo; _jobRegistrationService = jobRegistrationService; _fileUtils = fileUtils; }
/// <summary> /// Creates new instance of <see cref="EpisodeListManager"/> /// </summary> /// <param name="logger">Instance of <see cref="ILogger"/></param> /// <param name="fileUtils">Instance of <see cref="IFileUtils"/></param> /// <param name="applicationSettingsHelper">Instance of <see cref="IApplicationSettingsHelper"/></param> /// <param name="loaderFactory">Instance of <see cref="ILoaderFactory"/></param> public EpisodeListManager( ILogger logger, IFileUtils fileUtils, IApplicationSettingsHelper applicationSettingsHelper, ILoaderFactory loaderFactory) { this.loaderFactory = loaderFactory; this.applicationSettingsHelper = applicationSettingsHelper; this.fileUtils = fileUtils; this.logger = logger; Initialization = initializeAsync(); }
/// <summary> /// Creates new instance of <see cref="DownloadManager"/> /// </summary> /// <param name="logger">Instance of <see cref="ILogger"/></param> /// <param name="playlist">Instance of <see cref="IPlayList"/></param> /// <param name="loaderFactory">Instance of <see cref="ILoaderFactory"/></param> /// <param name="parser">Instance of <see cref="IParser"/></param> /// <param name="fileUtils">Instance of <see cref="IFileUtils"/></param> public DownloadManager( ILogger logger, ILoaderFactory loaderFactory, IParser parser, IApplicationSettingsHelper applicationSettingsHelper, IFileUtils fileUtils) { this.logger = logger; this.loaderFactory = loaderFactory; this.parser = parser; this.applicationSettingsHelper = applicationSettingsHelper; this.fileUtils = fileUtils; Initialization = RetrieveActiveDownloads(); logger.LogMessage("DownloadManager: Initialized.", LoggingLevel.Information); }
public CreateMovieHandler(IMovieRepository movieRepository, IArtistRepository artistRepository, IFileUtils fileUtils) { _movieRepository = movieRepository; _artistRepository = artistRepository; _fileUtils = fileUtils; }
public FileStreamHandler(IFileUtils fileUtils) { _fileUtils = fileUtils; }
public ZipFile(IZipFileCreator zipFileCreator, IFileUtils fileUtils, IDirectoryUtils directoryUtils) { ZipFileCreator = zipFileCreator; FileUtils = fileUtils; DirectoryUtils = directoryUtils; }
public LazyFileUtils(IFileUtils fileUtils) { FileUtils = fileUtils; }
public NPoiExcelProvider(IFileUtils fileUtils, IExcelProcessor processor) { _fileUtils = fileUtils ?? throw new ArgumentNullException(nameof(fileUtils)); _processor = processor ?? throw new ArgumentNullException(nameof(processor)); }
public CreateBookHandler(IBookRepository bookRepository, IFileUtils fileUtils) { _bookRepository = bookRepository; _fileUtils = fileUtils; }
public CreateSongHandler(ISongRepository songRepository, IFileUtils fileUtils) { _songRepository = songRepository; _fileUtils = fileUtils; }
public CreateArtistHandler(IArtistRepository artistRepository, IFileUtils fileUtils) { _artistRepository = artistRepository; _fileUtils = fileUtils; }
public CreateAlbumHandler(IAlbumRepository albumRepository, IFileUtils fileUtils) { _albumRepository = albumRepository; _fileUtils = fileUtils; }
public FileSystemCopier(IFileUtils fileUtils, IDirectoryUtils directoryUtils) { FileUtils = fileUtils; DirectoryUtils = directoryUtils; }