/**
  * @inheritdoc
  */
 public function deleteFile(ResourceObjectInterface $resource)
 {
     $path = $this->getLocationConfig('path', $resource->getLocation(), $this->config);
     if ($resource->getRelativePath()) {
         $path .= $resource->getRelativePath();
     }
     $oldFile = $path . DIRECTORY_SEPARATOR . $resource->getName();
     $this->fileSystem->remove($oldFile);
     return !$this->fileSystem->exists($oldFile);
 }
 /**
  * loadResource
  *
  * @param ResourceObjectInterface $resource
  *
  * @throws \Exception
  */
 protected function loadResource(ResourceObjectInterface $resource)
 {
     $resolverName = $this->getLocationConfig('resolver', $resource->getLocation(), $this->config);
     $resolver = $this->resolverManager->get($resolverName);
     $resolver->setConfig($this->config);
     $resource->setFile($resolver->getFile($resource));
     $resource->setUrl($resolver->getUrl($resource));
 }