public function getFilePath(IFile $file): ?string
    {
        if ($this->filePathClosure !== null) {
            return \call_user_func($this->filePathClosure, $file);
        }

        if ($file instanceof ExternalFile) {
            return $file->getActualPath();
        }

        return $file->getId() !== null
            ? $this->getFileDirectory($file) . DIRECTORY_SEPARATOR . $this->getFileName($file)
            : null;
    }