public GeoLocationWrite(AppSettings appSettings, IExifTool exifTool, ISelectorStorage selectorStorage, IConsole console) { _exifTool = exifTool; _appSettings = appSettings; _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail); _iStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _console = console; }
public ThumbnailGenerationController(ISelectorStorage selectorStorage, IQuery query, IWebLogger logger, IWebSocketConnectionsService connectionsService) { _selectorStorage = selectorStorage; _query = query; _logger = logger; _connectionsService = connectionsService; }
public MetaThumbnailCommandLineHelper(ISelectorStorage selectorStorage, AppSettings appSettings, IConsole console, IMetaExifThumbnailService metaExifThumbnailService) { _selectorStorage = selectorStorage; _appSettings = appSettings; _metaExifThumbnailService = metaExifThumbnailService; _console = console; }
public UpdateImportTransformations(IWebLogger logger, IExifTool exifTool, ISelectorStorage selectorStorage, AppSettings appSettings) { _logger = logger; _exifTool = exifTool; _subPathStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail); _appSettings = appSettings; }
public WebFtpCli(AppSettings appSettings, ISelectorStorage selectorStorage, IConsole console, IFtpWebRequestFactory webRequestFactory) { _appSettings = appSettings; _console = console; _argsHelper = new ArgsHelper(_appSettings, console); _hostStorageProvider = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem); _webRequestFactory = webRequestFactory; }
public Synchronize(AppSettings appSettings, IQuery query, ISelectorStorage selectorStorage, IWebLogger logger, IMemoryCache memoryCache = null) { _console = new ConsoleWrapper(); _subPathStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _syncSingleFile = new SyncSingleFile(appSettings, query, _subPathStorage, logger); _syncRemove = new SyncRemove(appSettings, query, memoryCache, logger); _syncFolder = new SyncFolder(appSettings, query, selectorStorage, _console, logger, memoryCache); _syncIgnoreCheck = new SyncIgnoreCheck(appSettings, _console); }
public ExportService(IQuery query, AppSettings appSettings, ISelectorStorage selectorStorage, IWebLogger logger) { _appSettings = appSettings; _query = query; _iStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail); _hostFileSystemStorage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem); _logger = logger; }
/// <summary>Replace meta content</summary> /// <param name="query">Starsky IQuery interface to do calls on the database</param> /// <param name="appSettings">Settings of the application</param> /// <param name="selectorStorage">storage abstraction</param> /// <param name="logger">web logger</param> public MetaReplaceService(IQuery query, AppSettings appSettings, ISelectorStorage selectorStorage, IWebLogger logger) { _query = query; _appSettings = appSettings; if (selectorStorage != null) { _iStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); } _logger = logger; }
public GeoController(IUpdateBackgroundTaskQueue queue, ISelectorStorage selectorStorage, IMemoryCache memoryCache, IWebLogger logger, IServiceScopeFactory serviceScopeFactory) { _bgTaskQueue = queue; _iStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _cache = memoryCache; _serviceScopeFactory = serviceScopeFactory; _logger = logger; }
public ThumbnailCli(AppSettings appSettings, IConsole console, IThumbnailService thumbnailService, IThumbnailCleaner thumbnailCleaner, ISelectorStorage selectorStorage) { _appSettings = appSettings; _thumbnailService = thumbnailService; _console = console; _thumbnailCleaner = thumbnailCleaner; _selectorStorage = selectorStorage; }
public OverlayImage(ISelectorStorage selectorStorage, AppSettings appSettings) { _appSettings = appSettings; if (selectorStorage == null) { return; } _iStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail); _hostFileSystem = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem); }
public CopyPublishedContent(AppSettings appSettings, ToCreateSubfolder toCreateSubfolder, ISelectorStorage selectorStorage) { _appSettings = appSettings; _toCreateSubfolder = toCreateSubfolder; if (selectorStorage == null) { return; } _hostStorage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem); }
public PublishCli(ISelectorStorage storageSelector, IPublishPreflight publishPreflight, IWebHtmlPublishService publishService, AppSettings appSettings, IConsole console) { _publishPreflight = publishPreflight; _publishService = publishService; _appSettings = appSettings; _console = console; _argsHelper = new ArgsHelper(appSettings, console); _hostFileSystemStorage = storageSelector.Get(SelectorStorage.StorageServices.HostFilesystem); _subPathStorage = storageSelector.Get(SelectorStorage.StorageServices.SubPath); }
public MetaExifThumbnailService(AppSettings appSettings, ISelectorStorage selectorStorage, IOffsetDataMetaExifThumbnail offsetDataMetaExifThumbnail, IWriteMetaThumbnailService writeMetaThumbnailService, IWebLogger logger) { _appSettings = appSettings; _iStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail); _offsetDataMetaExifThumbnail = offsetDataMetaExifThumbnail; _writeMetaThumbnailService = writeMetaThumbnailService; _logger = logger; }
public OverlayImageTest() { _storage = new FakeIStorage(new List <string> { "/" }, new List <string> { "/test.jpg" }, new List <byte[]> { CreateAnImage.Bytes }); _selectorStorage = new FakeSelectorStorage(_storage); }
public SyncFolder(AppSettings appSettings, IQuery query, ISelectorStorage selectorStorage, IConsole console, IWebLogger logger, IMemoryCache memoryCache) { _subPathStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _appSettings = appSettings; _setupDatabaseTypes = new SetupDatabaseTypes(appSettings); _query = query; _console = console; _duplicate = new Duplicate(_query); _logger = logger; _memoryCache = memoryCache; _syncIgnoreCheck = new SyncIgnoreCheck(appSettings, console); }
public GeoBackgroundTask(AppSettings appSettings, ISelectorStorage selectorStorage, IGeoLocationWrite geoLocationWrite, IMemoryCache memoryCache, IWebLogger logger, IGeoReverseLookup geoReverseLookup) { _appSettings = appSettings; _iStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail); _readMeta = new ReadMeta(_iStorage); _geoLocationWrite = geoLocationWrite; _logger = logger; _geoIndexGpx = new GeoIndexGpx(_appSettings, _iStorage, memoryCache); _geoReverseLookup = geoReverseLookup; }
public GeoCli(IGeoReverseLookup geoReverseLookup, IGeoLocationWrite geoLocationWrite, ISelectorStorage selectorStorage, AppSettings appSettings, IConsole console, IGeoFileDownload geoFileDownload, IExifToolDownload exifToolDownload) { _geoReverseLookup = geoReverseLookup; _geoLocationWrite = geoLocationWrite; _iStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail); _readMeta = new ReadMeta(_iStorage, appSettings); _appSettings = appSettings; _console = console; _exifToolDownload = exifToolDownload; _geoFileDownload = geoFileDownload; }
public ImportController(IImport import, AppSettings appSettings, IUpdateBackgroundTaskQueue queue, IHttpClientHelper httpClientHelper, ISelectorStorage selectorStorage, IServiceScopeFactory scopeFactory, IWebLogger logger) { _appSettings = appSettings; _import = import; _bgTaskQueue = queue; _httpClientHelper = httpClientHelper; _selectorStorage = selectorStorage; _hostFileSystemStorage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem); _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail); _scopeFactory = scopeFactory; _logger = logger; }
public UploadController(IImport import, AppSettings appSettings, ISelectorStorage selectorStorage, IQuery query, IRealtimeConnectionsService connectionsService, IWebLogger logger, IMetaExifThumbnailService metaExifThumbnailService) { _appSettings = appSettings; _import = import; _query = query; _selectorStorage = selectorStorage; _iStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _iHostStorage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem); _connectionsService = connectionsService; _logger = logger; _metaExifThumbnailService = metaExifThumbnailService; }
public MetaUpdateService( IQuery query, IExifTool exifTool, ISelectorStorage selectorStorage, IMetaPreflight metaPreflight, IWebLogger logger, IReadMetaSubPathStorage readMetaSubPathStorage) { _query = query; _exifTool = exifTool; _iStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail); _readMeta = readMetaSubPathStorage; _metaPreflight = metaPreflight; _logger = logger; }
public WebHtmlPublishService(IPublishPreflight publishPreflight, ISelectorStorage selectorStorage, AppSettings appSettings, IExifToolHostStorage exifTool, IOverlayImage overlayImage, IConsole console, IWebLogger logger) { _publishPreflight = publishPreflight; _subPathStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail); _hostFileSystemStorage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem); _appSettings = appSettings; _exifTool = exifTool; _console = console; _overlayImage = overlayImage; _publishManifest = new PublishManifest(_hostFileSystemStorage, new PlainTextFileHelper()); _toCreateSubfolder = new ToCreateSubfolder(_hostFileSystemStorage); _copyPublishedContent = new CopyPublishedContent(_appSettings, _toCreateSubfolder, selectorStorage); _logger = logger; _thumbnailService = new Thumbnail(_subPathStorage, _thumbnailStorage, _logger); }
public AppSettingsController(AppSettings appSettings, ISelectorStorage selectorStorage) { _appSettings = appSettings; _hostStorage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem); }
public SyncCli(ISynchronize synchronize, AppSettings appSettings, IConsole console, ISelectorStorage selectorStorage) { _appSettings = appSettings; _console = console; _synchronize = synchronize; _selectorStorage = selectorStorage; }
public FakeIImport(ISelectorStorage selectorStorage) { _selectorStorage = selectorStorage; }
public AccountController(IUserManager userManager, AppSettings appSettings, IAntiforgery antiForgery, ISelectorStorage selectorStorage) { _userManager = userManager; _appSettings = appSettings; _antiForgery = antiForgery; _storageHostFullPathFilesystem = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem); }
public ThumbnailController(IQuery query, ISelectorStorage selectorStorage) { _query = query; _iStorage = selectorStorage.Get(SelectorStorage.StorageServices.SubPath); _thumbnailStorage = selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail); }
public static async Task <List <string> > StreamFile(this HttpRequest request, AppSettings appSettings, ISelectorStorage selectorStorage) { // The Header 'filename' is for uploading on file without a form. return(await StreamFile(request.ContentType, request.Body, appSettings, selectorStorage, HeaderFileName(request, appSettings))); }
public PublishController(AppSettings appSettings, IPublishPreflight publishPreflight, IWebHtmlPublishService publishService, IMetaInfo metaInfo, ISelectorStorage selectorStorage, IUpdateBackgroundTaskQueue queue, IWebLogger webLogger) { _appSettings = appSettings; _publishPreflight = publishPreflight; _publishService = publishService; _metaInfo = metaInfo; _hostStorage = selectorStorage.Get(SelectorStorage.StorageServices.HostFilesystem); _bgTaskQueue = queue; _webLogger = webLogger; }
public static async Task <List <string> > StreamFile(string contentType, Stream requestBody, AppSettings appSettings, ISelectorStorage selectorStorage, string headerFileName = null) { // headerFileName is for uploading on a single file without a multi part form. // fallback if (headerFileName == null) { headerFileName = Base32.Encode(FileHash.GenerateRandomBytes(8)) + ".unknown"; } var tempPaths = new List <string>(); if (!MultipartRequestHelper.IsMultipartContentType(contentType)) { if (contentType != "image/jpeg" && contentType != "application/octet-stream") { throw new FileLoadException($"Expected a multipart request, but got {contentType}; add the header 'content-type' "); } var randomFolderName = "stream_" + Base32.Encode(FileHash.GenerateRandomBytes(4)); var fullFilePath = Path.Combine(appSettings.TempFolder, randomFolderName, headerFileName); // Write to disk var hostFileSystemStorage = selectorStorage.Get(SelectorStorage.StorageServices .HostFilesystem); hostFileSystemStorage.CreateDirectory(Path.Combine(appSettings.TempFolder, randomFolderName)); await hostFileSystemStorage .WriteStreamAsync(requestBody, fullFilePath); tempPaths.Add(fullFilePath); return(tempPaths); } // Used to accumulate all the form url encoded key value pairs in the // request. var boundary = MultipartRequestHelper.GetBoundary(MediaTypeHeaderValue.Parse(contentType), DefaultFormOptions.MultipartBoundaryLengthLimit); var reader = new MultipartReader(boundary, requestBody); var section = await reader.ReadNextSectionAsync(); while (section != null) { var hasContentDispositionHeader = ContentDispositionHeaderValue.TryParse( section.ContentDisposition, out var contentDisposition); if (hasContentDispositionHeader && MultipartRequestHelper.HasFileContentDisposition(contentDisposition)) { var sourceFileName = contentDisposition.FileName.ToString().Replace("\"", string.Empty); var inputExtension = Path.GetExtension(sourceFileName).Replace("\n", string.Empty); var tempHash = appSettings.GenerateSlug(Path.GetFileNameWithoutExtension(sourceFileName), true, false); // underscore allowed var randomFolderName = "stream_" + Base32.Encode(FileHash.GenerateRandomBytes(4)); var fullFilePath = Path.Combine(appSettings.TempFolder, randomFolderName, tempHash + inputExtension); tempPaths.Add(fullFilePath); var hostFileSystemStorage = selectorStorage.Get(SelectorStorage.StorageServices .HostFilesystem); hostFileSystemStorage.CreateDirectory(Path.Combine(appSettings.TempFolder, randomFolderName)); await hostFileSystemStorage .WriteStreamAsync(section.Body, fullFilePath); } // Drains any remaining section body that has not been consumed and // reads the headers for the next section. section = await reader.ReadNextSectionAsync(); } return(tempPaths); }