Skip to content

Commit 1c52d52

Browse files
committed
api samples: Update to 1.15.0-rc
https://codereview.appspot.com/8709047/
1 parent bb6f1ea commit 1c52d52

File tree

163 files changed

+222
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+222
-156
lines changed

adexchangebuyer-cmdline-sample/.classpath

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<classpathentry kind="src" path="src/main/java"/>
44
<classpathentry kind="src" path="src/main/resources"/>
55
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
6-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
6+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
77
<classpathentry kind="output" path="target/classes"/>
88
</classpath>

adexchangebuyer-cmdline-sample/pom.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<timezone>0</timezone>
4545
</developer>
4646
</developers>
47+
4748
<build>
4849
<plugins>
4950
<plugin>
@@ -113,7 +114,7 @@
113114
<dependency>
114115
<groupId>com.google.apis</groupId>
115116
<artifactId>google-api-services-adexchangebuyer</artifactId>
116-
<version>v1.2-rev2-1.14.1-beta</version>
117+
<version>v1.2-rev6-1.15.0-rc</version>
117118
</dependency>
118119
<dependency>
119120
<groupId>com.google.http-client</groupId>
@@ -127,8 +128,8 @@
127128
</dependency>
128129
</dependencies>
129130
<properties>
130-
<project.http.version>1.14.1-beta</project.http.version>
131-
<project.oauth.version>1.14.1-beta</project.oauth.version>
131+
<project.http.version>1.15.0-rc</project.http.version>
132+
<project.oauth.version>1.15.0-rc</project.oauth.version>
132133
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
133134
</properties>
134135
</project>

adexchangebuyer-cmdline-sample/src/main/java/com/google/api/services/samples/adexchangebuyer/cmdline/AdExchangeBuyerSample.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
import java.io.File;
3131
import java.io.IOException;
32+
import java.io.InputStreamReader;
3233
import java.util.ArrayList;
3334
import java.util.Collections;
3435

