diff options
author | Robin Appelman <robin@icewind.nl> | 2017-06-07 16:59:20 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-10-03 14:11:09 +0200 |
commit | e42b950521d2d4a2e9d6fc98970f611e4070bb78 (patch) | |
tree | ab274e5874b1b918d755e99002deea9a9ea4c7d8 /apps/files_external | |
parent | a0848ba202c75c4635badfa38223b3587f1db119 (diff) | |
download | nextcloud-server-e42b950521d2d4a2e9d6fc98970f611e4070bb78.tar.gz nextcloud-server-e42b950521d2d4a2e9d6fc98970f611e4070bb78.zip |
more efficient is_dir
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/AmazonS3.php | 10 |
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); |