public function getPublicPersistentResourceUriByHash($resourceHash, $collectionName = self::DEFAULT_PERSISTENT_COLLECTION_NAME)
    {
        $this->initialize();

        if (!isset($this->collections[$collectionName])) {
            throw new Exception(sprintf('Could not determine persistent resource URI for "%s" because the specified collection "%s" does not exist.', $resourceHash, $collectionName), 1375197875);
        }
        /** @var TargetInterface $target */
        $target = $this->collections[$collectionName]->getTarget();
        $resource = $this->resourceRepository->findOneBySha1($resourceHash);
        if ($resource === null) {
            throw new Exception(sprintf('Could not determine persistent resource URI for "%s" because no PersistentResource object with that SHA1 hash could be found.', $resourceHash), 1375347691);
        }

        return $target->getPublicPersistentResourceUri($resource);
    }
public function getPublicPersistentResourceUriByHash($resourceHash, $collectionName = self::DEFAULT_PERSISTENT_COLLECTION_NAME)
    {
        $this->initialize();

        if (!isset($this->collections[$collectionName])) {
            throw new Exception(sprintf('Could not determine persistent resource URI for "%s" because the specified collection "%s" does not exist.', $resourceHash, $collectionName), 1375197875);
        }
        /** @var TargetInterface $target */
        $target = $this->collections[$collectionName]->getTarget();
        $resource = $this->resourceRepository->findOneBySha1($resourceHash);
        if ($resource === null) {
            throw new Exception(sprintf('Could not determine persistent resource URI for "%s" because no PersistentResource object with that SHA1 hash could be found.', $resourceHash), 1375347691);
        }

        return $target->getPublicPersistentResourceUri($resource);
    }
public function getPublicPersistentResourceUriByHash ( $ resourceHash , $ collectionName = self :: DEFAULT_PERSISTENT_COLLECTION_NAME ) { $ this -> initialize ( ) ; if ( ! isset ( $ this -> collections [ $ collectionName ] ) ) { throw new Exception ( sprintf ( 'Could not determine persistent resource URI for "%s" because the specified collection "%s" does not exist.' , $ resourceHash , $ collectionName ) , 1375197875 ) ; } /** @var TargetInterface $target */ $ target = $ this -> collections [ $ collectionName ] -> getTarget ( ) ; $ resource = $ this -> resourceRepository -> findOneBySha1 ( $ resourceHash ) ; if ( $ resource === null ) { throw new Exception ( sprintf ( 'Could not determine persistent resource URI for "%s" because no PersistentResource object with that SHA1 hash could be found.' , $ resourceHash ) , 1375347691 ) ; } return $ target -> getPublicPersistentResourceUri ( $ resource ) ; }
Returns the web accessible URI for the resource object specified by the
given SHA1 hash.

@param string $resourceHash The SHA1 hash identifying the resource content
@param string $collectionName Name of the collection the resource is part of
@return string A URI as a string
@throws Exception
@api
Returns the web accessible URI for the resource object specified by the given SHA1 hash .