MCPcopy Create free account
hub / github.com/Rello/analytics / resolvePictureFile

Method resolvePictureFile

lib/Service/PanoramaService.php:124–136  ·  view source on GitHub ↗

* Resolve a selected panorama picture to its file id. * * @param string $path * @return int * @throws \OCP\Files\NotFoundException * @throws \OCP\Files\NotPermittedException */

(string $path)

Source from the content-addressed store, hash-verified

122 * @throws \OCP\Files\NotPermittedException
123 */
124 public function resolvePictureFile(string $path): int {
125 $path = ltrim($path, '/');
126 if ($path === '') {
127 throw new \InvalidArgumentException('Picture path must not be empty');
128 }
129
130 $file = $this->rootFolder->getUserFolder($this->userId)->get($path);
131 if (!in_array($file->getMimeType(), self::PICTURE_MIME_TYPES, true)) {
132 throw new \InvalidArgumentException('Selected node is not a supported picture');
133 }
134
135 return (int)$file->getId();
136 }
137
138 /**
139 * check if own report

Calls 4

getUserFolderMethod · 0.80
getMimeTypeMethod · 0.80
getMethod · 0.45
getIdMethod · 0.45