protected function sftpCreateDirectory(): FunctionsInterface
    {
        /* the directory structure on remote host must exist to SFTP */
        if (true === $this->get('_createRemoteDirectory')) {
            (file_exists($this->get('_localCacheFilePath')) && $this->get('_localFileSize') > 0)
                ? $this->get('_sftp')->deleteDirectory($this->get('_remoteDirectoryPath'), true)->createDirectory($this->get('_remoteDirectoryPath'))
                : $this->get('_sftp')->deleteDirectory($this->get('_remoteDirectoryPath'), true);
        }

        return $this;
    }