/**
  * Publishes the whole collection to this target
  *
  * @param \TYPO3\Flow\Resource\Collection $collection The collection to publish
  * @return void
  */
 public function publishCollection(Collection $collection)
 {
     $storage = $collection->getStorage();
     if ($storage instanceof PackageStorage) {
         foreach ($storage->getPublicResourcePaths() as $packageKey => $path) {
             $this->publishDirectory($path, $packageKey);
         }
     } else {
         parent::publishCollection($collection);
     }
 }
 /**
  * Publishes the whole collection to this target
  *
  * @param CollectionInterface $collection The collection to publish
  * @param callable $callback Function called after each resource publishing
  * @return void
  */
 public function publishCollection(CollectionInterface $collection, callable $callback = null)
 {
     $storage = $collection->getStorage();
     if ($storage instanceof PackageStorage) {
         foreach ($storage->getPublicResourcePaths() as $packageKey => $path) {
             $this->publishDirectory($path, $packageKey);
         }
     } else {
         parent::publishCollection($collection, $callback);
     }
 }