more efficient is_dir

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman
2017-06-07 16:59:20 +02:00
parent 4bbc1cdc79
commit d5678201b4

View File

@@ -287,6 +287,16 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
}
public function is_dir($path) {
$path = $this->normalizePath($path);
try {
return $this->isRoot($path) || $this->getConnection()->doesObjectExist($this->bucket, $path . '/');
} catch (S3Exception $e) {
\OCP\Util::logException('files_external', $e);
return false;
}
}
public function filetype($path) {
$path = $this->normalizePath($path);