/**
  * Imports a resource (file) from the given URI or PHP resource stream into this collection.
  *
  * On a successful import this method returns a PersistentResource object representing the newly
  * imported persistent resource.
  *
  * Note that this collection must have a writable storage in order to import resources.
  *
  * @param string | resource $source The URI (or local path and filename) or the PHP resource stream to import the resource from
  * @return PersistentResource A resource object representing the imported resource
  * @throws ResourceException
  */
 public function importResource($source)
 {
     if (!$this->storage instanceof WritableStorageInterface) {
         throw new ResourceException(sprintf('Could not import resource into collection "%s" because its storage "%s" is a read-only storage.', $this->name, $this->storage->getName()), 1375197288);
     }
     return $this->storage->importResource($source, $this->name);
 }