Skip to content

Commit

Permalink
Merge pull request #133 from ekasitk/download-options
Browse files Browse the repository at this point in the history
[rfr] Add swift download options
  • Loading branch information
Jamie Hannaford committed Jul 20, 2017
2 parents 5e20f72 + 999bacf commit 1902104
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ObjectStore/v1/Models/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,19 @@ public function retrieve()
* distinct from fetching its metadata (a `HEAD` request). The body of an object is not fetched by default to
* improve performance when handling large objects.
*
* @param array $data {@see \OpenStack\ObjectStore\v1\Api::getObject}
*
* @return StreamInterface
*/
public function download(): StreamInterface

public function download(array $data = []): StreamInterface
{
$data += ['name' => $this->name, 'containerName' => $this->containerName];

/** @var ResponseInterface $response */
$response = $this->executeWithState($this->api->getObject());
$response = $this->execute($this->api->getObject(), $data);
$this->populateHeaders($response);

return $response->getBody();
}

Expand Down

0 comments on commit 1902104

Please sign in to comment.