/** * Downloads a file to $this->localDir * * @author Art <*****@*****.**> * @see self::$localDir * * @param string $file Remote file name * * @throws SE When the file cannot be fetched * @throws FE When the name is invalid * @return SFTP */ function downloadFile($file) { \Log::debug('Downloading file ' . $file . ' to ' . $this->localDir); $fetch = $this->getFileContents($file); $local = new File(); $local->dir($this->localDir)->name($file); $local->content($fetch)->write(); return $this; }