     public init(path: URL, filenameGenerator: @escaping (String) -> String? = DataCache.filename(for:)) throws {
         self.path = path
         self._filenameGenerator = filenameGenerator
-        try FileManager.default.createDirectory(at: path, withIntermediateDirectories: true, attributes: nil)
+        try self._didInit()
     }
 
     /// A `FilenameGenerator` implementation which uses SHA1 hash function to


    // MARK: Sweep

    private func _scheduleSweep() {
        _wqueue.asyncAfter(deadline: .now() + sweepInterval) { [weak self] in
            self?._sweep()
            self?._scheduleSweep()
        }
    }

    func sweep() {
        _wqueue.async {
            self._sweep()
        }

    /// Sweeps are performed in a background and can be performed in parallel
    /// with reading.
    public var sweepInterval: TimeInterval = 30

    /// The delay after which the initial sweep is performed. 10 by default.
    /// The initial sweep is performed after a delay to avoid competing with
    /// other subsystems for the resources.
    private var initialSweepDelay: TimeInterval = 15

    // Staging
    private let _lock = NSLock()
