-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing fields as per S3 specification (#1618)
Signed-off-by: Bala.FA <bala@minio.io>
- Loading branch information
1 parent
e17ef94
commit 0f533e8
Showing
52 changed files
with
1,074 additions
and
424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/* | ||
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2025 MinIO, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.minio; | ||
|
||
import io.minio.messages.CompleteMultipartUploadResult; | ||
import io.minio.messages.CopyObjectResult; | ||
import okhttp3.Headers; | ||
|
||
/** Response class of any APIs doing object/part upload. */ | ||
public class GenericUploadResponse extends GenericResponse { | ||
private String etag; | ||
private String checksumCRC32; | ||
private String checksumCRC32C; | ||
private String checksumCRC64NVME; | ||
private String checksumSHA1; | ||
private String checksumSHA256; | ||
private String checksumType; | ||
|
||
public GenericUploadResponse( | ||
Headers headers, String bucket, String region, String object, String etag) { | ||
super(headers, bucket, region, object); | ||
this.etag = etag; | ||
if (headers != null) { | ||
this.checksumCRC32 = headers.get("x-amz-checksum-crc32"); | ||
this.checksumCRC32C = headers.get("x-amz-checksum-crc32c"); | ||
this.checksumCRC64NVME = headers.get("x-amz-checksum-crc64nvme"); | ||
this.checksumSHA1 = headers.get("x-amz-checksum-sha1"); | ||
this.checksumSHA256 = headers.get("x-amz-checksum-sha256"); | ||
this.checksumType = headers.get("x-amz-checksum-type"); | ||
} | ||
} | ||
|
||
public GenericUploadResponse( | ||
Headers headers, | ||
String bucket, | ||
String region, | ||
String object, | ||
String etag, | ||
CopyObjectResult result) { | ||
super(headers, bucket, region, object); | ||
this.etag = etag; | ||
if (result != null) { | ||
this.checksumType = result.checksumType(); | ||
this.checksumCRC32 = result.checksumCRC32(); | ||
this.checksumCRC32C = result.checksumCRC32C(); | ||
this.checksumCRC64NVME = result.checksumCRC64NVME(); | ||
this.checksumSHA1 = result.checksumSHA1(); | ||
this.checksumSHA256 = result.checksumSHA256(); | ||
} | ||
} | ||
|
||
public GenericUploadResponse( | ||
Headers headers, | ||
String bucket, | ||
String region, | ||
String object, | ||
String etag, | ||
CompleteMultipartUploadResult result) { | ||
super(headers, bucket, region, object); | ||
this.etag = etag; | ||
if (result != null) { | ||
this.checksumType = result.checksumType(); | ||
this.checksumCRC32 = result.checksumCRC32(); | ||
this.checksumCRC32C = result.checksumCRC32C(); | ||
this.checksumCRC64NVME = result.checksumCRC64NVME(); | ||
this.checksumSHA1 = result.checksumSHA1(); | ||
this.checksumSHA256 = result.checksumSHA256(); | ||
} | ||
} | ||
|
||
public String etag() { | ||
return etag; | ||
} | ||
|
||
public String checksumCRC32() { | ||
return checksumCRC32; | ||
} | ||
|
||
public String checksumCRC32C() { | ||
return checksumCRC32C; | ||
} | ||
|
||
public String checksumCRC64NVME() { | ||
return checksumCRC64NVME; | ||
} | ||
|
||
public String checksumSHA1() { | ||
return checksumSHA1; | ||
} | ||
|
||
public String checksumSHA256() { | ||
return checksumSHA256; | ||
} | ||
|
||
public String checksumType() { | ||
return checksumType; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2025 MinIO, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.minio; | ||
|
||
import io.minio.messages.ListAllMyBucketsResult; | ||
import okhttp3.Headers; | ||
|
||
/** Response class of {@link S3Base#listBucketsAsync}. */ | ||
public class ListBucketsResponse extends GenericResponse { | ||
private ListAllMyBucketsResult result; | ||
|
||
public ListBucketsResponse(Headers headers, ListAllMyBucketsResult result) { | ||
super(headers, null, null, null); | ||
this.result = result; | ||
} | ||
|
||
public ListAllMyBucketsResult result() { | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.