open static method

Future<FileBlossomCache> open({
  1. required String path,
})

Opens (or creates) the cache in the directory at path.

Files without metadata and metadata without a file, left behind by a crash or by the system clearing the directory, are dropped on open.

Implementation

static Future<FileBlossomCache> open({required String path}) async {
  final blobs = Directory(p.join(path, 'blobs'));
  await blobs.create(recursive: true);
  final db = await databaseFactoryIo.openDatabase(p.join(path, 'meta.db'));
  final cache = FileBlossomCache._(path, blobs, db);
  await cache._reconcile();
  return cache;
}