Skip to content

Commit

Permalink
Fix List of S3 bucket for custom endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
pditommaso committed Sep 18, 2023
1 parent 29ab2f2 commit 4327fa5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,11 @@ public <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type
"path must be an instance of %s", S3Path.class.getName());
S3Path s3Path = (S3Path) path;
if (type.isAssignableFrom(BasicFileAttributes.class)) {
return (A) readAttr0(s3Path);
return (A) ("".equals(s3Path.getKey())
// the root bucket is implicitly a directory
? new S3FileAttributes("/", null, 0, true, false)
// read the target path attributes
: readAttr0(s3Path));
}
// not support attribute class
throw new UnsupportedOperationException(format("only %s supported", BasicFileAttributes.class));
Expand Down

0 comments on commit 4327fa5

Please sign in to comment.