You are here

public function S3fsFileService::createFilename in S3 File System 4.0.x

Same name and namespace in other branches
  1. 8.3 src/S3fsFileService.php \Drupal\s3fs\S3fsFileService::createFilename()

Creates a full file path from a directory and filename.

If a file with the specified name already exists, an alternative will be used.

Parameters

string $basename: The filename.

string $directory: The directory or parent URI.

Return value

string File path consisting of $directory and a unique filename based off of $basename.

Throws

\Drupal\Core\File\Exception\FileException Implementation may throw FileException or its subtype on failure.

Overrides FileSystemInterface::createFilename

File

src/S3fsFileService.php, line 428

Class

S3fsFileService
Provides helpers to operate on files and stream wrappers.

Namespace

Drupal\s3fs

Code

public function createFilename($basename, $directory) {
  return $this->decorated
    ->createFilename($basename, $directory);
}