/**
* Publishes the given persistent resource from the given storage
*
* @param PersistentResource $resource The resource to publish
* @param CollectionInterface $collection The collection the given resource belongs to
* @return void
*/
public function publishResource(PersistentResource $resource, CollectionInterface $collection)
{
$sourceStream = $resource->getStream();
if ($sourceStream === false) {
$this->handleMissingData($resource, $collection);
return;
}
$this->publishFile($sourceStream, $this->getRelativePublicationPathAndFilename($resource));
fclose($sourceStream);
}