You are here

public function S3::getExternalUrl in Flysystem - S3 2.0.x

Same name and namespace in other branches
  1. 8 src/Flysystem/S3.php \Drupal\flysystem_s3\Flysystem\S3::getExternalUrl()

File

src/Flysystem/S3.php, line 190

Class

S3
Drupal plugin for the "S3" Flysystem adapter.

Namespace

Drupal\flysystem_s3\Flysystem

Code

public function getExternalUrl($uri) {
  if ($this->isPublic === FALSE) {
    return $this
      ->getDownloadlUrl($uri);
  }
  $target = $this
    ->getTarget($uri);
  if (strpos($target, 'styles/') === 0 && !file_exists($uri)) {
    $this
      ->generateImageStyle($target);
  }
  return $this->urlPrefix . '/' . UrlHelper::encodePath($target);
}