Skip to content

Commit

Permalink
Handle region and extra headers/query parameters in low level APIs (m…
Browse files Browse the repository at this point in the history
…inio#992)

Also, fix protected uploadPartCopy()

Public methods in MinioClient does not leave incomplete uploads on
failures. Hence `listIncompleteUploads()` and
`removeIncompleteUploads()` are deprecated and will be removed later.

protected methods `listMultipartUploads()`, `listParts()` and
`abortMultipartUpload()` in MinioClient are available by
inheritance for developers.
  • Loading branch information
balamurugana authored Jul 7, 2020
1 parent e9e9bfd commit 1b115cb
Show file tree
Hide file tree
Showing 15 changed files with 734 additions and 774 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage,
* (C) 2020 MinIO, Inc.
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2020 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 @@ -17,12 +16,19 @@

package io.minio;

public class RemoveIncompleteUploadArgs extends ObjectVersionArgs {
import okhttp3.Headers;

public static Builder builder() {
return new Builder();
/** Response class of MinioClient.abortMultipartUpload(). */
public class AbortMultipartUploadResponse extends GenericResponse {
private String uploadId;

public AbortMultipartUploadResponse(
Headers headers, String bucket, String region, String object, String uploadId) {
super(headers, bucket, region, object);
this.uploadId = uploadId;
}

public static final class Builder
extends ObjectVersionArgs.Builder<Builder, RemoveIncompleteUploadArgs> {}
public String uploadId() {
return uploadId;
}
}
39 changes: 39 additions & 0 deletions api/src/main/java/io/minio/CreateMultipartUploadResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2020 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.InitiateMultipartUploadResult;
import okhttp3.Headers;

/** Response class of MinioClient.createMultipartUpload(). */
public class CreateMultipartUploadResponse extends GenericResponse {
private InitiateMultipartUploadResult result;

public CreateMultipartUploadResponse(
Headers headers,
String bucket,
String region,
String object,
InitiateMultipartUploadResult result) {
super(headers, bucket, region, object);
this.result = result;
}

public InitiateMultipartUploadResult result() {
return result;
}
}
34 changes: 34 additions & 0 deletions api/src/main/java/io/minio/DeleteObjectsResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2020 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.DeleteResult;
import okhttp3.Headers;

/** Response class of MinioClient.listObjectsV1(). */
public class DeleteObjectsResponse extends GenericResponse {
private DeleteResult result;

public DeleteObjectsResponse(Headers headers, String bucket, String region, DeleteResult result) {
super(headers, bucket, region, null);
this.result = result;
}

public DeleteResult result() {
return result;
}
}
93 changes: 0 additions & 93 deletions api/src/main/java/io/minio/ListIncompleteUploadsArgs.java

This file was deleted.

35 changes: 35 additions & 0 deletions api/src/main/java/io/minio/ListMultipartUploadsResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2020 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.ListMultipartUploadsResult;
import okhttp3.Headers;

/** Response class of MinioClient.listMultipartUploads(). */
public class ListMultipartUploadsResponse extends GenericResponse {
private ListMultipartUploadsResult result;

public ListMultipartUploadsResponse(
Headers headers, String bucket, String region, ListMultipartUploadsResult result) {
super(headers, bucket, region, null);
this.result = result;
}

public ListMultipartUploadsResult result() {
return result;
}
}
35 changes: 35 additions & 0 deletions api/src/main/java/io/minio/ListObjectVersionsResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2020 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.ListVersionsResult;
import okhttp3.Headers;

/** Response class of MinioClient.listObjectVersions(). */
public class ListObjectVersionsResponse extends GenericResponse {
private ListVersionsResult result;

public ListObjectVersionsResponse(
Headers headers, String bucket, String region, ListVersionsResult result) {
super(headers, bucket, region, null);
this.result = result;
}

public ListVersionsResult result() {
return result;
}
}
35 changes: 35 additions & 0 deletions api/src/main/java/io/minio/ListObjectsV1Response.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2020 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.ListBucketResultV1;
import okhttp3.Headers;

/** Response class of MinioClient.listObjectsV1(). */
public class ListObjectsV1Response extends GenericResponse {
private ListBucketResultV1 result;

public ListObjectsV1Response(
Headers headers, String bucket, String region, ListBucketResultV1 result) {
super(headers, bucket, region, null);
this.result = result;
}

public ListBucketResultV1 result() {
return result;
}
}
35 changes: 35 additions & 0 deletions api/src/main/java/io/minio/ListObjectsV2Response.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2020 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.ListBucketResultV2;
import okhttp3.Headers;

/** Response class of MinioClient.listObjectsV2(). */
public class ListObjectsV2Response extends GenericResponse {
private ListBucketResultV2 result;

public ListObjectsV2Response(
Headers headers, String bucket, String region, ListBucketResultV2 result) {
super(headers, bucket, region, null);
this.result = result;
}

public ListBucketResultV2 result() {
return result;
}
}
35 changes: 35 additions & 0 deletions api/src/main/java/io/minio/ListPartsResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2020 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.ListPartsResult;
import okhttp3.Headers;

/** Response class of MinioClient.listParts(). */
public class ListPartsResponse extends GenericResponse {
private ListPartsResult result;

public ListPartsResponse(
Headers headers, String bucket, String region, String object, ListPartsResult result) {
super(headers, bucket, region, object);
this.result = result;
}

public ListPartsResult result() {
return result;
}
}
Loading

0 comments on commit 1b115cb

Please sign in to comment.