create static method
Creates the session directory and removes leftovers of sessions older
than staleAfter (e.g. after a crash).
Implementation
static Future<SessionFiles> create({
Duration staleAfter = const Duration(hours: 12),
}) async {
final root = await _root();
await _sweep(root, staleAfter);
final id =
'${DateTime.now().millisecondsSinceEpoch}_'
'${math.Random().nextInt(1 << 32).toRadixString(16)}';
final dir = Directory('${root.path}/$id');
await dir.create(recursive: true);
return SessionFiles._(dir);
}