Deletes the storage data related to the given PersistentResource object

@param PersistentResource $resource The PersistentResource to delete the storage data of
@return bool TRUE if removal was successful
@throws \Exception
@api
514966
public function deleteResource(PersistentResource $resource)
    {
        try {
            $this->getCurrentBucket()->object($this->keyPrefix . $resource->getSha1())->delete();
        } catch (NotFoundException $e) {
            return true;
        }

        return true;
    }
583049
public function apply($resource){
		@list(,$method)=func_get_args();
		switch($method){
			case self::FILTER:
				if(!function_exists('imagefilter')){
					throw new Exception("It seems your PHP version is not compiled with the bundled version of the GD library, therefore you cannot use this graphic effect");
				}
				if(!imagefilter($resource,IMG_FILTER_MEAN_REMOVAL)){
					throw new Exception("MEAN_REMOVAL filter failed");
				}
				return $resource;
			case self::MATRIX:
			default:
				return parent::apply(func_get_arg(0),array(0,-1,0,-1,5,-1,0,-1,0));
		}
	}
229779
static public function createFromResource($resource) {
		if (!is_resource($resource))
			throw new Exception('Invalid (resource) parameter! This is not a resource!');
		if (get_resource_type($resource) != 'gd')
			throw new Exception('Invalid (resource) parameter! Resource is not a gd resource!');
		return new self($resource);
	}
338728
function remove($resource)
    {
        $rid = spl_object_hash($resource);
        if (!isset($this->resourcePool[$rid]))
        {
            return false;
        }
        //从resourcePool中删除
        unset($this->resourcePool[$rid]);
        $this->resourceNum--;
        return true;
    }
1305102
public function hash($resource)
    {
        rewind($resource);
        $context = hash_init($this->algo);
        hash_update_stream($context, $resource);
        fclose($resource);

        return hash_final($context);
    }
1015861
public function deleteAction( $resource, $related )
	{
		$response = $this->createClient( $resource, $related )->delete( $this->getPsrRequest(), new Response() );
		return $this->setPsrResponse( $response );
	}
1093262
public function drop($key) {
        $fileName = $this->getFilePath($key);

        if (is_file($fileName)) {
            if (unlink($fileName)) {
                clearstatcache();

                $this->getReferencePool()->drop($key);
                return true;
            }
            throw new RuntimeException('Cannot delete file: '.$fileName);
        }

        return false;
    }
1333228
public function remove($resource)
    {
        $resourceName = $this->getResourceName($resource);
        $index = array_search($resourceName, $this->indexes, true);

        if (false !== $index) {
            unset($this->indexes[$index]);
            unset($this->resources[$resourceName]);

            return true;
        }

        return false;
    }
616744
function delete($resource, $headers = array())
    {
        $result = $this->client->delete($this->build_url($resource), [
            'headers' => array_merge([
                'Authorization' => $this->getBearer()
            ], $headers)
        ]);
        return $result;
    }
341392
public function resourceExists($resource)
    {
        $resources = $this->getAvailableResources();
        foreach ($resources as $res) {
            if ($res->slug == $resource) {
                return true;
            }
        }
        return false;
    }
84122
public function isLocked($resource = null): bool
    {
        return $this->hasSharedLock($resource) || $this->hasExclusiveLock($resource);
    }
776679
protected function rewindStream($resource)
    {
        if (! Assert::resource($resource)) {
            throw new InvalidArgumentException(
                sprintf(
                    '%s::%s() parameter 1 must be "resource"',
                    __CLASS__,
                    __METHOD__
                )
            );
        }

        if (ftell($resource) !== 0 && $this->isSeekableStream($resource)) {
            rewind($resource);
        }
    }
15653
public function isAllowed($resource = null, $privilege = null)
    {
        if (is_array($privilege)) {
            foreach ($privilege as $privilegeSingular) {
                if ($this->isAllowed($resource, $privilegeSingular)) {
                    return true;
                }
            }
            return false;
        }
        try {
            $result = $this->getContextualAcl()->isAllowed($this->getContextId(), $resource, $privilege);
        } catch (InvalidArgumentException $e) {
            return false;
        }
        return $result;
    }
791954
public function getPublicPersistentResourceUri(PersistentResource $resource)
    {
        if ($this->baseUri != '') {
            return $this->baseUri . $this->encodeRelativePathAndFilenameForUri($this->getRelativePublicationPathAndFilename($resource));
        } else {
            return $this->s3Client->getObjectUrl($this->bucketName, $this->keyPrefix . $this->getRelativePublicationPathAndFilename($resource));
        }
    }
99167
public function delete($permanently = false)
	{
		$response = $this->client->send(new Request($this->uri->withPath($this->uri->getPath().'resources')
			->withQuery(http_build_query([
				'path'        => $this->getPath(),
				'permanently' => (bool) $permanently
			])), 'DELETE'));

		if ($response->getStatusCode() == 202 || $response->getStatusCode() == 204)
		{
			$this->setContents([]);

			$this->emit('delete', $this, $this->client);
			$this->client->emit('delete', $this, $this->client);

			if ($response->getStatusCode() == 202)
			{
				$response = json_decode($response->getBody(), true);

				if (isset($response['operation']))
				{
					$response['operation'] = $this->client->getOperation($response['operation']);
					$this->emit('operation', $response['operation'], $this, $this->client);
					$this->client->emit('operation', $response['operation'], $this, $this->client);

					return $response['operation'];
				}
			}

			try
			{
				/*$resource = $this->client->getTrashResource('/', 0);
				$resource = $this->client->getTrashResources(1, $resource->get('total', 0) - 1)->getFirst();

				if ($resource->has() && $resource->get('origin_path') == $this->getPath())
				{
					return $resource;
				}*/
			}
			catch (\Exception $exc)
			{

			}

			return true;
		}

		return false;
	}
927325
public function deleteAction(Storage $storage)
    {
        $em = $this->getDoctrine()->getManager();
        $em->remove($storage);
        $em->flush();

        return $this->redirect($this->generateUrl('storage_list'));
    }
865551
public function removeSecondaryResource(ResourceNode $resource)
    {
        if ($this->secondaryResources->contains($resource)) {
            $this->secondaryResources->removeElement($resource);
        }

        return $this;
    }