Neos\Flow\ResourceManagement\Storage\WritableFileSystemStorage::moveTemporaryFileToFinalDestination PHP Method

moveTemporaryFileToFinalDestination() protected method

Move a temporary file to the final destination, creating missing path segments on the way.
protected moveTemporaryFileToFinalDestination ( string $temporaryFile, string $finalTargetPathAndFilename ) : void
$temporaryFile string
$finalTargetPathAndFilename string
return void
    protected function moveTemporaryFileToFinalDestination($temporaryFile, $finalTargetPathAndFilename)
    {
        if (!file_exists(dirname($finalTargetPathAndFilename))) {
            Files::createDirectoryRecursively(dirname($finalTargetPathAndFilename));
        }
        if (copy($temporaryFile, $finalTargetPathAndFilename) === false) {
            throw new StorageException(sprintf('The temporary file of the file import could not be moved to the final target "%s".', $finalTargetPathAndFilename), 1381156103);
        }
        unlink($temporaryFile);
        $this->fixFilePermissions($finalTargetPathAndFilename);
    }