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

Method resolvePictureFile

lib/Service/PanoramaService.php:136–148  ·  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

134 * @throws \OCP\Files\NotPermittedException
135 */
136 public function resolvePictureFile(string $path): int {
137 $path = ltrim($path, '/');
138 if ($path === '') {
139 throw new \InvalidArgumentException('Picture path must not be empty');
140 }
141
142 $file = $this->rootFolder->getUserFolder($this->userId)->get($path);
143 if (!in_array($file->getMimeType(), self::PICTURE_MIME_TYPES, true)) {
144 throw new \InvalidArgumentException('Selected node is not a supported picture');
145 }
146
147 return (int)$file->getId();
148 }
149
150 /**
151 * check if own report

Calls 4

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