protected function prepareDirectory(string $path, $mode = 0755): void
    {
        $filesystem = $this->getContainer()['files'];

        if (! $filesystem->isDirectory($path)) {
            $filesystem->makeDirectory($path, $mode, true);
        }
    }