@@ -63,7 +64,8 @@ public class AdExchangeBuyerSample {
6364
private static Credential authorize() throws Exception {
6465
// load client secrets
6566
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(
66-
JSON_FACTORY, AdExchangeBuyerSample.class.getResourceAsStream("/client_secrets.json"));
67+
JSON_FACTORY, new InputStreamReader(
68+
AdExchangeBuyerSample.class.getResourceAsStream("/client_secrets.json")));
6769
if (clientSecrets.getDetails().getClientId().startsWith("Enter")
6870
|| clientSecrets.getDetails().getClientSecret().startsWith("Enter ")) {
6971
System.out.println("Enter Client ID and Secret from "

adsense-cmdline-sample/.classpath

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<classpathentry kind="src" path="src/main/java"/>
44
<classpathentry kind="src" path="src/main/resources"/>
55
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
6-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
6+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
77
<classpathentry kind="output" path="target/classes"/>
88
</classpath>

adsense-cmdline-sample/pom.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<timezone>0</timezone>
4545
</developer>
4646
</developers>
47+
4748
<build>
4849
<plugins>
4950
<plugin>
@@ -113,7 +114,7 @@
113114
<dependency>
114115
<groupId>com.google.apis</groupId>
115116
<artifactId>google-api-services-adsense</artifactId>
116-
<version>v1.2-rev26-1.14.1-beta</version>
117+
<version>v1.2-rev34-1.15.0-rc</version>
117118
</dependency>
118119
<dependency>
119120
<groupId>com.google.http-client</groupId>
@@ -127,8 +128,8 @@
127128
</dependency>
128129
</dependencies>
129130
<properties>
130-
<project.http.version>1.14.1-beta</project.http.version>
131-
<project.oauth.version>1.14.1-beta</project.oauth.version>
131+
<project.http.version>1.15.0-rc</project.http.version>
132+
<project.oauth.version>1.15.0-rc</project.oauth.version>
132133
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
133134
</properties>
134135
</project>

adsense-cmdline-sample/src/main/java/com/google/api/services/samples/adsense/cmdline/AdSenseSample.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
import com.google.api.services.adsense.model.CustomChannels;
3434
import com.google.api.services.adsense.model.SavedReports;
3535

36-
3736
import java.io.File;
3837
import java.io.IOException;
38+
import java.io.InputStreamReader;
3939
import java.util.Collections;
4040

4141
/**
@@ -79,8 +79,8 @@ public class AdSenseSample {
7979
/** Authorizes the installed application to access user's protected data. */
8080
private static Credential authorize() throws Exception {
8181
// load client secrets
82-
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(
83-
JSON_FACTORY, AdSenseSample.class.getResourceAsStream("/client_secrets.json"));
82+
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY,
83+
new InputStreamReader(AdSenseSample.class.getResourceAsStream("/client_secrets.json")));
8484
if (clientSecrets.getDetails().getClientId().startsWith("Enter")
8585
|| clientSecrets.getDetails().getClientSecret().startsWith("Enter ")) {
8686
System.out.println("Enter Client ID and Secret from "

adsensehost-cmdline-sample/.classpath

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<classpathentry kind="src" path="src/main/java"/>
44
<classpathentry kind="src" path="src/main/resources"/>
55
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
6-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
6+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
77
<classpathentry kind="output" path="target/classes"/>
88
</classpath>

adsensehost-cmdline-sample/pom.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<timezone>0</timezone>
4545
</developer>
4646
</developers>
47+
4748
<build>
4849
<plugins>
4950
<plugin>
@@ -113,7 +114,7 @@
113114
<dependency>
114115
<groupId>com.google.apis</groupId>
115116
<artifactId>google-api-services-adsensehost</artifactId>
116-
<version>v4.1-rev28-1.14.1-beta</version>
117+
<version>v4.1-rev36-1.15.0-rc</version>
117118
</dependency>
118119
<dependency>
119120
<groupId>com.google.http-client</groupId>
@@ -127,8 +128,8 @@
127128
</dependency>
128129
</dependencies>
129130
<properties>
130-
<project.http.version>1.14.1-beta</project.http.version>
131-
<project.oauth.version>1.14.1-beta</project.oauth.version>
131+
<project.http.version>1.15.0-rc</project.http.version>
132+
<project.oauth.version>1.15.0-rc</project.oauth.version>
132133
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
133134
</properties>
134135
</project>

adsensehost-cmdline-sample/src/main/java/com/google/api/services/samples/adsensehost/cmdline/AdSenseHostSample.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
import java.io.File;
3434
import java.io.IOException;
35+
import java.io.InputStreamReader;
3536
import java.util.Collections;
3637

3738
/**
@@ -89,8 +90,8 @@ public class AdSenseHostSample {
8990
/** Authorizes the installed application to access user's protected data. */
9091
private static Credential authorize() throws Exception {
9192
// load client secrets
92-
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(
93-
JSON_FACTORY, AdSenseHostSample.class.getResourceAsStream("/client_secrets.json"));
93+
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY,
94+
new InputStreamReader(AdSenseHostSample.class.getResourceAsStream("/client_secrets.json")));
9495
if (clientSecrets.getDetails().getClientId().startsWith("Enter")
9596
|| clientSecrets.getDetails().getClientSecret().startsWith("Enter ")) {
9697
System.out.println("Enter Client ID and Secret from "

analytics-cmdline-sample/.classpath

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<classpath>
33
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
44
<classpathentry kind="src" path="src/main/resources"/>
5-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
5+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
66
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
77
<classpathentry kind="output" path="target/classes"/>
88
</classpath>

analytics-cmdline-sample/pom.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<timezone>0</timezone>
4545
</developer>
4646
</developers>
47+
4748
<build>
4849
<plugins>
4950
<plugin>
@@ -113,7 +114,7 @@
113114
<dependency>
114115
<groupId>com.google.apis</groupId>
115116
<artifactId>google-api-services-analytics</artifactId>
116-
<version>v3-rev34-1.14.1-beta</version>
117+
<version>v3-rev44-1.15.0-rc</version>
117118
</dependency>
118119
<dependency>
119120
<groupId>com.google.http-client</groupId>
@@ -127,8 +128,8 @@
127128
</dependency>
128129
</dependencies>
129130
<properties>
130-
<project.http.version>1.14.1-beta</project.http.version>
131-
<project.oauth.version>1.14.1-beta</project.oauth.version>
131+
<project.http.version>1.15.0-rc</project.http.version>
132+
<project.oauth.version>1.15.0-rc</project.oauth.version>
132133
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
133134
</properties>
134135
</project>

analytics-cmdline-sample/src/main/java/com/google/api/services/samples/analytics/cmdline/CoreReportingApiReferenceSample.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
import java.io.File;
3535
import java.io.IOException;
36+
import java.io.InputStreamReader;
3637
import java.util.Collections;
3738
import java.util.List;
3839
import java.util.Map;
@@ -102,7 +103,8 @@ public static void main(String[] args) {
102103
private static Credential authorize() throws Exception {
103104
// load client secrets
104105
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(
105-
JSON_FACTORY, HelloAnalyticsApiSample.class.getResourceAsStream("/client_secrets.json"));
106+
JSON_FACTORY, new InputStreamReader(
107+
HelloAnalyticsApiSample.class.getResourceAsStream("/client_secrets.json")));
106108
if (clientSecrets.getDetails().getClientId().startsWith("Enter")
107109
|| clientSecrets.getDetails().getClientSecret().startsWith("Enter ")) {
108110
System.out.println(

analytics-cmdline-sample/src/main/java/com/google/api/services/samples/analytics/cmdline/HelloAnalyticsApiSample.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
import java.io.File;
3737
import java.io.IOException;
38+
import java.io.InputStreamReader;
3839
import java.util.Collections;
3940
import java.util.List;
4041

@@ -96,7 +97,8 @@ public static void main(String[] args) {
9697
private static Credential authorize() throws Exception {
9798
// load client secrets
9899
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(
99-
JSON_FACTORY, HelloAnalyticsApiSample.class.getResourceAsStream("/client_secrets.json"));
100+
JSON_FACTORY, new InputStreamReader(
101+
HelloAnalyticsApiSample.class.getResourceAsStream("/client_secrets.json")));
100102
if (clientSecrets.getDetails().getClientId().startsWith("Enter")
101103
|| clientSecrets.getDetails().getClientSecret().startsWith("Enter ")) {
102104
System.out.println(

analytics-cmdline-sample/src/main/java/com/google/api/services/samples/analytics/cmdline/ManagementApiReferenceSample.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
import java.io.File;
4747
import java.io.IOException;
48+
import java.io.InputStreamReader;
4849
import java.util.Collections;
4950

5051
/**
@@ -94,7 +95,8 @@ public static void main(String args[]) {
9495
private static Credential authorize() throws Exception {
9596
// load client secrets
9697
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(
97-
JSON_FACTORY, HelloAnalyticsApiSample.class.getResourceAsStream("/client_secrets.json"));
98+
JSON_FACTORY, new InputStreamReader(
99+
HelloAnalyticsApiSample.class.getResourceAsStream("/client_secrets.json")));
98100
if (clientSecrets.getDetails().getClientId().startsWith("Enter")
99101
|| clientSecrets.getDetails().getClientSecret().startsWith("Enter ")) {
100102
System.out.println(

analytics-cmdline-sample/src/main/java/com/google/api/services/samples/analytics/cmdline/McfReportingApiReferenceSample.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
import java.io.File;
3535
import java.io.IOException;
36+
import java.io.InputStreamReader;
3637
import java.util.Collections;
3738
import java.util.List;
3839
import java.util.Map;
@@ -120,7 +121,8 @@ public static void printAllInfo(McfData mcfData) {
120121
private static Credential authorize() throws Exception {
121122
// load client secrets
122123
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(
123-
JSON_FACTORY, HelloAnalyticsApiSample.class.getResourceAsStream("/client_secrets.json"));
124+
JSON_FACTORY, new InputStreamReader(
125+
HelloAnalyticsApiSample.class.getResourceAsStream("/client_secrets.json")));
124126
if (clientSecrets.getDetails().getClientId().startsWith("Enter")
125127
|| clientSecrets.getDetails().getClientSecret().startsWith("Enter ")) {
126128
System.out.println(

bigquery-appengine-sample/.classpath

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<classpathentry kind="src" path="src/main/java"/>
44
<classpathentry kind="src" path="src/main/resources"/>
55
<classpathentry kind="src" path="src/main/webapp"/>
6-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
6+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
77
<classpathentry kind="con" path="com.google.appengine.eclipse.core.GAE_CONTAINER"/>
88
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
99
<classpathentry kind="output" path="target/war/WEB-INF/classes"/>

bigquery-appengine-sample/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
</pluginRepositories>
2323

2424
<properties>
25-
<bigquery.version>v2-rev75-1.14.1-beta</bigquery.version>
25+
<bigquery.version>v2-rev86-1.15.0-rc</bigquery.version>
2626
<datanucleus.version>1.1.5</datanucleus.version>
2727
<gae.version>1.7.0</gae.version>
28-
<google-api-client.version>1.14.1-beta</google-api-client.version>
28+
<google-api-client.version>1.15.0-rc</google-api-client.version>
2929
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
3030
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3131
</properties>

bigquery-appengine-sample/src/main/java/com/google/api/client/sample/bigquery/appengine/dashboard/DataServlet.java

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
*/
2323
public class DataServlet extends HttpServlet {
2424

25+
private static final long serialVersionUID = 1L;
26+
2527
// It's important that the first column be a string and the second a number.
2628
// Also, it is expected that these are the same length.
2729
private final String[] labels = new String[]

bigquery-appengine-sample/src/main/java/com/google/api/client/sample/bigquery/appengine/dashboard/MainServlet.java

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
public class MainServlet extends AbstractAppEngineAuthorizationCodeServlet {
2020

21+
private static final long serialVersionUID = 1L;
2122
private static final Logger log = Logger.getLogger(MainServlet.class.getName());
2223

2324
/**

bigquery-appengine-sample/src/main/java/com/google/api/client/sample/bigquery/appengine/dashboard/SampleDashboardException.java

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
*/
1414
public class SampleDashboardException extends HttpResponseException {
1515

16+
private static final long serialVersionUID = 1L;
17+
1618
public SampleDashboardException(int statusCode, String s) {
1719
super(statusCode, s);
1820
}

bigquery-appengine-sample/src/main/java/com/google/api/client/sample/bigquery/appengine/dashboard/ServiceUtils.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.google.api.services.bigquery.BigqueryScopes;
2929

3030
import java.io.IOException;
31+
import java.io.InputStreamReader;
3132
import java.util.Collections;
3233

3334
import javax.servlet.http.HttpServletRequest;
@@ -45,16 +46,16 @@ class ServiceUtils {
4546

4647
/** Global instance of the JSON factory. */
4748
static final JsonFactory JSON_FACTORY = new JacksonFactory();
48-
49+
4950
/** Global instance of the Credential store. */
5051
static final AppEngineCredentialStore CREDENTIAL_STORE = new AppEngineCredentialStore();
5152

5253
private static GoogleClientSecrets clientSecrets = null;
5354

5455
static GoogleClientSecrets getClientCredential() throws IOException {
5556
if (clientSecrets == null) {
56-
clientSecrets = GoogleClientSecrets.load(
57-
JSON_FACTORY, ServiceUtils.class.getResourceAsStream("/client_secrets.json"));
57+
clientSecrets = GoogleClientSecrets.load(JSON_FACTORY,
58+
new InputStreamReader(ServiceUtils.class.getResourceAsStream("/client_secrets.json")));
5859
Preconditions.checkArgument(!clientSecrets.getDetails().getClientId().startsWith("Enter ")
5960
&& !clientSecrets.getDetails().getClientSecret().startsWith("Enter "),
6061
"Enter Client ID and Secret from https://code.google.com/apis/console/?api=bigquery "
@@ -68,7 +69,7 @@ static String getRedirectUri(HttpServletRequest req) {
6869
url.setRawPath("/oauth2callback");
6970
return url.build();
7071
}
71-
72+
7273
static void deleteCredentials(String userId) throws IOException {
7374
Credential credential = newFlow().loadCredential(userId);
7475
if (credential != null) {
@@ -86,6 +87,7 @@ static Bigquery loadBigqueryClient(String userId) throws IOException {
8687
Credential credential = newFlow().loadCredential(userId);
8788
return new Bigquery.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential).build();
8889
}
89-
90-
private ServiceUtils() {}
90+
91+
private ServiceUtils() {
92+
}
9193
}

bigquery-appengine-sample/src/main/java/com/google/api/client/sample/bigquery/appengine/dashboard/TaskServlet.java

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*/
2626
public class TaskServlet extends HttpServlet {
2727

28+
private static final long serialVersionUID = 1L;
2829
private static final Logger log = Logger.getLogger(TaskServlet.class.getName());
2930

3031
@Override

books-cmdline-sample/.classpath

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<classpath>
33
<classpathentry kind="src" path="src/main/java"/>
44
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
5-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
5+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
66
<classpathentry kind="output" path="target/classes"/>
77
</classpath>

0 commit comments

Comments
 (0)