Determines whether a path exists or not.
(self, filename)
| 237 | return bucket, path |
| 238 | |
| 239 | def exists(self, filename): |
| 240 | """Determines whether a path exists or not.""" |
| 241 | client = boto3.client("s3", endpoint_url=self._s3_endpoint) |
| 242 | bucket, path = self.bucket_and_path(filename) |
| 243 | r = client.list_objects(Bucket=bucket, Prefix=path, Delimiter="/") |
| 244 | if r.get("Contents") or r.get("CommonPrefixes"): |
| 245 | return True |
| 246 | return False |
| 247 | |
| 248 | def join(self, path, *paths): |
| 249 | """Join paths with a slash.""" |