/// <summary>
 /// Initializes a new instance of the <see cref="UnixFileSystemProvider"/> class.
 /// </summary>
 /// <param name="options">The file system options.</param>
 /// <param name="accountDirectoryQuery">Interface to query account directories.</param>
 /// <param name="logger">The logger for this file system.</param>
 public UnixFileSystemProvider(
     IOptions <UnixFileSystemOptions> options,
     IAccountDirectoryQuery accountDirectoryQuery,
     ILogger <UnixFileSystemProvider>?logger = null)
 {
     _accountDirectoryQuery = accountDirectoryQuery;
     _logger  = logger;
     _options = options.Value;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnixFileSystemProvider"/> class.
 /// </summary>
 /// <param name="options">The file system options.</param>
 /// <param name="accountDirectoryQuery">Interface to query account directories.</param>
 /// <param name="logger">The logger for this file system.</param>
 public UnixFileSystemProvider(
     [NotNull] IOptions <UnixFileSystemOptions> options,
     [NotNull] IAccountDirectoryQuery accountDirectoryQuery,
     [CanBeNull] ILogger <UnixFileSystemProvider> logger = null)
 {
     _accountDirectoryQuery = accountDirectoryQuery;
     _logger  = logger;
     _options = options.Value;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnixFileSystemProvider"/> class.
 /// </summary>
 /// <param name="options">The file system options.</param>
 /// <param name="accountDirectoryQuery">Interface to query account directories.</param>
 /// <param name="loggerFactory">Factory to create loggers.</param>
 public UnixFileSystemProvider(
     IOptions <UnixFileSystemOptions> options,
     IAccountDirectoryQuery accountDirectoryQuery,
     ILoggerFactory?loggerFactory)
 {
     _accountDirectoryQuery = accountDirectoryQuery;
     _loggerFactory         = loggerFactory;
     _logger  = loggerFactory?.CreateLogger <UnixFileSystemProvider>();
     _options = options.Value;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SetHomeDirectoryAction"/> class.
 /// </summary>
 /// <param name="options">The options for the <see cref="SetHomeDirectoryAction"/>.</param>
 /// <param name="ftpConnectionAccessor">The FTP connection accessor.</param>
 /// <param name="accountDirectoryQuery">Interface to query account directories.</param>
 /// <param name="logger">The logger.</param>
 public SetHomeDirectoryAction(
     [NotNull] IOptions <SetHomeDirectoryActionOptions> options,
     [NotNull] IFtpConnectionAccessor ftpConnectionAccessor,
     [NotNull] IAccountDirectoryQuery accountDirectoryQuery,
     [CanBeNull] ILogger <SetHomeDirectoryAction> logger = null)
 {
     _ftpConnectionAccessor = ftpConnectionAccessor;
     _accountDirectoryQuery = accountDirectoryQuery;
     _logger = logger;
     _createMissingDirectories = options.Value.CreateMissingDirectories;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InMemoryFileSystemProvider"/> class.
 /// </summary>
 /// <param name="options">The provider options.</param>
 /// <param name="accountDirectoryQuery">Interface to query account directories.</param>
 public InMemoryFileSystemProvider(
     IOptions <InMemoryFileSystemOptions> options,
     IAccountDirectoryQuery accountDirectoryQuery)
 {
     _accountDirectoryQuery           = accountDirectoryQuery;
     _fileSystemComparer              = options.Value.FileSystemComparer;
     _keepAnonymousFileSystem         = options.Value.KeepAnonymousFileSystem;
     _keepAuthenticatedUserFileSystem = options.Value.KeepAuthenticatedUserFileSystem;
     _anonymousFileSystems            = new Dictionary <string, InMemoryFileSystem>(options.Value.AnonymousComparer);
     _authUserFileSystems             = new Dictionary <string, InMemoryFileSystem>(options.Value.UserNameComparer);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DotNetFileSystemProvider"/> class.
 /// </summary>
 /// <param name="options">The file system options.</param>
 /// <param name="accountDirectoryQuery">Interface to query account directories.</param>
 /// <param name="logger">The logger.</param>
 public DotNetFileSystemProvider(
     [NotNull] IOptions <DotNetFileSystemOptions> options,
     [NotNull] IAccountDirectoryQuery accountDirectoryQuery,
     [CanBeNull] ILogger <DotNetFileSystemProvider> logger = null)
 {
     _accountDirectoryQuery = accountDirectoryQuery;
     _logger                       = logger;
     _rootPath                     = string.IsNullOrEmpty(options.Value.RootPath) ? Path.GetTempPath() : options.Value.RootPath;
     _streamBufferSize             = options.Value.StreamBufferSize ?? DotNetFileSystem.DefaultStreamBufferSize;
     _allowNonEmptyDirectoryDelete = options.Value.AllowNonEmptyDirectoryDelete;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SetHomeDirectoryAction"/> class.
 /// </summary>
 /// <param name="options">The options for the <see cref="SetHomeDirectoryAction"/>.</param>
 /// <param name="ftpConnectionAccessor">The FTP connection accessor.</param>
 /// <param name="accountDirectoryQuery">Interface to query account directories.</param>
 /// <param name="logger">The logger.</param>
 public SetHomeDirectoryAction(
     IOptions <SetHomeDirectoryActionOptions> options,
     IFtpConnectionAccessor ftpConnectionAccessor,
     IAccountDirectoryQuery accountDirectoryQuery,
     ILogger <SetHomeDirectoryAction>?logger = null)
 {
     _ftpConnectionAccessor = ftpConnectionAccessor;
     _accountDirectoryQuery = accountDirectoryQuery;
     _logger = logger;
     _createMissingDirectories = options.Value.CreateMissingDirectories;
 }
 public CustomServerDemoProvider(
     IOptions <CustomServerDemoOptions> options,
     IAccountDirectoryQuery accountDirectoryQuery,
     ILogger <CustomServerDemoProvider>?logger = null
     )
 {
     _accountDirectoryQuery = accountDirectoryQuery;
     _logger                       = logger;
     _rootPath                     = string.IsNullOrEmpty(options.Value.RootPath) ? Path.GetTempPath() : options.Value.RootPath !;
     _streamBufferSize             = options.Value.StreamBufferSize ?? CustomServerDemo.DefaultStreamBufferSize;
     _allowNonEmptyDirectoryDelete = options.Value.AllowNonEmptyDirectoryDelete;
     _flushAfterWrite              = options.Value.FlushAfterWrite;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="S3FileSystemProvider"/> class.
        /// </summary>
        /// <param name="options">The provider options.</param>
        /// <param name="accountDirectoryQuery">Interface to query account directories.</param>
        /// <exception cref="ArgumentException">Gets thrown when the S3 credentials weren't set.</exception>
        public S3FileSystemProvider(IOptions <S3FileSystemOptions> options, IAccountDirectoryQuery accountDirectoryQuery)
        {
            _options = options.Value;
            _accountDirectoryQuery = accountDirectoryQuery;

            if (string.IsNullOrEmpty(_options.AwsAccessKeyId) ||
                string.IsNullOrEmpty(_options.AwsSecretAccessKey) ||
                string.IsNullOrEmpty(_options.BucketName) ||
                string.IsNullOrEmpty(_options.BucketRegion))
            {
                throw new ArgumentException("S3 Credentials have not been set correctly");
            }
        }
        public ServerManagerFileSystemProvider(IOptions <DotNetFileSystemOptions> options,
                                               IAccountDirectoryQuery accountDirectoryQuery,
                                               ILogger <ServerManagerFileSystemProvider> logger,
                                               IServiceProvider serviceProvider)
        {
            _accountDirectoryQuery = accountDirectoryQuery;
            _logger          = logger;
            _options         = options.Value;
            _serviceProvider = serviceProvider;

            _rootPath = string.IsNullOrEmpty(options.Value.RootPath)
                ? Path.GetTempPath()
                : options.Value.RootPath !;
            _streamBufferSize             = options.Value.StreamBufferSize ?? DotNetFileSystem.DefaultStreamBufferSize;
            _allowNonEmptyDirectoryDelete = options.Value.AllowNonEmptyDirectoryDelete;
            //_flushAfterWrite = options.Value;
        }
Exemplo n.º 11
0
 public AzureBlobFileSystemProvider(IOptions <AzureBlobFileSystemOptions> options, IAccountDirectoryQuery accountDirectoryQuery)
 {
     _options = options.Value;
     _accountDirectoryQuery = accountDirectoryQuery;
 }