/** * Gets the URI clients should use when making retrieve (ie. GET) requests * to the stream. * * @param object $entity The entity instance * associated with the * stream for which a * read stream URI is to * be obtained. * @param ResourceStreamInfo $resourceStreamInfo This will be null * if media resource * is MLE, if media * resource is named * stream then will be * the ResourceStreamInfo * instance holding the * details of named stream. * @param string $mediaLinkEntryUri MLE uri. * * @return string * * @throws InvalidOperationException */ public function getReadStreamUri($entity, $resourceStreamInfo, $mediaLinkEntryUri) { $readStreamUri = null; $this->_saveContentTypeAndETag(); if (is_null($resourceStreamInfo)) { $this->_loadAndValidateStreamProvider(); $readStreamUri = $this->_streamProvider->getReadStreamUri($entity, $this->_service->getOperationContext()); } else { $this->_loadAndValidateStreamProvider2(); $readStreamUri = $this->_streamProvider->getReadStreamUri2($entity, $resourceStreamInfo, $this->_service->getOperationContext()); } $this->_verifyContentTypeOrETagModified('IDSSP::getReadStreamUri'); if (!is_null($readStreamUri)) { try { new \POData\Common\Url($readStreamUri); } catch (\POData\Common\UrlFormatException $ex) { throw new InvalidOperationException(Messages::streamProviderWrapperGetReadStreamUriMustReturnAbsoluteUriOrNull()); } } else { if (is_null($resourceStreamInfo)) { // For MLEs the content src attribute is //required so we cannot return null. $readStreamUri = $this->getDefaultStreamEditMediaUri($mediaLinkEntryUri, null); } } // Note if readStreamUri is null, the self link for the // named stream will be omitted. return $readStreamUri; }