From 08b465d219070260d91f832bab291f0670745af9 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 1 Mar 2026 12:45:01 -0500 Subject: [PATCH 1/2] refactor(files_external/S3): drop unused methods getContentLength() and getLastModified() are dead code. Originally added in PR #11518 and made defunct in PR #29220. Signed-off-by: Josh --- .../lib/Lib/Storage/AmazonS3.php | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index 4da56c9527d9b..d32ee0f05a341 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -321,44 +321,6 @@ public function stat(string $path): array|false { return $stat; } - /** - * Return content length for object - * - * When the information is already present (e.g. opendir has been called before) - * this value is return. Otherwise a headObject is emitted. - */ - private function getContentLength(string $path): int { - if (isset($this->filesCache[$path])) { - return (int)$this->filesCache[$path]['ContentLength']; - } - - $result = $this->headObject($path); - if (isset($result['ContentLength'])) { - return (int)$result['ContentLength']; - } - - return 0; - } - - /** - * Return last modified for object - * - * When the information is already present (e.g. opendir has been called before) - * this value is return. Otherwise a headObject is emitted. - */ - private function getLastModified(string $path): string { - if (isset($this->filesCache[$path])) { - return $this->filesCache[$path]['LastModified']; - } - - $result = $this->headObject($path); - if (isset($result['LastModified'])) { - return $result['LastModified']; - } - - return 'now'; - } - public function is_dir(string $path): bool { $path = $this->normalizePath($path); From bde043d13bff123e9c72ed7ff43e5651e9d5e9a4 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 1 Mar 2026 12:53:57 -0500 Subject: [PATCH 2/2] chore(files_external/s3): drop no-op $this->filesCache use sites Signed-off-by: Josh --- apps/files_external/lib/Lib/Storage/AmazonS3.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index d32ee0f05a341..c0ad6b73bd955 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -324,10 +324,6 @@ public function stat(string $path): array|false { public function is_dir(string $path): bool { $path = $this->normalizePath($path); - if (isset($this->filesCache[$path])) { - return false; - } - try { return $this->doesDirectoryExist($path); } catch (S3Exception $e) { @@ -350,7 +346,7 @@ public function filetype(string $path): string|false { if (isset($this->directoryCache[$path]) && $this->directoryCache[$path]) { return 'dir'; } - if (isset($this->filesCache[$path]) || $this->headObject($path)) { + if ($this->headObject($path)) { return 'file'; } if ($this->doesDirectoryExist($path)) {