Skip to content

Commit fc81172

Browse files
committed
---
yaml --- r: 5955 b: refs/heads/tswast-patch-1 c: d62c008 h: refs/heads/master i: 5953: 9968308 5951: b020ceb
1 parent 4ac645e commit fc81172

10 files changed

Lines changed: 90 additions & 8 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: b44cdd42befb805ed5992239cce452b65d9ab7c8
60+
refs/heads/tswast-patch-1: d62c008f5118fb33e9b8daa0d4be53c9fc1eb5d6
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/src/main/java/com/google/gcloud/examples/StorageExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public void run(StorageService storage, String bucket) {
149149
System.out.println(buckets.next());
150150
}
151151
} else {
152-
Iterator<Blob> blobs = storage.list(bucket, ListOptions.of());
152+
Iterator<Blob> blobs = storage.list(bucket, BlobIterOptions.of());
153153
while (blobs.hasNext()) {
154154
System.out.println(blobs.next());
155155
}

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

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

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 com.google.gcloud.storage.StorageServiceException;import java.util.Iterator;import java.util.Map;public interface StorageRpc { enum Option { PREDEFINED_ACL("predefinedAcl"), PREDEFINED_DEFAULT_OBJECT_ACL("predefinedDefaultObjectAcl"), IF_METAGENERATION_MATCH("ifMetagenerationMatch"), IF_GENERATION_MATCH("ifGenerationMatch"); private final String value; Option(String value) { this.value = value; } public String value() { return value; } } Bucket create(Bucket bucket, Map<Option, ?> options) throws StorageServiceException; StorageObject create(StorageObject object, byte[] content, Map<Option, ?> options) throws StorageServiceException; Iterator<Bucket> list() throws StorageServiceException; Iterator<StorageObject> list(String bucket, String prefix, String delimiter, String cursor, boolean versions, int limit) throws StorageServiceException; Bucket get(Bucket bucket, Map<Option, ?> options) throws StorageServiceException; StorageObject get(StorageObject object, Map<Option, ?> options) throws StorageServiceException; Bucket patch(Bucket bucket, Map<Option, ?> options) throws StorageServiceException; StorageObject patch(StorageObject storageObject, Map<Option, ?> options) throws StorageServiceException; void delete(Bucket bucket, Map<Option, ?> options) throws StorageServiceException; void delete(StorageObject object, Map<Option, ?> options) throws StorageServiceException; StorageObject compose(Iterable<StorageObject> sources, StorageObject target, Map<Option, ?> targetOptions) throws StorageServiceException; StorageObject copy(StorageObject source, Map<Option, ?> sourceOptions, StorageObject target, Map<Option, ?> targetOptions) throws StorageServiceException; byte[] load(StorageObject storageObject, Map<Option, ?> options) throws StorageServiceException; BlobReadChannel reader(StorageObject from, Map<Option, ?> options) throws StorageServiceException; BlobWriteChannel writer(StorageObject to, Map<Option, ?> options) throws StorageServiceException;}
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 com.google.gcloud.storage.StorageServiceException;import java.util.Iterator;import java.util.Map;public interface StorageRpc { enum Option { PREDEFINED_ACL("predefinedAcl"), PREDEFINED_DEFAULT_OBJECT_ACL("predefinedDefaultObjectAcl"), IF_METAGENERATION_MATCH("ifMetagenerationMatch"), IF_GENERATION_MATCH("ifGenerationMatch"); private final String value; Option(String value) { this.value = value; } public String value() { return value; } } Bucket create(Bucket bucket, Map<Option, ?> options) throws StorageServiceException; StorageObject create(StorageObject object, byte[] content, Map<Option, ?> options) throws StorageServiceException; Iterator<Bucket> list() throws StorageServiceException; Iterator<StorageObject> list(String bucket, String prefix, String delimiter, String cursor, boolean versions, long limit) throws StorageServiceException; Bucket get(Bucket bucket, Map<Option, ?> options) throws StorageServiceException; StorageObject get(StorageObject object, Map<Option, ?> options) throws StorageServiceException; Bucket patch(Bucket bucket, Map<Option, ?> options) throws StorageServiceException; StorageObject patch(StorageObject storageObject, Map<Option, ?> options) throws StorageServiceException; void delete(Bucket bucket, Map<Option, ?> options) throws StorageServiceException; void delete(StorageObject object, Map<Option, ?> options) throws StorageServiceException; StorageObject compose(Iterable<StorageObject> sources, StorageObject target, Map<Option, ?> targetOptions) throws StorageServiceException; StorageObject copy(StorageObject source, Map<Option, ?> sourceOptions, StorageObject target, Map<Option, ?> targetOptions) throws StorageServiceException; byte[] load(StorageObject storageObject, Map<Option, ?> options) throws StorageServiceException; BlobReadChannel reader(StorageObject from, Map<Option, ?> options) throws StorageServiceException; BlobWriteChannel writer(StorageObject to, Map<Option, ?> options) throws StorageServiceException;}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +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.storage;import java.io.Serializable;public class BlobIterOptions implements Serializable { private static final long serialVersionUID = -7260643619742432140L; private final boolean recursive; private final String prefix; private final Integer maxResults; private final boolean includeOlderVersions; public static class Builder { private boolean recursive; private String prefix; private String cursor; private int maxResults; private boolean includeOlderVersions; Builder() {} public Builder recursive(boolean recursive) { this.recursive = recursive; return this; } public Builder prefix(String prefix) { this.prefix = prefix; return this; } public Builder cursor(String cursor) { this.cursor = cursor; return this; } public Builder maxResults(Integer maxResults) { this.maxResults = maxResults; return this; } public Builder includeOlderVersions(boolean include) { this.includeOlderVersions = include; return this; } public BlobIterOptions build() { return new BlobIterOptions(this); } } BlobIterOptions(Builder builder) { recursive = builder.recursive; prefix = builder.prefix; maxResults = builder.maxResults; includeOlderVersions = builder.includeOlderVersions; } public boolean recursive() { return recursive; } public String prefix() { return prefix; } public Integer maxResults() { return maxResults; } public boolean includeOlderVersions() { return includeOlderVersions; } public static BlobIterOptions of() { return builder().build(); } public static Builder builder() { return new Builder(); }}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2015 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.storage;
18+
19+
import java.io.Serializable;
20+
import java.util.List;
21+
22+
/**
23+
* Created by ozarov on 4/24/15.
24+
*/
25+
public class BlobList implements Serializable{
26+
27+
private final List<Blob> blobs;
28+
private final String cursor;
29+
30+
BlobList(List<Blob> blobs, String cursor) {
31+
this.blobs = blobs;
32+
this.cursor = cursor;
33+
}
34+
35+
public List<Blob> result() {
36+
return blobs;
37+
}
38+
39+
public String cursor() {
40+
return cursor;
41+
}
42+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2015 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.storage;
18+
19+
/**
20+
* Created by ozarov on 4/24/15.
21+
*/
22+
public class BlobListOptions extends BlobIterOptions {
23+
24+
private final String cursor;
25+
26+
public Builder extends BlobIterOptions.Builder {
27+
28+
}
29+
30+
private BlobListOptions(Builder builder) {
31+
super(builder);
32+
}
33+
34+
public String cursor() {
35+
return cursor;
36+
}
37+
}

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

Lines changed: 0 additions & 1 deletion
This file was deleted.

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,15 @@ public static Builder builder() {
325325
/**
326326
* @throws StorageServiceException upon failure
327327
*/
328-
Iterator<Bucket> list();
328+
Iterator<Bucket> buckets();
329329

330330
/**
331331
* @throws StorageServiceException upon failure
332332
*/
333-
Iterator<Blob> list(String bucket, ListOptions settings);
333+
Iterator<Blob> blobs(String bucket, BlobIterOptions settings);
334+
335+
336+
BlobList blobs(String bucket, BlobListOptions settings);
334337

335338
/**
336339
* @throws StorageServiceException upon failure

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public Iterator<com.google.api.services.storage.model.Bucket> call() {
134134
}
135135

136136
@Override
137-
public Iterator<Blob> list(String bucket, ListOptions settings) {
137+
public Iterator<Blob> list(String bucket, BlobIterOptions settings) {
138138
// todo implement paging (with retries) with if limit is not given or > X
139139
String delimiter = settings.recursive() ? options().pathDelimiter() : null;
140140
return Iterators.transform(

0 commit comments

Comments
 (0)