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 @@ -329,7 +329,7 @@ private void run(Storage storage, String bucket, String blobName, Path downloadT
}
if (blobInfo.size() < 1_000_000) {
// Blob is small read all its content in one request
byte[] content = storage.load(blobInfo.bucket(), blobInfo.name());
byte[] content = storage.readAllBytes(blobInfo.bucket(), blobInfo.name());
writeTo.write(content);
} else {
// When Blob size is big or unknown use the blob's channel reader.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,12 @@ public static Builder builder() {
BlobInfo copy(CopyRequest copyRequest);

/**
* Load the content of the given blob.
* Reads all the bytes from a blob.
*
* @return the blob's content.
* @throws StorageException upon failure
*/
byte[] load(String bucket, String blob, BlobSourceOption... options);
byte[] readAllBytes(String bucket, String blob, BlobSourceOption... options);

/**
* Send a batch request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public StorageObject call() {
}

@Override
public byte[] load(String bucket, String blob, BlobSourceOption... options) {
public byte[] readAllBytes(String bucket, String blob, BlobSourceOption... options) {
final StorageObject storageObject = BlobInfo.of(bucket, blob).toPb();
final Map<StorageRpc.Option, ?> optionsMap = optionMap(options);
return runWithRetries(new Callable<byte[]>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* if (blobInfo == null) {
* storage.create(BlobInfo.of("bucket", "blob_name"), content);
* } else {
* byte[] prevContent = storage.load("bucket", "blob_name");
* byte[] prevContent = storage.readAllBytes("bucket", "blob_name");
* content = mergeContent(prevContent, content);
* WritableByteChannel channel = storage.writer(blob);
* channel.write(ByteBuffer.wrap(content));
Expand Down