Skip to content

Commit

Permalink
Revert "ListObjects(): fix parsing user metadata as per MinIO server (m…
Browse files Browse the repository at this point in the history
…inio#1369)"

This reverts commit f909b02.

Fixes minio#1436

Signed-off-by: Bala.FA <[email protected]>
  • Loading branch information
balamurugana committed Apr 6, 2023
1 parent 503cb9e commit 694bdda
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions api/src/main/java/io/minio/messages/Item.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2015-2022 MinIO, Inc.
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2015-2021 MinIO, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,12 +20,8 @@
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.time.ZonedDateTime;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementMap;
import org.simpleframework.xml.Path;

/**
* Helper class to denote Object information in {@link ListBucketResultV1}, {@link
Expand Down Expand Up @@ -58,15 +54,8 @@ public abstract class Item {
@Element(name = "VersionId", required = false)
private String versionId; // except ListObjects V1

@Path(value = "UserMetadata")
@ElementMap(
attribute = false,
entry = "Items",
inline = true,
key = "Key",
value = "Value",
required = false)
private Map<String, String> userMetadata;
@Element(name = "UserMetadata", required = false)
private Metadata userMetadata;

private boolean isDir = false;
private String encodingType = null;
Expand Down Expand Up @@ -119,7 +108,7 @@ public Owner owner() {

/** Returns user metadata. This is MinIO specific extension to ListObjectsV2. */
public Map<String, String> userMetadata() {
return Collections.unmodifiableMap(userMetadata == null ? new HashMap<>() : userMetadata);
return (userMetadata == null) ? null : userMetadata.get();
}

/** Returns whether this version ID is latest. */
Expand Down

0 comments on commit 694bdda

Please sign in to comment.