Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 1 addition & 43 deletions apps/files_external/lib/Lib/Storage/AmazonS3.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,51 +321,9 @@ 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);

if (isset($this->filesCache[$path])) {
return false;
}

try {
return $this->doesDirectoryExist($path);
} catch (S3Exception $e) {
Expand All @@ -388,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)) {
Expand Down
Loading