You are here

protected function FileImport::isDirectory in Migrate Files (extended) 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/migrate/process/FileImport.php \Drupal\migrate_file\Plugin\migrate\process\FileImport::isDirectory()

Check if a path is a meant to be a directory.

We're using a trailing slash to indicate the path is a directory. This is so that we can create it if it doesn't exist. Without the trailing slash there would be no reliable way to know whether or not the path is meant to be the target filename since files don't technically _have_ to have extensions, and directory names can contain periods.

1 call to FileImport::isDirectory()
FileImport::getDestinationFilePath in src/Plugin/migrate/process/FileImport.php
Build the destination filename.

File

src/Plugin/migrate/process/FileImport.php, line 331

Class

FileImport
Imports a file from an local or external source.

Namespace

Drupal\migrate_file\Plugin\migrate\process

Code

protected function isDirectory($path) {
  return substr($path, -1) == '/';
}