Resolve path for node with given uuid.

@param string $uuid

@return string

@throws ItemNotFoundException
185021
private function resolvePathByUuid($uuid)
    {
        $queryBuilder = new QueryBuilder($this->qomFactory);

        $queryBuilder
            ->select('node', 'jcr:uuid', 'uuid')
            ->from($this->qomFactory->selector('node', 'nt:unstructured'))
            ->where(
                $this->qomFactory->comparison(
                    $this->qomFactory->propertyValue('node', 'jcr:uuid'),
                    '=',
                    $this->qomFactory->literal($uuid)
                )
            );

        $rows = $queryBuilder->execute();

        if (1 !== count(iterator_to_array($rows->getRows()))) {
            throw new ItemNotFoundException();
        }

        return $rows->getRows()->current()->getPath();
    }
1035933
private static CmsUUID toUuid(String uuid) {

        if ("null".equals(uuid) || CmsStringUtil.isEmpty(uuid)) {
            return null;
        }
        return new CmsUUID(uuid);

    }
178774
public static function getPathFromUuid($varUuid, $blnCheckExists = true)
    {
        if (($objFile = \FilesModel::findByUuid($varUuid)) !== null)
        {
            if (!$blnCheckExists)
            {
                return $objFile->path;
            }

            if (file_exists(TL_ROOT . '/' . $objFile->path))
            {
                return $objFile->path;
            }
        }

        return null;
    }
413302
protected function findRoute($uuid)
    {
        $document = $this->documentManager->find($uuid);

        if (!$document instanceof RouteDocument) {
            return;
        }

        return $document;
    }
915138
public function getGroupForUuid($uuid)
    {
        if (!$this->accessControlManager->hasAccessEntityForUuid(self::ACCESS_ENTITY_TYPE, $uuid)) {
            return false;
        }
        
        // Get the access entity
        $accessEntity = $this->accessControlManager->getAccessEntityForUuid(self::ACCESS_ENTITY_TYPE, $uuid);

        if ($accessEntity === false) {
            return false;
        }
        
        return $accessEntity;
    }
528528
public function getPathFromUuid($uuid, $checkIfExists = true)
    {
        if (null !== ($file = $this->framework->getAdapter(FilesModel::class)->findByUuid($uuid))) {
            if (!$checkIfExists) {
                return $file->path;
            }

            $a = $this->container->getParameter('kernel.project_dir');
            $b = $file->path;
            $path = $this->container->getParameter('kernel.project_dir').'/'.$file->path;

            if (file_exists($this->container->getParameter('kernel.project_dir').'/'.$file->path)) {
                return $file->path;
            }
        }

        return null;
    }
881768
public function convertToCompliantUuid($uuid=false){
        $id = ($uuid?$uuid:$this->uuid);
        $arr = [8, 13, 18, 23];
        foreach ($arr as $part){
            $id = substr_replace($id, '-', $part, 0);
        }
        return $id;
    }
1310057
private function getUserUuid() {
        if ($this->uuid === null) {

            $path = $this->getRequest()->getUri()->getPath();
            $uuid = substr($path, strrpos($path, '/')+1);
            if (strlen($uuid) === 32 && preg_match('/[a-z0-9]/', $uuid)) {
                $this->uuid = $uuid;
            }
            else {
                throw new \InvalidArgumentException('The uuid cannot be empty.');
            }
        }
        return $this->uuid;
    }
68754
public function get($uuid)
    {
        $model = new static::$model;

        $resource = $model::with($model::$localWith)->where($model->getKeyName(), '=', $uuid)->first();

        if (! $resource) {
            throw new NotFoundHttpException('Resource \'' . class_basename(static::$model) . '\' with given UUID ' . $uuid . ' not found');
        }

        $this->authorizeUserAction('view', $resource);

        return $this->response->item($resource, $this->getTransformer());
    }
631614
protected function makeUnique($uuid): string
    {
        $uniqueUUID = $uuid;
        $iteration = 0;
        while (!$this->validateUUID($uniqueUUID)) {
            $iteration++;
            $uniqueUUID = $this->generateUUID();
        }
        return $uniqueUUID;
    }
174721
public function getCell($uuid)
    {
        $found = null;
        foreach ($this->cells as $cell) {
            if ($cell->getUuid() === $uuid) {
                $found = $cell;
                break;
            }
        }

        return $found;
    }
353162
public function reduce(string $uuid): string
    {
        $dictionaryLength = $this->dictionary->getLength();
        $uuidInt = $this->converter->fromHex($uuid);
        $output = '';

        while ($uuidInt->getValue() > 0) {
            $previousNumber = clone $uuidInt;
            $uuidInt = $uuidInt->divide($dictionaryLength);
            $digit = $previousNumber->mod($dictionaryLength);
            $output .= $this->dictionary->getCharAt((int) $digit->getValue());
        }

        return $output;
    }
1296169
protected function restore($uuid, $scope = null)
    {
        // Get cache instance - at this point all PSR-6 compatibles are allowed
        $cache = $this->getRegistry()->getCache();

        // Check if we use scopes
        if ($cache instanceof Doozr_Cache_Service) {
            /* @var Doozr_Cache_Service $cache */
            $routes = $cache->read(
                $uuid,
                $scope
            );

        } else {
            /* @var CacheItemPoolInterface $cache */
            $routes = $cache->getItem($uuid);

            // Get value out of item
            $routes = $routes->get();
        }

        return $routes;
    }
833265
public static function getSizedImagePath($uuid, $size)
    {
        $container = \System::getContainer();
        $rootDir = $container->getParameter('kernel.project_dir');

        if (!($path = Files::getPathFromUuid($uuid))) {
            return false;
        }

        $size = unserialize($size);

        if (is_array($size))
        {
            if (count($size) < 3)
            {
                return false;
            }
            else
            {
                $size = $size[2];
            }
        }

        return $container->get('contao.image.image_factory')->create(
            $rootDir . '/' . $path, $size
        )->getUrl($rootDir);
    }
862448
public function getByUID($uid)
    {
        return array_filter($this->getComponents(), function ($item) use ($uid) {
            if (!$itemUid = $item->select('UID')) {
                return false;
            }
            $itemUid = current($itemUid)->getValue();

            return $uid === $itemUid;
        });
    }
684215
public function getPassword($uuid)
	{
		if($this->_groups != null)
		{
			foreach($this->_groups as &$group)
			{
				$value = $group->getPassword($uuid);
				if($value != null)
					return $value->getPlainString();
			}
		}
		return null;
	}
1135371
private function getContaoFile($uuid)
    {
        $uuid = StringUtil::deserialize($uuid);

        if (is_array($uuid)) return FilesModel::findMultipleByUuids($uuid);
        return FilesModel::findByUuid($uuid);
    }