You are here

public function S3fsStream::waitUntilFileExists in S3 File System 8.2

Same name and namespace in other branches
  1. 8.3 src/StreamWrapper/S3fsStream.php \Drupal\s3fs\StreamWrapper\S3fsStream::waitUntilFileExists()
  2. 4.0.x src/StreamWrapper/S3fsStream.php \Drupal\s3fs\StreamWrapper\S3fsStream::waitUntilFileExists()

Wait for the specified file to exist in the bucket.

Parameters

string $uri: The URI of the file.

Return value

bool Returns TRUE once the waiting finishes, or FALSE if the file does not begin to exist within 10 seconds.

2 calls to S3fsStream::waitUntilFileExists()
S3fsStream::rename in src/StreamWrapper/S3fsStream.php
Support for rename().
S3fsStream::writeUriToCache in src/StreamWrapper/S3fsStream.php
Write the file at the given URI into the metadata cache.

File

src/StreamWrapper/S3fsStream.php, line 1116

Class

S3fsStream
Defines a Drupal s3fs (s3fs://) stream wrapper class.

Namespace

Drupal\s3fs\StreamWrapper

Code

public function waitUntilFileExists($uri) {
  $params = $this
    ->_get_params($uri);
  try {
    $this->s3
      ->waitUntil('ObjectExists', $params);
  } catch (\Exception $e) {
    return FALSE;
  }
  return TRUE;
}