From 421bacc33ac1625a920e71cbb065894ee39ed930 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Kj=C3=B6lhede?= <hkjolhede@gmail.com>
Date: Sun, 10 Feb 2013 13:11:29 +0100
Subject: [PATCH] Final changes from icewind1991

---
 apps/files_external/lib/sftp.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/apps/files_external/lib/sftp.php b/apps/files_external/lib/sftp.php
index 8a4373132e..551a5a64ef 100644
--- a/apps/files_external/lib/sftp.php
+++ b/apps/files_external/lib/sftp.php
@@ -49,6 +49,10 @@ class SFTP extends \OC\Files\Storage\Common {
 			$host_keys[$this->host] = $current_host_key;
 			$this->write_host_keys($host_keys);
 		}
+		
+		if(!$this->file_exists('')){
+			$this->mkdir('');
+		}
 	}
 	
 	public function test() {
@@ -56,6 +60,10 @@ class SFTP extends \OC\Files\Storage\Common {
 			throw new \Exception("Required parameters not set");
 		}	
 	}
+	
+	public function getId(){
+		return 'sftp::' . $this->user . '@' . $this->host . '/' . $this->root;
+	}
 
 	private function abs_path($path) {
 		return $this->root . $this->cleanPath($path);
-- 
GitLab