public function deleteContainer($name) {
    $url = $this->url() . '/' . rawurlencode($name);

    try {
      $data = $this->req($url, 'DELETE', FALSE);
    }
    catch (\HPCloud\Transport\FileNotFoundException $e) {
      return FALSE;
    }
    // XXX: I'm not terribly sure about this. Why not just throw the
    // ConflictException?
    catch (\HPCloud\Transport\ConflictException $e) {
      throw new ObjectStorage\ContainerNotEmptyException("Non-empty container cannot be deleted.");
    }

    $status = $data->status();

    // 204 indicates that the container has been deleted.
    if ($status == 204) {
      return TRUE;
    }
    // OpenStacks documentation doesn't suggest any other return
    // codes.
    else {
      throw new \HPCloud\Exception('Server returned unexpected code: ' . $status);
    }
  }
public function deleteContainer($name) {
    $url = $this->url() . '/' . rawurlencode($name);

    try {
      $data = $this->req($url, 'DELETE', FALSE);
    }
    catch (\HPCloud\Transport\FileNotFoundException $e) {
      return FALSE;
    }
    // XXX: I'm not terribly sure about this. Why not just throw the
    // ConflictException?
    catch (\HPCloud\Transport\ConflictException $e) {
      throw new ObjectStorage\ContainerNotEmptyException("Non-empty container cannot be deleted.");
    }

    $status = $data->status();

    // 204 indicates that the container has been deleted.
    if ($status == 204) {
      return TRUE;
    }
    // OpenStacks documentation doesn't suggest any other return
    // codes.
    else {
      throw new \HPCloud\Exception('Server returned unexpected code: ' . $status);
    }
  }
public function deleteContainer ( $ name ) { $ url = $ this -> url ( ) . '/' . rawurlencode ( $ name ) ; try { $ data = $ this -> req ( $ url , 'DELETE' , FALSE ) ; } catch ( \ HPCloud \ Transport \ FileNotFoundException $ e ) { return FALSE ; } // XXX: I'm not terribly sure about this. Why not just throw the // ConflictException? catch ( \ HPCloud \ Transport \ ConflictException $ e ) { throw new ObjectStorage \ ContainerNotEmptyException ( "Non-empty container cannot be deleted." ) ; } $ status = $ data -> status ( ) ; // 204 indicates that the container has been deleted. if ( $ status == 204 ) { return TRUE ; } // OpenStacks documentation doesn't suggest any other return // codes. else { throw new \ HPCloud \ Exception ( 'Server returned unexpected code: ' . $ status ) ; } }
Delete an empty container.

Given a container name, this attempts to delete the container in
the object storage.

The container MUST be empty before it can be deleted. If it is not,
an HPCloud::Storage::ObjectStorage::ContainerNotEmptyException will
be thrown.

@param string $name
The name of the container.
@retval boolean
@return boolean
TRUE if the container was deleted, FALSE if the container was not
found (and hence, was not deleted).
@throws HPCloud::Storage::ObjectStorage::ContainerNotEmptyException
if the container is not empty.
@throws HPCloud::Exception if an unexpected response code is returned.
While this should never happen on HPCloud servers, forks of
OpenStack may choose to extend object storage in a way that
results in a non-standard code.
Delete an empty container .