Skip to content

Commit 40e4d27

Browse files
committed
---
yaml --- r: 75 b: refs/heads/master c: 509072d h: refs/heads/master i: 73: 229690f 71: 77af580 v: v3
1 parent ed01b2b commit 40e4d27

10 files changed

Lines changed: 106 additions & 7 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: e6250dccff620e87c7a181e02f4622dfb4f666bc
2+
refs/heads/master: 509072d2347d09fc556b91a089006ef4b94f199d

trunk/.classpath

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
2121
<attributes>
2222
<attribute name="maven.pomderived" value="true"/>
23+
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
2324
</attributes>
2425
</classpathentry>
2526
<classpathentry kind="var" path="ECLIPSE_HOME"/>

trunk/.project

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
<projects>
66
</projects>
77
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
813
<buildCommand>
914
<name>org.eclipse.jdt.core.javabuilder</name>
1015
<arguments>
@@ -30,11 +35,19 @@
3035
<arguments>
3136
</arguments>
3237
</buildCommand>
38+
<buildCommand>
39+
<name>org.eclipse.wst.validation.validationbuilder</name>
40+
<arguments>
41+
</arguments>
42+
</buildCommand>
3343
</buildSpec>
3444
<natures>
45+
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
46+
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
3547
<nature>org.eclipse.jdt.core.javanature</nature>
3648
<nature>org.eclipse.m2e.core.maven2Nature</nature>
3749
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
3850
<nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
51+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
3952
</natures>
4053
</projectDescription>

trunk/src/main/java/com/google/gcloud/ServiceOptions.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ private static AuthConfig defaultAuthConfig() {
6363
}
6464

6565
protected static String appEngineAppId() {
66-
return System.getProperty("com.google.appengine.application.id");
66+
try {
67+
Class<?> apiProxy = Class.forName("com.google.apphosting.api.ApiProxy");
68+
Object currentEnv = apiProxy.getMethod("getCurrentEnvironment").invoke(null);
69+
return (String) currentEnv.getClass().getMethod("getAppId").invoke(currentEnv);
70+
} catch (Exception ex) {
71+
return System.getProperty("com.google.appengine.application.id");
72+
}
6773
}
6874

6975
protected abstract static class Builder<B extends Builder<B>> {

trunk/src/main/java/com/google/gcloud/storage/Acl.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,43 @@
22

33
public interface Acl {
44

5+
public class ProjectTeam {
6+
// ProjectNumber: The project number.
7+
//ProjectNumber string `json:"projectNumber,omitempty"`
8+
9+
// Team: The team. Can be owners, editors, or viewers.
10+
//Team string `json:"team,omitempty"`
11+
}
12+
13+
enum Entity {
14+
USER_ID("user-userId"),
15+
USER_EMAIL("user-emailAddress"),
16+
GROUP_ID("group-groupId"),
17+
GROUP_EMAIL("group-emailAddress"),
18+
ALL_USERS("allUsers"),
19+
ALL_AUTHENTICATED_USERS("allAuthenticatedUsers");
20+
21+
private final String value;
22+
23+
Entity(String value) {
24+
this.value = value;
25+
}
26+
}
27+
28+
String domain();
29+
30+
Entity entity();
31+
32+
String entityId();
33+
34+
String email();
35+
36+
String etag();
37+
38+
String generation();
39+
40+
41+
ProjectTeam projectTeam();
42+
43+
String role();
544
}

trunk/src/main/java/com/google/gcloud/storage/Bucket.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public interface Bucket {
1414

1515
void updateDefaultObjectAcl();
1616

17-
Acl acl(String objectName);
1817

19-
void updateAcl(String objectName, Acl acl);
2018

21-
void delete(String... objectName);
19+
20+
21+
void delete(Key... objectKey);
2222

2323
void compose(Iterable<String> source, String dest);
2424

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.google.gcloud.storage;
2+
3+
public class Key {
4+
5+
// TODO: add builder, factory method, toURL, from URL, equals,hashCode, toString
6+
private final String bucket;
7+
private final String name;
8+
9+
/*
10+
Builder() {
11+
12+
}*/
13+
14+
Key(String bucket, String name) {
15+
this.bucket = bucket;
16+
this.name = name;
17+
}
18+
19+
public String bucket() {
20+
return bucket;
21+
}
22+
23+
public String name() {
24+
return name;
25+
}
26+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.google.gcloud.storage;
2+
3+
import java.nio.ByteBuffer;
4+
5+
public interface StorageObject {
6+
7+
// builder will have an option to populate content and set acl, bucket, name,..
8+
9+
Key key();
10+
11+
Acl acl();
12+
13+
ByteBuffer content();
14+
15+
}

trunk/src/main/java/com/google/gcloud/storage/StorageService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ public interface StorageService {
55
Iterable<Bucket> listBuckets();
66

77
Bucket getBucket(String bucket);
8-
98
}

trunk/src/main/java/com/google/gcloud/storage/StorageServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ final class StorageServiceImpl implements StorageService {
99

1010
StorageServiceImpl(StorageServiceOptions options) {
1111
this.options = options;
12-
this.storage = options.getStorage();
12+
storage = options.getStorage();
1313
}
1414

1515
@Override

0 commit comments

Comments
 (0)