Skip to content

Commit

Permalink
commonPrefixes is only for delimiter request
Browse files Browse the repository at this point in the history
  • Loading branch information
jixinchi committed Oct 25, 2023
1 parent 60f8366 commit 5900be7
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/main/java/org/gaul/s3proxy/S3ProxyHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -1506,8 +1506,11 @@ private void handleBlobList(HttpServletRequest request,
case FOLDER:
// fallthrough
case RELATIVE_PATH:
commonPrefixes.add(metadata.getName());
continue;
if (delimiter != null) {
commonPrefixes.add(metadata.getName());
continue;
}
break;
default:
break;
}
Expand All @@ -1528,10 +1531,15 @@ private void handleBlobList(HttpServletRequest request,
writeSimpleElement(xml, "ETag", maybeQuoteETag(eTag));
}

writeSimpleElement(xml, "Size",
String.valueOf(metadata.getSize()));
writeSimpleElement(xml, "StorageClass",
StorageClass.fromTier(metadata.getTier()).toString());
Long size = metadata.getSize();
if (size != null) {
writeSimpleElement(xml, "Size", String.valueOf(size));
}

Tier tier = metadata.getTier();
if (tier != null) {
writeSimpleElement(xml, "StorageClass", StorageClass.fromTier(tier).toString());
}

if (fetchOwner) {
writeOwnerStanza(xml);
Expand Down

0 comments on commit 5900be7

Please sign in to comment.