getUserFolder($userID); $this->file = $userFolder->get($path); $this->storage = $this->file->getStorage(); } public function generateUrl(): string { $filePath = $this->file->getInternalPath(); [$url] = $this->storage->getDirectDownload($filePath); return $url; } public function getUrl(): string { return $this->url; } public function getFilename(): string { return $this->file->getName(); } public function isValid(): bool { return !empty($this->file->getContent()); } }