summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-06-07 16:59:20 +0200
committerRobin Appelman <robin@icewind.nl>2017-09-18 15:16:27 +0200
commitd5678201b4e9e5babda2cbd553e2bfa12a381cde (patch)
treef1d5679238bc8b082284a46c7aff5ee5b1ee4d17 /apps/files_external/lib
parent4bbc1cdc797974590ed4ec1c77f09eb70f490dc6 (diff)
downloadnextcloud-server-d5678201b4e9e5babda2cbd553e2bfa12a381cde.tar.gz
nextcloud-server-d5678201b4e9e5babda2cbd553e2bfa12a381cde.zip
more efficient is_dir
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index 606a6b0189a..59d8fad5ac8 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -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);