Skip to content

Commit

Permalink
Merge pull request #89 from aozarov/temp
Browse files Browse the repository at this point in the history
rename load to readAllBytes
  • Loading branch information
jboynes committed Jun 3, 2015
2 parents 9a7cc80 + 74e45fa commit 25067fb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
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

0 comments on commit 25067fb

Please sign in to comment.