You are here

protected function StreamWrapper::getS3Url in AmazonS3 7.2

Get a regular S3 URL for a key.

Parameters

string $key: The S3 object key.

int $expiry: (optional) Expiry time for the URL, as a Unix timestamp.

array $args: (optional) Array of additional arguments to pass to getObjectUrl().

Return value

\Guzzle\Http\Url An https URL to access the key.

1 call to StreamWrapper::getS3Url()
StreamWrapper::getExternalUrl in src/StreamWrapper.php

File

src/StreamWrapper.php, line 493
Drupal stream wrapper implementation for Amazon S3

Class

StreamWrapper
@file Drupal stream wrapper implementation for Amazon S3

Namespace

Drupal\amazons3

Code

protected function getS3Url($key, $expiry = NULL, array $args = array()) {
  $url = Url::factory(static::$client
    ->getObjectUrl($this->uri
    ->getBucket(), $key, $expiry, $args));
  $this
    ->injectCname($url);
  return $url;
}