/// <summary> /// Initializes a new instance of the <see cref="SQLiteFileSystemFactory"/> class. /// </summary> /// <param name="options">The options for this file system</param> /// <param name="pathTraversalEngine">The engine to traverse paths</param> /// <param name="propertyStoreFactory">The store for dead properties</param> /// <param name="lockManager">The global lock manager</param> public SQLiteFileSystemFactory( IOptions <SQLiteFileSystemOptions> options, IPathTraversalEngine pathTraversalEngine, IPropertyStoreFactory propertyStoreFactory = null, ILockManager lockManager = null) { _pathTraversalEngine = pathTraversalEngine; _propertyStoreFactory = propertyStoreFactory; _lockManager = lockManager; _options = options.Value; }
/// <summary> /// Initializes a new instance of the <see cref="SQLiteFileSystem"/> class. /// </summary> /// <param name="options">The options for this file system</param> /// <param name="mountPoint">The mount point where this file system should be included</param> /// <param name="connection">The SQLite database connection</param> /// <param name="pathTraversalEngine">The engine to traverse paths</param> /// <param name="lockManager">The global lock manager</param> /// <param name="propertyStoreFactory">The store for dead properties</param> public SQLiteFileSystem( SQLiteFileSystemOptions options, ICollection mountPoint, db::SQLiteConnection connection, IPathTraversalEngine pathTraversalEngine, ILockManager lockManager = null, IPropertyStoreFactory propertyStoreFactory = null) { RootDirectoryPath = Path.GetDirectoryName(connection.DatabasePath); LockManager = lockManager; _connection = connection; _pathTraversalEngine = pathTraversalEngine; Options = options; PropertyStore = propertyStoreFactory?.Create(this); var rootEntry = connection.Table <FileEntry>().Where(x => x.Id == string.Empty).ToList().Single(); var rootPath = mountPoint?.Path ?? new Uri(string.Empty, UriKind.Relative); var rootDir = new SQLiteCollection(this, mountPoint, rootEntry, rootPath, mountPoint?.Name ?? rootPath.GetName(), true); Root = new AsyncLazy <ICollection>(() => Task.FromResult <ICollection>(rootDir)); }