Skip to content

Commit 94a37bf

Browse files
storage-class is valid for deleteMarker on MinIO (#1161)
1 parent 2694701 commit 94a37bf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

api/src/main/java/io/minio/messages/Item.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2015 MinIO, Inc.
2+
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2015-2021 MinIO, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@ public abstract class Item {
4646
private long size; // except DeleteMarker
4747

4848
@Element(name = "StorageClass", required = false)
49-
private String storageClass; // except DeleteMarker
49+
private String storageClass; // except DeleteMarker, not in case of MinIO server.
5050

5151
@Element(name = "IsLatest", required = false)
5252
private boolean isLatest; // except ListObjects V1
@@ -128,6 +128,6 @@ public boolean isDir() {
128128

129129
/** Returns whether this item is a delete marker or not. */
130130
public boolean isDeleteMarker() {
131-
return (etag == null && size == 0 && storageClass == null && versionId != null);
131+
return this instanceof DeleteMarker;
132132
}
133133
}

0 commit comments

Comments
 (0)