Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.storage;

import com.google.api.core.BetaApi;
import com.google.api.core.InternalExtensionOnly;
import com.google.cloud.storage.multipartupload.model.AbortMultipartUploadRequest;
import com.google.cloud.storage.multipartupload.model.AbortMultipartUploadResponse;
Expand All @@ -38,9 +37,8 @@
* low-level interface for creating and managing multipart uploads.
*
* @see <a href="https://cloud.google.com/storage/docs/multipart-uploads">Multipart Uploads</a>
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
@InternalExtensionOnly
public abstract class MultipartUploadClient {

Expand All @@ -51,9 +49,8 @@ public abstract class MultipartUploadClient {
*
* @param request The request object containing the details for creating the multipart upload.
* @return A {@link CreateMultipartUploadResponse} object containing the upload ID.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public abstract CreateMultipartUploadResponse createMultipartUpload(
CreateMultipartUploadRequest request);

Expand All @@ -62,19 +59,17 @@ public abstract CreateMultipartUploadResponse createMultipartUpload(
*
* @param listPartsRequest The request object containing the details for listing the parts.
* @return A {@link ListPartsResponse} object containing the list of parts.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public abstract ListPartsResponse listParts(ListPartsRequest listPartsRequest);

/**
* Aborts a multipart upload.
*
* @param request The request object containing the details for aborting the multipart upload.
* @return An {@link AbortMultipartUploadResponse} object.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public abstract AbortMultipartUploadResponse abortMultipartUpload(
AbortMultipartUploadRequest request);

Expand All @@ -84,9 +79,8 @@ public abstract AbortMultipartUploadResponse abortMultipartUpload(
* @param request The request object containing the details for completing the multipart upload.
* @return A {@link CompleteMultipartUploadResponse} object containing information about the
* completed upload.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public abstract CompleteMultipartUploadResponse completeMultipartUpload(
CompleteMultipartUploadRequest request);

Expand All @@ -96,19 +90,17 @@ public abstract CompleteMultipartUploadResponse completeMultipartUpload(
* @param request The request object containing the details for uploading the part.
* @param requestBody The content of the part to upload.
* @return An {@link UploadPartResponse} object containing the ETag of the uploaded part.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public abstract UploadPartResponse uploadPart(UploadPartRequest request, RequestBody requestBody);

/**
* Lists all multipart uploads in a bucket.
*
* @param request The request object containing the details for listing the multipart uploads.
* @return A {@link ListMultipartUploadsResponse} object containing the list of multipart uploads.
* @since 2.61.0 This new api is in preview and is subject to breaking changes.
* @since 2.61.0
*/
@BetaApi
public abstract ListMultipartUploadsResponse listMultipartUploads(
ListMultipartUploadsRequest request);

Expand All @@ -117,9 +109,8 @@ public abstract ListMultipartUploadsResponse listMultipartUploads(
*
* @param config The configuration for the client.
* @return A new {@link MultipartUploadClient} instance.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public static MultipartUploadClient create(MultipartUploadSettings config) {
HttpStorageOptions options = config.getOptions();
return new MultipartUploadClientImpl(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@
*/
package com.google.cloud.storage;

import com.google.api.core.BetaApi;

/**
* Settings for configuring the {@link MultipartUploadClient}.
*
* <p>This class is for internal use only and is not intended for public consumption.
*/
@BetaApi
public final class MultipartUploadSettings {
private final HttpStorageOptions options;

Expand All @@ -35,7 +32,6 @@ private MultipartUploadSettings(HttpStorageOptions options) {
*
* @return The {@link HttpStorageOptions}.
*/
@BetaApi
public HttpStorageOptions getOptions() {
return options;
}
Expand All @@ -47,7 +43,6 @@ public HttpStorageOptions getOptions() {
* @param options The {@link HttpStorageOptions} to use.
* @return A new {@code MultipartUploadSettings} instance.
*/
@BetaApi
public static MultipartUploadSettings of(HttpStorageOptions options) {
return new MultipartUploadSettings(options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.storage;

import com.google.api.core.BetaApi;
import com.google.api.core.InternalExtensionOnly;
import java.io.IOException;
import java.nio.ByteBuffer;
Expand All @@ -30,7 +29,6 @@
* @see <a
* href="https://cloud.google.com/storage/docs/multipart-uploads#upload_parts">https://cloud.google.com/storage/docs/multipart-uploads#upload_parts</a>
*/
@BetaApi
@InternalExtensionOnly
public final class RequestBody {

Expand All @@ -45,25 +43,21 @@ RewindableContent getContent() {
}

/** Create a new empty RequestBody. */
@BetaApi
public static RequestBody empty() {
return new RequestBody(RewindableContent.empty());
}

/** Create a new RequestBody from the given {@link ByteBuffer}s. */
@BetaApi
public static RequestBody of(ByteBuffer... buffers) {
return new RequestBody(RewindableContent.of(buffers));
}

/** Create a new RequestBody from the given {@link ByteBuffer}s. */
@BetaApi
public static RequestBody of(ByteBuffer[] srcs, int srcsOffset, int srcsLength) {
return new RequestBody(RewindableContent.of(srcs, srcsOffset, srcsLength));
}

/** Create a new RequestBody from the given {@link Path}. */
@BetaApi
public static RequestBody of(Path path) throws IOException {
return new RequestBody(RewindableContent.of(path));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
*/
package com.google.cloud.storage.multipartupload.model;

import com.google.api.core.BetaApi;

/**
* Represents a request to abort a multipart upload. This request is used to stop an in-progress
* multipart upload, deleting any previously uploaded parts.
*
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public final class AbortMultipartUploadRequest {
private final String bucket;
private final String key;
Expand All @@ -41,9 +38,8 @@ private AbortMultipartUploadRequest(Builder builder) {
* Returns the name of the bucket in which the multipart upload is stored.
*
* @return The bucket name.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public String bucket() {
return bucket;
}
Expand All @@ -52,9 +48,8 @@ public String bucket() {
* Returns the name of the object that is being uploaded.
*
* @return The object name.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public String key() {
return key;
}
Expand All @@ -63,9 +58,8 @@ public String key() {
* Returns the upload ID of the multipart upload to abort.
*
* @return The upload ID.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public String uploadId() {
return uploadId;
}
Expand All @@ -76,9 +70,8 @@ public String uploadId() {
* @return the user-project.
* @see <a
* href="https://docs.cloud.google.com/storage/docs/xml-api/reference-headers#xgooguserproject">x-goog-user-project</a>
* @since 2.61 This new api is in preview and is subject to breaking changes.
* @since 2.61.0
*/
@BetaApi
public String userProject() {
return userProject;
}
Expand All @@ -87,19 +80,17 @@ public String userProject() {
* Returns a new builder for creating {@link AbortMultipartUploadRequest} instances.
*
* @return A new {@link Builder}.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public static Builder builder() {
return new Builder();
}

/**
* A builder for creating {@link AbortMultipartUploadRequest} instances.
*
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public static class Builder {
private String bucket;
private String key;
Expand All @@ -113,9 +104,8 @@ private Builder() {}
*
* @param bucket The bucket name.
* @return This builder.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public Builder bucket(String bucket) {
this.bucket = bucket;
return this;
Expand All @@ -126,9 +116,8 @@ public Builder bucket(String bucket) {
*
* @param key The object name.
* @return This builder.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public Builder key(String key) {
this.key = key;
return this;
Expand All @@ -139,9 +128,8 @@ public Builder key(String key) {
*
* @param uploadId The upload ID.
* @return This builder.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public Builder uploadId(String uploadId) {
this.uploadId = uploadId;
return this;
Expand All @@ -154,9 +142,8 @@ public Builder uploadId(String uploadId) {
* @return This builder.
* @see <a
* href="https://docs.cloud.google.com/storage/docs/xml-api/reference-headers#xgooguserproject">x-goog-user-project</a>
* @since 2.61 This new api is in preview and is subject to breaking changes.
* @since 2.61.0
*/
@BetaApi
public Builder userProject(String userProject) {
this.userProject = userProject;
return this;
Expand All @@ -166,9 +153,8 @@ public Builder userProject(String userProject) {
* Builds a new {@link AbortMultipartUploadRequest} instance.
*
* @return A new {@link AbortMultipartUploadRequest}.
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
public AbortMultipartUploadRequest build() {
return new AbortMultipartUploadRequest(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*/
package com.google.cloud.storage.multipartupload.model;

import com.google.api.core.BetaApi;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

/**
* Represents a response to an abort multipart upload request. This class is currently empty as the
* abort operation does not return any specific data in its response body.
*
* @since 2.60.0 This new api is in preview and is subject to breaking changes.
* @since 2.60.0
*/
@BetaApi
@JacksonXmlRootElement(localName = "AbortMultipartUploadResponse")
public final class AbortMultipartUploadResponse {}
Loading