diff --git a/lib/StorjObjectStore.php b/lib/StorjObjectStore.php index c8f8a0f..fe08f36 100644 --- a/lib/StorjObjectStore.php +++ b/lib/StorjObjectStore.php @@ -70,7 +70,7 @@ public function objectExists($urn): bool $this->logger->debug('Storj::objectExists("{urn}")', ['urn' => $urn]); try { - $this->project->downloadObject($this->bucket, $urn); + $this->project->statObject($this->bucket, $urn); return true; } catch (ObjectNotFound $e) { return false; diff --git a/lib/StorjStorage.php b/lib/StorjStorage.php index 0733847..844478f 100644 --- a/lib/StorjStorage.php +++ b/lib/StorjStorage.php @@ -193,8 +193,7 @@ public function stat($path) if ($objectInfo === null) { try { - $download = $this->project->downloadObject($this->bucket, $path); - $objectInfo = $download->info(); + $objectInfo = $this->project->statObject($this->bucket, $path); $this->objectInfoCache->set($path, $objectInfo); } catch (UplinkException $e) { $this->logger->error( @@ -239,9 +238,7 @@ public function filetype($path) if ($objectInfo === null) { try { - $objectInfo = $this->project - ->downloadObject($this->bucket, $path) - ->info(); + $objectInfo = $this->project->statObject($this->bucket, $path); } catch (ObjectNotFound $e) { // its not an object, check if it's a prefix $objects = $this->project->listObjects($this->bucket, (new ListObjectsOptions())