Add createFromStream to Storage by mziccard · Pull Request #186 · googleapis/google-cloud-java · GitHub
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 @@ -22,6 +22,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.gcloud.storage.StorageException;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -128,7 +129,7 @@ public BatchResponse(Map<StorageObject, Tuple<Boolean, StorageException>> delete

Bucket create(Bucket bucket, Map<Option, ?> options) throws StorageException;

StorageObject create(StorageObject object, byte[] content, Map<Option, ?> options)
StorageObject create(StorageObject object, InputStream content, Map<Option, ?> options)
throws StorageException;

Tuple<String, Iterable<Bucket>> list(Map<Option, ?> options) throws StorageException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.gcloud.Service;
import com.google.gcloud.spi.StorageRpc;

import java.io.InputStream;
import java.io.Serializable;
import java.net.URL;
import java.util.Arrays;
Expand Down Expand Up @@ -493,13 +494,31 @@ public static Builder builder() {
BucketInfo create(BucketInfo bucketInfo, BucketTargetOption... options);

/**
* Create a new blob.
* Create a new blob with no content.
*
* @return a complete blob information.
* @throws StorageException upon failure
*/
BlobInfo create(BlobInfo blobInfo, BlobTargetOption... options);

/**
* Create a new blob. Direct upload is used to upload {@code content}. For large content,
* {@link #writer} is recommended as it uses resumable upload.
*
* @return a complete blob information.
* @throws StorageException upon failure
*/
BlobInfo create(BlobInfo blobInfo, byte[] content, BlobTargetOption... options);

/**
* Create a new blob. Direct upload is used to upload {@code content}. For large content,
* {@link #writer} is recommended as it uses resumable upload.
*
* @return a complete blob information.
* @throws StorageException upon failure
*/
BlobInfo create(BlobInfo blobInfo, InputStream content, BlobTargetOption... options);

/**
* Return the requested bucket or {@code null} if not found.
*
Expand Down