Skip to content

Commit f7189cd

Browse files
committed
---
yaml --- r: 5943 b: refs/heads/tswast-patch-1 c: 02a8550 h: refs/heads/master i: 5941: f89ca89 5939: 8191258 5935: fc0a976
1 parent 7c04efa commit f7189cd

4 files changed

Lines changed: 14 additions & 11 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: 82c1ffb015ae331f99c106e74bdc666f7f23e7cf
60+
refs/heads/tswast-patch-1: 02a8550fe942da228cf64a03437ad0abef1c6558
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/src/main/java/com/google/gcloud/spi/StorageRpc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/* * Copyright 2015 Google Inc. All Rights Reserved. * * 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 com.google.gcloud.spi;import com.google.api.services.storage.model.Bucket;import com.google.api.services.storage.model.StorageObject;import com.google.gcloud.storage.BlobReadChannel;import com.google.gcloud.storage.BlobWriteChannel;import java.io.IOException;import java.nio.ByteBuffer;import java.util.Iterator;public interface StorageRpc { Bucket create(Bucket bucket) throws IOException; StorageObject create(StorageObject object, ByteBuffer content) throws IOException; Iterator<Bucket> list() throws IOException; Iterator<StorageObject> list(String bucket, String prefix, String delimiter, String cursor, boolean versions, int limit) throws IOException; Bucket get(Bucket bucket) throws IOException; StorageObject get(StorageObject object) throws IOException; Bucket patch(Bucket bucket) throws IOException; StorageObject patch(StorageObject storageObject) throws IOException; void delete(Bucket bucket) throws IOException; void delete(StorageObject object) throws IOException; StorageObject compose(String bucket, Iterable<String> src, StorageObject dest) throws IOException; StorageObject copy(StorageObject from, StorageObject to) throws IOException; BlobReadChannel reader(StorageObject from) throws IOException; BlobWriteChannel writer(StorageObject to) throws IOException;}
1+
/* * Copyright 2015 Google Inc. All Rights Reserved. * * 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 com.google.gcloud.spi;import com.google.api.services.storage.model.Bucket;import com.google.api.services.storage.model.StorageObject;import com.google.gcloud.storage.BlobReadChannel;import com.google.gcloud.storage.BlobWriteChannel;import java.io.IOException;import java.nio.ByteBuffer;import java.util.Iterator;public interface StorageRpc { Bucket create(Bucket bucket) throws IOException; StorageObject create(StorageObject object, ByteBuffer content) throws IOException; Iterator<Bucket> list() throws IOException; Iterator<StorageObject> list(String bucket, String prefix, String delimiter, String cursor, boolean versions, int limit) throws IOException; Bucket get(String bucket) throws IOException; StorageObject get(String bucket, String object) throws IOException; Bucket patch(Bucket bucket) throws IOException; StorageObject patch(StorageObject storageObject) throws IOException; void delete(Bucket bucket) throws IOException; void delete(StorageObject object) throws IOException; StorageObject compose(String bucket, Iterable<String> src, StorageObject dest) throws IOException; StorageObject copy(StorageObject from, StorageObject to) throws IOException; BlobReadChannel reader(StorageObject from) throws IOException; BlobWriteChannel writer(StorageObject to) throws IOException;}

branches/tswast-patch-1/src/main/java/com/google/gcloud/storage/StorageService.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,25 @@
2424
public interface StorageService extends Service<StorageServiceOptions> {
2525

2626
// todo: consider what to do with predefinedAcl
27+
2728
// todo: consider supplying create/update/delete options (varargs) for
2829
// ifGenerationMatch, ifGenerationNotMatch, ifMetagenerationMatch,
2930
// ifMetagenerationNotMatch, ifSourceGenerationMatch, ifSourceGenerationNotMatch
3031
// ifSourceMetagenerationMatch and ifSourceMetagenerationNotMatch
3132

33+
// todo: provide way for construct signed URLs - https://cloud.google.com/storage/docs/access-control#Signed-URLs
34+
3235
Bucket create(Bucket bucket);
3336

3437
Blob create(Blob blob, ByteBuffer content);
3538

36-
Bucket get(Bucket bucket);
39+
Bucket get(String bucket);
3740

38-
Blob get(Blob blob);
41+
Blob get(String bucket, String blob);
3942

4043
Iterator<Bucket> list();
4144

42-
Iterator<Blob> list(Bucket bucket, ListOptions settings);
45+
Iterator<Blob> list(String bucket, ListOptions settings);
4346

4447
Bucket update(Bucket bucket);
4548

branches/tswast-patch-1/src/main/java/com/google/gcloud/storage/StorageServiceImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ public Blob create(Blob blob, ByteBuffer content) {
5353
}
5454

5555
@Override
56-
public Bucket get(Bucket bucket) {
56+
public Bucket get(String bucket) {
5757
try {
58-
return Bucket.fromPb(storageRpc.get(bucket.toPb()));
58+
return Bucket.fromPb(storageRpc.get(bucket));
5959
} catch (IOException ex) {
6060
throw new StorageServiceException(ex);
6161
}
6262
}
6363

6464
@Override
65-
public Blob get(Blob blob) {
65+
public Blob get(String bucket, String blob) {
6666
try {
67-
return Blob.fromPb(storageRpc.get(blob.toPb()));
67+
return Blob.fromPb(storageRpc.get(bucket, blob));
6868
} catch (IOException ex) {
6969
throw new StorageServiceException(ex);
7070
}
@@ -80,11 +80,11 @@ public Iterator<Bucket> list() {
8080
}
8181

8282
@Override
83-
public Iterator<Blob> list(Bucket bucket, ListOptions settings) {
83+
public Iterator<Blob> list(String bucket, ListOptions settings) {
8484
try {
8585
String delimiter = settings.recursive() ? options().pathDelimiter() : null;
8686
return Iterators.transform(
87-
storageRpc.list(bucket.name(), settings.prefix(), delimiter, settings.cursor(),
87+
storageRpc.list(bucket, settings.prefix(), delimiter, settings.cursor(),
8888
settings.includeOlderVersions(), settings.maxResults()),
8989
Blob.FROM_PB_FUNCTION);
9090
} catch (IOException ex) {

0 commit comments

Comments
 (0)