Returns whether the path is a directory or not.
(self, dirname)
| 365 | return keys |
| 366 | |
| 367 | def isdir(self, dirname): |
| 368 | """Returns whether the path is a directory or not.""" |
| 369 | client = boto3.client("s3", endpoint_url=self._s3_endpoint) |
| 370 | bucket, path = self.bucket_and_path(dirname) |
| 371 | if not path.endswith("/"): |
| 372 | path += "/" # This will now only retrieve subdir content |
| 373 | r = client.list_objects(Bucket=bucket, Prefix=path, Delimiter="/") |
| 374 | if r.get("Contents") or r.get("CommonPrefixes"): |
| 375 | return True |
| 376 | return False |
| 377 | |
| 378 | def listdir(self, dirname): |
| 379 | """Returns a list of entries contained within a directory.""" |