diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
index 284c8b69d..731a0eb4a 100644
--- a/.github/.OwlBot.lock.yaml
+++ b/.github/.OwlBot.lock.yaml
@@ -1,3 +1,3 @@
docker:
- image: gcr.io/repo-automation-bots/owlbot-java:latest
- digest: sha256:13b7387edb404234610d30473ac48210ae7fe42a136335ee2b2f8a07c4c7f6a5
+ image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
+ digest: sha256:491a007c6bd6e77f9e9b1bebcd6cdf08a4a4ef2c228c123d9696845204cb685d
diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml
index 8c5f03b4d..5d9a9d8b5 100644
--- a/.github/.OwlBot.yaml
+++ b/.github/.OwlBot.yaml
@@ -13,4 +13,4 @@
# limitations under the License.
docker:
- image: "gcr.io/repo-automation-bots/owlbot-java:latest"
+ image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest"
diff --git a/.github/release-please.yml b/.github/release-please.yml
index 3cc5e9baf..f526582ab 100644
--- a/.github/release-please.yml
+++ b/.github/release-please.yml
@@ -6,3 +6,7 @@ branches:
handleGHRelease: true
releaseType: java-lts
branch: 1.31.3-sp
+ - bumpMinorPreMajor: true
+ handleGHRelease: true
+ releaseType: java-backport
+ branch: 1.32.x
diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml
index 64903237e..008ab887f 100644
--- a/.github/sync-repo-settings.yaml
+++ b/.github/sync-repo-settings.yaml
@@ -31,6 +31,20 @@ branchProtectionRules:
- lint
- clirr
- cla/google
+ - pattern: 1.32.x
+ isAdminEnforced: true
+ requiredApprovingReviewCount: 1
+ requiresCodeOwnerReviews: true
+ requiresStrictStatusChecks: false
+ requiredStatusCheckContexts:
+ - units (8)
+ - units (11)
+ - windows
+ - dependencies (8)
+ - dependencies (11)
+ - lint
+ - clirr
+ - cla/google
permissionRules:
- team: yoshi-admins
permission: admin
diff --git a/.kokoro/build.sh b/.kokoro/build.sh
index 5bcd551cf..7b7fb24f5 100755
--- a/.kokoro/build.sh
+++ b/.kokoro/build.sh
@@ -47,15 +47,15 @@ set +e
case ${JOB_TYPE} in
test)
- mvn test -B -Dclirr.skip=true -Denforcer.skip=true
+ mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true
RETURN_CODE=$?
;;
lint)
- mvn com.coveo:fmt-maven-plugin:check
+ mvn com.coveo:fmt-maven-plugin:check -B -ntp
RETURN_CODE=$?
;;
javadoc)
- mvn javadoc:javadoc javadoc:test-javadoc
+ mvn javadoc:javadoc javadoc:test-javadoc -B -ntp
RETURN_CODE=$?
;;
integration)
@@ -69,6 +69,11 @@ integration)
verify
RETURN_CODE=$?
;;
+graalvm)
+ # Run Unit and Integration Tests with Native Image
+ mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test
+ RETURN_CODE=$?
+ ;;
samples)
SAMPLES_DIR=samples
# only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise.
@@ -86,7 +91,6 @@ samples)
pushd ${SAMPLES_DIR}
mvn -B \
- -Penable-samples \
-ntp \
-DtrimStackTrace=false \
-Dclirr.skip=true \
@@ -100,7 +104,7 @@ samples)
fi
;;
clirr)
- mvn -B -Denforcer.skip=true clirr:check
+ mvn -B -ntp -Denforcer.skip=true clirr:check
RETURN_CODE=$?
;;
*)
diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh
index 9a5105d7e..d7476cfe9 100755
--- a/.kokoro/dependencies.sh
+++ b/.kokoro/dependencies.sh
@@ -38,15 +38,13 @@ function determineMavenOpts() {
| sed -E 's/^(1\.[0-9]\.0).*$/\1/g'
)
- case $javaVersion in
- "17")
+ if [[ $javaVersion == 17* ]]
+ then
# MaxPermSize is no longer supported as of jdk 17
echo -n "-Xmx1024m"
- ;;
- *)
+ else
echo -n "-Xmx1024m -XX:MaxPermSize=128m"
- ;;
- esac
+ fi
}
export MAVEN_OPTS=$(determineMavenOpts)
diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg
new file mode 100644
index 000000000..4c7225ec9
--- /dev/null
+++ b/.kokoro/presubmit/graalvm-native.cfg
@@ -0,0 +1,33 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+# Configure the docker image for kokoro-trampoline.
+env_vars: {
+ key: "TRAMPOLINE_IMAGE"
+ value: "gcr.io/cloud-devrel-kokoro-resources/graalvm"
+}
+
+env_vars: {
+ key: "JOB_TYPE"
+ value: "graalvm"
+}
+
+# TODO: remove this after we've migrated all tests and scripts
+env_vars: {
+ key: "GCLOUD_PROJECT"
+ value: "gcloud-devel"
+}
+
+env_vars: {
+ key: "GOOGLE_CLOUD_PROJECT"
+ value: "gcloud-devel"
+}
+
+env_vars: {
+ key: "GOOGLE_APPLICATION_CREDENTIALS"
+ value: "secret_manager/java-it-service-account"
+}
+
+env_vars: {
+ key: "SECRET_MANAGER_KEYS"
+ value: "java-it-service-account"
+}
diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh
index 19d42a7bc..77e6a9c6b 100755
--- a/.kokoro/release/publish_javadoc11.sh
+++ b/.kokoro/release/publish_javadoc11.sh
@@ -36,13 +36,9 @@ mvn clean install -B -q -DskipTests=true
export NAME=google-api-client
export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3)
-# V3 generates docfx yml from javadoc
-# generate yml
-mvn clean site -B -q -P docFX
-
-# copy README to docfx-yml dir and rename index.md
-cp README.md target/docfx-yml/index.md
-# copy CHANGELOG to docfx-yml dir and rename history.md
+# cloud RAD generation
+mvn clean javadoc:aggregate -B -q -P docFX
+# include CHANGELOG
cp CHANGELOG.md target/docfx-yml/history.md
pushd target/docfx-yml
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ee29a77fe..9e2bc08fc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,25 @@
# Changelog
+## [1.33.0](https://www.github.com/googleapis/google-api-java-client/compare/v1.32.2...v1.33.0) (2022-01-06)
+
+
+### Features
+
+* next release from main branch is 1.33.0 ([#1897](https://www.github.com/googleapis/google-api-java-client/issues/1897)) ([932a00b](https://www.github.com/googleapis/google-api-java-client/commit/932a00b4cac61cb3c9a4d9a29e6a7b43b67f9187))
+
+
+### Bug Fixes
+
+* **java:** add -ntp flag to native image testing command ([#1299](https://www.github.com/googleapis/google-api-java-client/issues/1299)) ([#1929](https://www.github.com/googleapis/google-api-java-client/issues/1929)) ([ee997f6](https://www.github.com/googleapis/google-api-java-client/commit/ee997f6dd351dd88eb18a230708627e8f2b059d8))
+* **java:** java 17 dependency arguments ([#1266](https://www.github.com/googleapis/google-api-java-client/issues/1266)) ([#1907](https://www.github.com/googleapis/google-api-java-client/issues/1907)) ([0bc4e26](https://www.github.com/googleapis/google-api-java-client/commit/0bc4e2684b105b5fe3ef538092c1042a704ee500))
+* **java:** run Maven in plain console-friendly mode ([#1301](https://www.github.com/googleapis/google-api-java-client/issues/1301)) ([#1939](https://www.github.com/googleapis/google-api-java-client/issues/1939)) ([826d7e1](https://www.github.com/googleapis/google-api-java-client/commit/826d7e1b83548b751d6e8a06af0689fb1c1b8081))
+
+
+### Dependencies
+
+* update dependency com.google.protobuf:protobuf-bom to v3.19.2 ([98b5898](https://www.github.com/googleapis/google-api-java-client/commit/98b5898754ecf8e8aa0d636744fbea1994af5c92))
+* update project.http.version to v1.41.0 ([#1944](https://www.github.com/googleapis/google-api-java-client/issues/1944)) ([98b5898](https://www.github.com/googleapis/google-api-java-client/commit/98b5898754ecf8e8aa0d636744fbea1994af5c92))
+
### [1.32.2](https://www.github.com/googleapis/google-api-java-client/compare/v1.32.1...v1.32.2) (2021-10-14)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f2dbdee06..b65dd279c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -53,12 +53,12 @@ mvn -Penable-integration-tests clean verify
## Code Samples
-Code Samples must be bundled in separate Maven modules, and guarded by a
-Maven profile with the name `enable-samples`.
+All code samples must be in compliance with the [java sample formatting guide][3].
+Code Samples must be bundled in separate Maven modules.
The samples must be separate from the primary project for a few reasons:
-1. Primary projects have a minimum Java version of Java 7 whereas samples have
- a minimum Java version of Java 8. Due to this we need the ability to
+1. Primary projects have a minimum Java version of Java 8 whereas samples can have
+ Java version of Java 11. Due to this we need the ability to
selectively exclude samples from a build run.
2. Many code samples depend on external GCP services and need
credentials to access the service.
@@ -68,39 +68,16 @@ The samples must be separate from the primary project for a few reasons:
### Building
```bash
-mvn -Penable-samples clean verify
+mvn clean verify
```
Some samples require access to GCP services and require a service account:
```bash
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json
-mvn -Penable-samples clean verify
+mvn clean verify
```
-### Profile Config
-
-1. To add samples in a profile to your Maven project, add the following to your
-`pom.xml`
-
- ```xml
-
Use {@link #getConnectionStatusCode()} to display the error dialog. Alternatively, use {@link * #getCause()} to get the wrapped {@link GooglePlayServicesAvailabilityException}. Example usage: * - *
+ * {@code
* } catch (final GooglePlayServicesAvailabilityIOException availabilityException) {
- * myActivity.runOnUiThread(new Runnable() {
- * public void run() {
- * Dialog dialog = GooglePlayServicesUtil.getErrorDialog(
- * availabilityException.getConnectionStatusCode(),
- * myActivity,
- * MyActivity.REQUEST_GOOGLE_PLAY_SERVICES);
- * dialog.show();
+ * myActivity.runOnUiThread(new Runnable() {
+ * public void run() {
+ * Dialog dialog = GooglePlayServicesUtil.getErrorDialog(
+ * availabilityException.getConnectionStatusCode(),
+ * myActivity, MyActivity.REQUEST_GOOGLE_PLAY_SERVICES);
+ * dialog.show();
* }
- * });
- *
+ * }
*
* @since 1.12
* @author Yaniv Inbar
diff --git a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/UserRecoverableAuthIOException.java b/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/UserRecoverableAuthIOException.java
index 280d80f79..b1b6825dd 100644
--- a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/UserRecoverableAuthIOException.java
+++ b/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/UserRecoverableAuthIOException.java
@@ -26,12 +26,12 @@
* Use {@link #getIntent()} to allow user interaction to recover. Alternatively, use {@link * #getCause()} to get the wrapped {@link UserRecoverableAuthException}. Example usage: * - *
+ * {@code
* } catch (UserRecoverableAuthIOException userRecoverableException) {
- * myActivity.startActivityForResult(
- * userRecoverableException.getIntent(), MyActivity.REQUEST_AUTHORIZATION);
+ * myActivity.startActivityForResult(
+ * userRecoverableException.getIntent(), MyActivity.REQUEST_AUTHORIZATION);
* }
- *
+ * }
*
* @since 1.12
* @author Yaniv Inbar
diff --git a/google-api-client-appengine/pom.xml b/google-api-client-appengine/pom.xml
index 03a2cbf3a..719872b8e 100644
--- a/google-api-client-appengine/pom.xml
+++ b/google-api-client-appengine/pom.xml
@@ -4,7 +4,7 @@
Sample usage: * - *
- * public static HttpRequestFactory createRequestFactory(
- * HttpTransport transport, JsonFactory jsonFactory, TokenResponse tokenResponse) {
- * return transport.createRequestFactory(
- * new AppIdentityCredential("https://www.googleapis.com/auth/urlshortener"));
+ * {@code
+ * public static HttpRequestFactory createRequestFactory(HttpTransport transport,
+ * JsonFactory jsonFactory, TokenResponse tokenResponse) {
+ * return transport.createRequestFactory(
+ * new AppIdentityCredential("https://www.googleapis.com/auth/urlshortener"));
* }
- *
+ * }
*
* Implementation is immutable and thread-safe. * diff --git a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/notifications/AppEngineNotificationServlet.java b/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/notifications/AppEngineNotificationServlet.java index 22324aa86..c26dbf2bd 100644 --- a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/notifications/AppEngineNotificationServlet.java +++ b/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/notifications/AppEngineNotificationServlet.java @@ -37,7 +37,7 @@ * alternatively call that method instead from your {@link HttpServlet#doPost} with no loss of * functionality. Sample web.xml setup: * - *
+ * {@code
* {@literal <}servlet{@literal >}
* {@literal <}servlet-name{@literal >}AppEngineNotificationServlet{@literal <}/servlet-name{@literal >}
* {@literal <}servlet-class{@literal >}com.google.api.client.googleapis.extensions.appengine.notifications.AppEngineNotificationServlet{@literal <}/servlet-class{@literal >}
@@ -46,7 +46,7 @@
* {@literal <}servlet-name{@literal >}AppEngineNotificationServlet{@literal <}/servlet-name{@literal >}
* {@literal <}url-pattern{@literal >}/notifications{@literal <}/url-pattern{@literal >}
* {@literal <}/servlet-mapping{@literal >}
- *
+ * }
*
* @author Yaniv Inbar
* @since 1.16
diff --git a/google-api-client-assembly/pom.xml b/google-api-client-assembly/pom.xml
index 4bb6c5576..ae9ae574c 100644
--- a/google-api-client-assembly/pom.xml
+++ b/google-api-client-assembly/pom.xml
@@ -4,7 +4,7 @@
Implementation should be thread-safe. Example usage: * - *
+ * {@code
* static class MyNotificationCallback
- * extends GsonNotificationCallback{@literal <}ListResponse{@literal >} {
+ * extends GsonNotificationCallback{@literal <}ListResponse{@literal >} {
*
- * private static final long serialVersionUID = 1L;
+ * private static final long serialVersionUID = 1L;
*
- * {@literal @}Override
- * protected void onNotification(
- * StoredChannel channel, TypedNotification{@literal <}ListResponse{@literal >} notification) {
- * ListResponse content = notification.getContent();
- * switch (notification.getResourceState()) {
- * case ResourceStates.SYNC:
- * break;
- * case ResourceStates.EXISTS:
- * break;
- * case ResourceStates.NOT_EXISTS:
- * break;
- * }
- * }
+ * {@literal @}Override
+ * protected void onNotification(StoredChannel channel,
+ * TypedNotification{@literal <}ListResponse{@literal >} notification) {
+ * ListResponse content = notification.getContent();
+ * switch (notification.getResourceState()) {
+ * case ResourceStates.SYNC:
+ * break;
+ * case ResourceStates.EXISTS:
+ * break;
+ * case ResourceStates.NOT_EXISTS:
+ * break;
+ * }
+ * }
*
- * {@literal @}Override
- * protected Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
- * return ListResponse.class;
- * }
+ * {@literal @}Override
+ * protected Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
+ * return ListResponse.class;
+ * }
* }
- *
+ * }
*
* @param Implementation should be thread-safe. Example usage: * - *
+ * {@code
* static class MyNotificationCallback
- * extends JacksonNotificationCallback{@literal <}ListResponse{@literal >} {
+ * extends JacksonNotificationCallback{@literal <}ListResponse{@literal >} {
*
- * private static final long serialVersionUID = 1L;
+ * private static final long serialVersionUID = 1L;
*
- * {@literal @}Override
- * protected void onNotification(
- * StoredChannel channel, TypedNotification{@literal <}ListResponse{@literal >} notification) {
- * ListResponse content = notification.getContent();
- * switch (notification.getResourceState()) {
- * case ResourceStates.SYNC:
- * break;
- * case ResourceStates.EXISTS:
- * break;
- * case ResourceStates.NOT_EXISTS:
- * break;
- * }
- * }
+ * {@literal @}Override
+ * protected void onNotification(StoredChannel channel,
+ * TypedNotification{@literal <}ListResponse{@literal >} notification) {
+ * ListResponse content = notification.getContent();
+ * switch (notification.getResourceState()) {
+ * case ResourceStates.SYNC:
+ * break;
+ * case ResourceStates.EXISTS:
+ * break;
+ * case ResourceStates.NOT_EXISTS:
+ * break;
+ * }
+ * }
*
- * {@literal @}Override
- * protected Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
- * return ListResponse.class;
- * }
+ * {@literal @}Override
+ * protected Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
+ * return ListResponse.class;
+ * }
* }
- *
+ * }
*
* @param Example usage: * - *
- *
+ * {@code
* request.queue(batchRequest, new BatchCallback{@literal <}SomeResponseType, Void{@literal >}() {
*
- * public void onSuccess(SomeResponseType content, HttpHeaders responseHeaders) {
- * log("Success");
- * }
+ * public void onSuccess(SomeResponseType content, HttpHeaders responseHeaders) {
+ * log("Success");
+ * }
*
- * public void onFailure(Void unused, HttpHeaders responseHeaders) {
- * log(e.getMessage());
- * }
+ * public void onFailure(Void unused, HttpHeaders responseHeaders) {
+ * log(e.getMessage());
+ * }
* });
- *
+ * }
*
* @param batchRequest batch request container
* @param callback batch callback
diff --git a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/CommonGoogleProtoClientRequestInitializer.java b/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/CommonGoogleProtoClientRequestInitializer.java
index 633cecc5c..c8bf4207d 100644
--- a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/CommonGoogleProtoClientRequestInitializer.java
+++ b/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/CommonGoogleProtoClientRequestInitializer.java
@@ -26,47 +26,47 @@
*
* The simplest usage is to use it to set the key parameter: * - *
+ * {@code
* public static final GoogleClientRequestInitializer KEY_INITIALIZER =
- * new CommonGoogleProtoClientRequestInitializer(KEY);
- *
+ * new CommonGoogleProtoClientRequestInitializer(KEY);
+ * }
*
* There is also a constructor to set both the key and userIp parameters: * - *
+ * {@code
* public static final GoogleClientRequestInitializer INITIALIZER =
- * new CommonGoogleProtoClientRequestInitializer(KEY, USER_IP);
- *
+ * new CommonGoogleProtoClientRequestInitializer(KEY, USER_IP);
+ * }
*
* If you want to implement custom logic, extend it like this: * - *
+ * {@code
* public static class MyRequestInitializer extends CommonGoogleProtoClientRequestInitializer {
*
- * {@literal @}Override
- * public void initialize(AbstractGoogleProtoClientRequest{@literal <}?{@literal >} request)
- * throws IOException {
- * // custom logic
+ * {@literal @}Override
+ * public void initialize(AbstractGoogleProtoClientRequest{@literal <}?{@literal >} request)
+ * throws IOException {
+ * // custom logic
+ * }
* }
- * }
- *
+ * }
*
* Finally, to set the key and userIp parameters and insert custom logic, extend it like this: * - *
+ * {@code
* public static class MyKeyRequestInitializer extends CommonGoogleProtoClientRequestInitializer {
*
- * public MyKeyRequestInitializer() {
- * super(KEY, USER_IP);
- * }
+ * public MyKeyRequestInitializer() {
+ * super(KEY, USER_IP);
+ * }
*
- * {@literal @}Override
- * public void initializeProtoRequest(
- * AbstractGoogleProtoClientRequest{@literal <}?{@literal >} request) throws IOException {
- * // custom logic
- * }
+ * {@literal @}Override
+ * public void initializeProtoRequest(
+ * AbstractGoogleProtoClientRequest{@literal <}?{@literal >} request) throws IOException {
+ * // custom logic
+ * }
* }
- *
+ * }
*
* Subclasses should be thread-safe.
*
diff --git a/google-api-client-servlet/pom.xml b/google-api-client-servlet/pom.xml
index bbfa48034..a8011c43f 100644
--- a/google-api-client-servlet/pom.xml
+++ b/google-api-client-servlet/pom.xml
@@ -4,7 +4,7 @@
+ * {@code
* public class MyNotificationServlet extends NotificationServlet {
*
- * private static final long serialVersionUID = 1L;
+ * private static final long serialVersionUID = 1L;
*
- * public MyNotificationServlet() throws IOException {
- * super(new SomeDataStoreFactory());
+ * public MyNotificationServlet() throws IOException {
+ * super(new SomeDataStoreFactory());
+ * }
* }
- * }
- *
+ * }
*
* Sample web.xml setup:
*
- *
+ * {@code
* {@literal <}servlet{@literal >}
* {@literal <}servlet-name{@literal >}MyNotificationServlet{@literal <}/servlet-name{@literal >}
* {@literal <}servlet-class{@literal >}com.mypackage.MyNotificationServlet{@literal <}/servlet-class{@literal >}
@@ -58,7 +58,7 @@
* {@literal <}servlet-name{@literal >}MyNotificationServlet{@literal <}/servlet-name{@literal >}
* {@literal <}url-pattern{@literal >}/notifications{@literal <}/url-pattern{@literal >}
* {@literal <}/servlet-mapping{@literal >}
- *
+ * }
*
* WARNING: by default it uses {@link MemoryDataStoreFactory#getDefaultInstance()} which means it * will NOT persist the notification channels when the servlet process dies, so it is a BAD CHOICE @@ -66,7 +66,7 @@ * you don't need to override it, and can simply reference it directly in your web.xml file. For * example: * - *
+ * {@code
* {@literal <}servlet{@literal >}
* {@literal <}servlet-name{@literal >}NotificationServlet{@literal <}/servlet-name{@literal >}
* {@literal <}servlet-class{@literal >}com.google.api.client.googleapis.extensions.servlet.notificationsNotificationServlet{@literal <}/servlet-class{@literal >}
@@ -75,7 +75,7 @@
* {@literal <}servlet-name{@literal >}NotificationServlet{@literal <}/servlet-name{@literal >}
* {@literal <}url-pattern{@literal >}/notifications{@literal <}/url-pattern{@literal >}
* {@literal <}/servlet-mapping{@literal >}
- *
+ * }
*
* @author Yaniv Inbar
* @since 1.16
diff --git a/google-api-client-xml/pom.xml b/google-api-client-xml/pom.xml
index 12783a7cc..d75c55bbe 100644
--- a/google-api-client-xml/pom.xml
+++ b/google-api-client-xml/pom.xml
@@ -4,7 +4,7 @@
Sample usage: * - *
- *
+ * {@code
* static void setContent(
- * HttpRequest request, XmlNamespaceDictionary namespaceDictionary, Object patchEntry) {
- * request.setContent(new AtomPatchContent(namespaceDictionary, patchEntry));
+ * HttpRequest request, XmlNamespaceDictionary namespaceDictionary, Object patchEntry) {
+ * request.setContent(new AtomPatchContent(namespaceDictionary, patchEntry));
* }
- *
- *
+ * }
*
* Implementation is not thread-safe. * diff --git a/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/AtomPatchRelativeToOriginalContent.java b/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/AtomPatchRelativeToOriginalContent.java index 706d9e53f..c89045675 100644 --- a/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/AtomPatchRelativeToOriginalContent.java +++ b/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/AtomPatchRelativeToOriginalContent.java @@ -31,15 +31,14 @@ * *
Sample usage: * - *
- *
- * static void setContent(HttpRequest request, XmlNamespaceDictionary namespaceDictionary,
- * Object originalEntry, Object patchedEntry) {
- * request.setContent(
- * new AtomPatchRelativeToOriginalContent(namespaceDictionary, originalEntry, patchedEntry));
+ * {@code
+ * static void setContent(HttpRequest request,
+ * XmlNamespaceDictionary namespaceDictionary,
+ * Object originalEntry, Object patchedEntry) {
+ * request.setContent(new AtomPatchRelativeToOriginalContent(
+ * namespaceDictionary, originalEntry, patchedEntry));
* }
- *
- *
+ * }
*
* @since 1.0
* @author Yaniv Inbar
diff --git a/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/package-info.java b/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/package-info.java
index ae69d6f60..67082c535 100644
--- a/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/package-info.java
+++ b/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/package-info.java
@@ -40,7 +40,7 @@
* Let's take a look at a typical partial Atom XML album feed from the Picasa Web Albums Data * API: * - *
+ * {@code
* <?xml version='1.0' encoding='utf-8'?>
* <feed xmlns='http://www.w3.org/2005/Atom'
* xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/'
@@ -60,151 +60,150 @@
* <gphoto:access>public</gphoto:access>
* </entry>
* </feed>
- *
+ * }
*
* Here's one possible way to design the Java data classes for this (each class in its own Java * file): * - *
+ * {@code
* import com.google.api.client.util.*;
* import java.util.List;
*
* public class Link {
*
- * @Key("@href")
- * public String href;
- *
- * @Key("@rel")
- * public String rel;
- *
- * public static String find(List<Link> links, String rel) {
- * if (links != null) {
- * for (Link link : links) {
- * if (rel.equals(link.rel)) {
- * return link.href;
- * }
- * }
- * }
- * return null;
- * }
+ * @Key("@href")
+ * public String href;
+ *
+ * @Key("@rel")
+ * public String rel;
+ *
+ * public static String find(List<Link> links, String rel) {
+ * if (links != null) {
+ * for (Link link : links) {
+ * if (rel.equals(link.rel)) {
+ * return link.href;
+ * }
+ * }
+ * }
+ * return null;
+ * }
* }
*
* public class Category {
*
- * @Key("@scheme")
- * public String scheme;
+ * @Key("@scheme")
+ * public String scheme;
*
- * @Key("@term")
- * public String term;
+ * @Key("@term")
+ * public String term;
*
- * public static Category newKind(String kind) {
- * Category category = new Category();
- * category.scheme = "http://schemas.google.com/g/2005#kind";
- * category.term = "http://schemas.google.com/photos/2007#" + kind;
- * return category;
- * }
+ * public static Category newKind(String kind) {
+ * Category category = new Category();
+ * category.scheme = "http://schemas.google.com/g/2005#kind";
+ * category.term = "http://schemas.google.com/photos/2007#" + kind;
+ * return category;
+ * }
* }
*
* public class AlbumEntry {
*
- * @Key
- * public String summary;
+ * @Key
+ * public String summary;
*
- * @Key
- * public String title;
+ * @Key
+ * public String title;
*
- * @Key("gphoto:access")
- * public String access;
+ * @Key("gphoto:access")
+ * public String access;
*
- * public Category category = newKind("album");
+ * public Category category = newKind("album");
*
- * private String getEditLink() {
- * return Link.find(links, "edit");
- * }
+ * private String getEditLink() {
+ * return Link.find(links, "edit");
+ * }
* }
*
* public class Author {
*
- * @Key
- * public String name;
+ * @Key
+ * public String name;
* }
*
* public class AlbumFeed {
*
- * @Key
- * public Author author;
+ * @Key
+ * public Author author;
*
- * @Key("openSearch:totalResults")
- * public int totalResults;
+ * @Key("openSearch:totalResults")
+ * public int totalResults;
*
- * @Key("entry")
- * public List<AlbumEntry> photos;
+ * @Key("entry")
+ * public List<AlbumEntry> photos;
*
- * @Key("link")
- * public List<Link> links;
+ * @Key("link")
+ * public List<Link> links;
*
- * private String getPostLink() {
- * return Link.find(links, "http://schemas.google.com/g/2005#post");
- * }
+ * private String getPostLink() {
+ * return Link.find(links, "http://schemas.google.com/g/2005#post");
+ * }
* }
- *
+ * }
*
* You can also use the @{@link com.google.api.client.util.Key} annotation to defined query * parameters for a URL. For example: * - *
+ * {@code
* public class PicasaUrl extends GoogleUrl {
*
- * @Key("max-results")
- * public Integer maxResults;
+ * @Key("max-results")
+ * public Integer maxResults;
*
- * @Key
- * public String kinds;
+ * @Key
+ * public String kinds;
*
- * public PicasaUrl(String url) {
- * super(url);
- * }
+ * public PicasaUrl(String url) {
+ * super(url);
+ * }
*
- * public static PicasaUrl fromRelativePath(String relativePath) {
- * PicasaUrl result = new PicasaUrl(PicasaWebAlbums.ROOT_URL);
- * result.path += relativePath;
- * return result;
- * }
+ * public static PicasaUrl fromRelativePath(String relativePath) {
+ * PicasaUrl result = new PicasaUrl(PicasaWebAlbums.ROOT_URL);
+ * result.path += relativePath;
+ * return result;
+ * }
* }
- *
+ * }
*
* To work with a Google API, you first need to set up the {@link * com.google.api.client.http.HttpTransport}. For example: * - *
+ * {@code
* private static HttpTransport setUpTransport() throws IOException {
- * HttpTransport result = new NetHttpTransport();
- * GoogleUtils.useMethodOverride(result);
- * HttpHeaders headers = new HttpHeaders();
- * headers.setApplicationName("Google-PicasaSample/1.0");
- * headers.gdataVersion = "2";
- * AtomParser parser = new AtomParser();
- * parser.namespaceDictionary = PicasaWebAlbumsAtom.NAMESPACE_DICTIONARY;
- * transport.addParser(parser);
- * // insert authentication code...
- * return transport;
+ * HttpTransport result = new NetHttpTransport();
+ * GoogleUtils.useMethodOverride(result);
+ * HttpHeaders headers = new HttpHeaders();
+ * headers.setApplicationName("Google-PicasaSample/1.0");
+ * headers.gdataVersion = "2";
+ * AtomParser parser = new AtomParser();
+ * parser.namespaceDictionary = PicasaWebAlbumsAtom.NAMESPACE_DICTIONARY;
+ * transport.addParser(parser);
+ * // insert authentication code...
+ * return transport;
* }
- *
+ * }
*
* Now that we have a transport, we can execute a partial GET request to the Picasa Web Albums * API and parse the result: * - *
- * public static AlbumFeed executeGet(HttpTransport transport, PicasaUrl url)
- * throws IOException {
- * url.fields = GoogleAtom.getFieldsFor(AlbumFeed.class);
- * url.kinds = "photo";
- * url.maxResults = 5;
- * HttpRequest request = transport.buildGetRequest();
- * request.url = url;
- * return request.execute().parseAs(AlbumFeed.class);
+ * {@code
+ * public static AlbumFeed executeGet(HttpTransport transport, PicasaUrl url) throws IOException {
+ * url.fields = GoogleAtom.getFieldsFor(AlbumFeed.class);
+ * url.kinds = "photo";
+ * url.maxResults = 5;
+ * HttpRequest request = transport.buildGetRequest();
+ * request.url = url;
+ * return request.execute().parseAs(AlbumFeed.class);
* }
- *
+ * }
*
* If the server responds with an error the {@link * com.google.api.client.http.HttpRequest#execute} method will throw an {@link @@ -212,74 +211,72 @@ * com.google.api.client.http.HttpResponse} field which can be parsed the same way as a success * response inside of a catch block. For example: * - *
+ * {@code
* try {
- * ...
+ * ...
* } catch (HttpResponseException e) {
- * if (e.response.getParser() != null) {
- * Error error = e.response.parseAs(Error.class);
- * // process error response
- * } else {
- * String errorContentString = e.response.parseAsString();
- * // process error response as string
- * }
- * throw e;
+ * if (e.response.getParser() != null) {
+ * Error error = e.response.parseAs(Error.class);
+ * // process error response
+ * } else {
+ * String errorContentString = e.response.parseAsString();
+ * // process error response as string
+ * }
+ * throw e;
* }
- *
+ * }
*
* To update an album, we use the transport to execute an efficient partial update request using * the PATCH method to the Picasa Web Albums API: * - *
- * public AlbumEntry executePatchRelativeToOriginal(HttpTransport transport,
- * AlbumEntry original) throws IOException {
- * HttpRequest request = transport.buildPatchRequest();
- * request.setUrl(getEditLink());
- * request.headers.ifMatch = etag;
- * AtomPatchRelativeToOriginalContent content =
- * new AtomPatchRelativeToOriginalContent();
- * content.namespaceDictionary = PicasaWebAlbumsAtom.NAMESPACE_DICTIONARY;
- * content.originalEntry = original;
- * content.patchedEntry = this;
- * request.content = content;
- * return request.execute().parseAs(AlbumEntry.class);
+ * {@code
+ * public AlbumEntry executePatchRelativeToOriginal
+ * (HttpTransport transport, AlbumEntry original) throws IOException {
+ * HttpRequest request = transport.buildPatchRequest();
+ * request.setUrl(getEditLink());
+ * request.headers.ifMatch = etag;
+ * AtomPatchRelativeToOriginalContent content = new AtomPatchRelativeToOriginalContent();
+ * content.namespaceDictionary = PicasaWebAlbumsAtom.NAMESPACE_DICTIONARY;
+ * content.originalEntry = original;
+ * content.patchedEntry = this;
+ * request.content = content;
+ * return request.execute().parseAs(AlbumEntry.class);
* }
*
- * private static AlbumEntry updateTitle(HttpTransport transport,
- * AlbumEntry album) throws IOException {
- * AlbumEntry patched = album.clone();
- * patched.title = "An alternate title";
- * return patched.executePatchRelativeToOriginal(transport, album);
+ * private static AlbumEntry updateTitle
+ * (HttpTransport transport, AlbumEntry album) throws IOException {
+ * AlbumEntry patched = album.clone();
+ * patched.title = "An alternate title";
+ * return patched.executePatchRelativeToOriginal(transport, album);
* }
- *
+ * }
*
* To insert an album, we use the transport to execute a POST request to the Picasa Web Albums * API: * - *
- * public AlbumEntry insertAlbum(HttpTransport transport, AlbumEntry entry)
- * throws IOException {
- * HttpRequest request = transport.buildPostRequest();
- * request.setUrl(getPostLink());
- * AtomContent content = new AtomContent();
- * content.namespaceDictionary = PicasaWebAlbumsAtom.NAMESPACE_DICTIONARY;
- * content.entry = entry;
- * request.content = content;
- * return request.execute().parseAs(AlbumEntry.class);
+ * {@code
+ * public AlbumEntry insertAlbum(HttpTransport transport, AlbumEntry entry) throws IOException {
+ * HttpRequest request = transport.buildPostRequest();
+ * request.setUrl(getPostLink());
+ * AtomContent content = new AtomContent();
+ * content.namespaceDictionary = PicasaWebAlbumsAtom.NAMESPACE_DICTIONARY;
+ * content.entry = entry;
+ * request.content = content;
+ * return request.execute().parseAs(AlbumEntry.class);
* }
- *
+ * }
*
* To delete an album, we use the transport to execute a DELETE request to the Picasa Web Albums * API: * - *
+ * {@code
* public void executeDelete(HttpTransport transport) throws IOException {
- * HttpRequest request = transport.buildDeleteRequest();
- * request.setUrl(getEditLink());
- * request.headers.ifMatch = etag;
- * request.execute().ignore();
+ * HttpRequest request = transport.buildDeleteRequest();
+ * request.setUrl(getEditLink());
+ * request.headers.ifMatch = etag;
+ * request.execute().ignore();
* }
- *
+ * }
*
* NOTE: As you might guess, the library uses reflection to populate the user-defined data model.
* It's not quite as fast as writing the wire format parsing code yourself can potentially be, but
diff --git a/google-api-client/pom.xml b/google-api-client/pom.xml
index 5cd1a6a84..4533f039a 100644
--- a/google-api-client/pom.xml
+++ b/google-api-client/pom.xml
@@ -4,7 +4,7 @@
Sample usage, taking advantage that this class implements {@link HttpRequestInitializer}:
*
- * If you have a custom request initializer, take a look at the sample usage for {@link
* HttpExecuteInterceptor}, which this class also implements.
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeRequestUrl.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeRequestUrl.java
index 7e59e0af1..6049c2842 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeRequestUrl.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeRequestUrl.java
@@ -34,16 +34,17 @@
*
* Sample usage for a web application:
*
- * Implementation is not thread-safe.
*
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeTokenRequest.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeTokenRequest.java
index ff05084a9..bf40cb806 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeTokenRequest.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeTokenRequest.java
@@ -29,9 +29,9 @@
/**
* Google-specific implementation of the OAuth 2.0 request for an access token based on an
- * authorization code (as specified in Using OAuth 2.0 for Web
- * Server Applications).
+ * authorization code (as specified in Using OAuth 2.0 for Web Server
+ * Applications).
*
* Use {@link GoogleCredential} to access protected resources from the resource server using the
* {@link TokenResponse} returned by {@link #execute()}. On error, it will instead throw {@link
@@ -39,30 +39,30 @@
*
* Sample usage:
*
- * Implementation is not thread-safe.
*
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleBrowserClientRequestUrl.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleBrowserClientRequestUrl.java
index 8ba70afce..1e266585e 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleBrowserClientRequestUrl.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleBrowserClientRequestUrl.java
@@ -30,15 +30,15 @@
*
* Sample usage for a web application:
*
- * Implementation is not thread-safe.
*
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleClientSecrets.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleClientSecrets.java
index cc82cc35f..c20780aa0 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleClientSecrets.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleClientSecrets.java
@@ -29,7 +29,7 @@
*
* Sample usage:
*
- * If you have a refresh token, it is similar to the case of access token only, but you
* additionally need to pass the credential the client secrets using {@link
@@ -82,61 +82,55 @@
* server URL, and {@link ClientParametersAuthentication} with the client ID and secret as the
* client authentication. Sample usage:
*
- * The service account
- * flow is used when you want to access data owned by your client application. You download the
- * private key in a {@code .p12} file from the Google APIs Console. Use {@link
+ * The service
+ * account flow is used when you want to access data owned by your client application. You
+ * download the private key in a {@code .p12} file from the Google APIs Console. Use {@link
* Builder#setServiceAccountId(String)}, {@link
* Builder#setServiceAccountPrivateKeyFromP12File(File)}, and {@link
* Builder#setServiceAccountScopes(Collection)}. Sample usage:
*
- * You can also use the service account flow to impersonate a user in a domain that you own. This
* is very similar to the service account flow above, but you additionally call {@link
* Builder#setServiceAccountUser(String)}. Sample usage:
*
- * If you need to persist the access token in a data store, use {@link DataStoreFactory} and
* {@link Builder#addRefreshListener(CredentialRefreshListener)} with {@link
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenVerifier.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenVerifier.java
index f10bdac3f..7592d075c 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenVerifier.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenVerifier.java
@@ -39,13 +39,15 @@
* of the {@link GooglePublicKeysManager} since that way the Google public keys are cached. Sample
* usage:
*
- * Sample usage:
*
- * Implementation is not thread-safe.
*
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/BatchCallback.java b/google-api-client/src/main/java/com/google/api/client/googleapis/batch/BatchCallback.java
index f0fc05448..efad4717f 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/BatchCallback.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/batch/BatchCallback.java
@@ -22,20 +22,20 @@
*
* Sample use:
*
- * Sample use:
*
- * The content of each individual response is stored in memory. There is thus a potential of
* encountering an {@link OutOfMemoryError} for very large responses.
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/json/JsonBatchCallback.java b/google-api-client/src/main/java/com/google/api/client/googleapis/batch/json/JsonBatchCallback.java
index 563f20cb7..53f252e89 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/json/JsonBatchCallback.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/batch/json/JsonBatchCallback.java
@@ -25,20 +25,19 @@
*
* Sample use:
*
- * Sample usage:
*
- * Implementation is immutable and thread-safe.
*
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/javanet/GoogleNetHttpTransport.java b/google-api-client/src/main/java/com/google/api/client/googleapis/javanet/GoogleNetHttpTransport.java
index e6099014e..66907fc72 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/javanet/GoogleNetHttpTransport.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/javanet/GoogleNetHttpTransport.java
@@ -44,14 +44,14 @@ public class GoogleNetHttpTransport {
* as the ability to specify a proxy. To do use, use {@link
* com.google.api.client.http.javanet.NetHttpTransport.Builder}, for example:
*
- * To execute a request, call {@link #execute(JsonFactory, HttpRequest)}. This will throw a
* {@link GoogleJsonResponseException} on an error response. To get the structured details, use
* {@link #getDetails()}.
*
- * User-defined Partial JSON data models allow you to defined Plain Old Java Objects (POJO's) to
- * define how the library should parse/serialize JSON. Each field that should be included must have
- * an @{@link com.google.api.client.util.Key} annotation. The field can be of any visibility
- * (private, package private, protected, or public) and must not be static. By default, the field
- * name is used as the JSON key. To override this behavior, simply specify the JSON key use the
- * optional value parameter of the annotation, for example {@code @Key("name")}. Any unrecognized
- * keys from the JSON are normally simply ignored and not stored. If the ability to store unknown
- * keys is important, use {@link com.google.api.client.json.GenericJson}.
- *
- * Let's take a look at a typical partial JSON-C video feed from the YouTube Data API (as
- * specified in YouTube
+ *
+ * User-defined Partial JSON data models allow you to defined Plain Old Java
+ * Objects (POJO's) to define how the library should parse/serialize JSON. Each
+ * field that should be included must have
+ * an @{@link com.google.api.client.util.Key} annotation. The field can be of
+ * any visibility (private, package private, protected, or public) and must not
+ * be static. By default, the field name is used as the JSON key. To override
+ * this behavior, simply specify the JSON key use the optional value parameter
+ * of the annotation, for example {@code @Key("name")}. Any unrecognized keys
+ * from the JSON are normally simply ignored and not stored. If the ability to
+ * store unknown keys is important, use
+ * {@link com.google.api.client.json.GenericJson}.
+ *
+ *
+ * Let's take a look at a typical partial JSON-C video feed from the YouTube
+ * Data API (as specified in YouTube
* Developer's Guide: JSON-C / JavaScript)
*
- * Here's one possible way to design the Java data classes for this (each class in its own Java
- * file):
- *
- *
+ * Here's one possible way to design the Java data classes for this (each class
+ * in its own Java file):
+ *
+ * You can also use the @{@link com.google.api.client.util.Key} annotation to defined query
- * parameters for a URL. For example:
+ *
+ * You can also use the @{@link com.google.api.client.util.Key} annotation to
+ * defined query parameters for a URL. For example:
*
- * To work with the YouTube API, you first need to set up the {@link
+ *
+ * To work with the YouTube API, you first need to set up the {@link
* com.google.api.client.http.HttpTransport}. For example:
*
- * Now that we have a transport, we can execute a request to the YouTube API and parse the
- * result:
+ *
+ * Now that we have a transport, we can execute a request to the YouTube API and
+ * parse the result:
*
- * If the server responds with an error the {@link
+ *
+ * If the server responds with an error the {@link
* com.google.api.client.http.HttpRequest#execute} method will throw an {@link
* com.google.api.client.http.HttpResponseException}, which has an {@link
- * com.google.api.client.http.HttpResponse} field which can be parsed the same way as a success
- * response inside of a catch block. For example:
+ * com.google.api.client.http.HttpResponse} field which can be parsed the same
+ * way as a success response inside of a catch block. For example:
*
- * NOTE: As you might guess, the library uses reflection to populate the user-defined data model.
- * It's not quite as fast as writing the wire format parsing code yourself can potentially be, but
- * it's a lot easier.
+ *
+ * NOTE: As you might guess, the library uses reflection to populate the
+ * user-defined data model. It's not quite as fast as writing the wire format
+ * parsing code yourself can potentially be, but it's a lot easier.
*
- * NOTE: If you prefer to use your favorite JSON parsing library instead (there are many of them
- * listed for example on json.org), that's supported as well. Just
- * call {@link com.google.api.client.http.HttpRequest#execute()} and parse the returned byte stream.
+ *
+ * NOTE: If you prefer to use your favorite JSON parsing library instead (there
+ * are many of them listed for example on
+ * json.org), that's supported as well. Just call
+ * {@link com.google.api.client.http.HttpRequest#execute()} and parse the
+ * returned byte stream.
*
* @since 1.0
+ *
* @author Yaniv Inbar
*/
package com.google.api.client.googleapis.json;
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpDownloaderProgressListener.java b/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpDownloaderProgressListener.java
index 639556024..199f4dfed 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpDownloaderProgressListener.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpDownloaderProgressListener.java
@@ -21,22 +21,22 @@
*
* Sample usage:
*
- * If an error is encountered during the request execution the caller is responsible for
* parsing the response correctly. For example for JSON errors:
*
- * Callers should call {@link HttpResponse#disconnect} when the returned HTTP response object
* is no longer needed. However, {@link HttpResponse#disconnect} does not have to be called if the
* response stream is properly closed. Example usage:
*
- * Sample usage (if media content length is provided, else consider using {@link
* MediaHttpUploader#getNumBytesUploaded} instead of {@link MediaHttpUploader#getProgress}:
*
- * Implementation should be thread-safe. Example usage:
*
- * Should be thread-safe as several notifications might be processed at the same time. Example
* usage:
*
- * Implementation should be thread-safe. Example usage:
*
- * Must be called before the Google client request is executed, preferably right after the
* request is instantiated. Sample usage:
*
- * Subclasses may override by calling the super implementation.
*
@@ -183,12 +183,12 @@ protected void initialize(AbstractGoogleClientRequest> httpClientRequest) thro
*
* Sample usage:
*
- * Sample usage:
*
- * Callers are responsible for disconnecting the HTTP response by calling {@link
* HttpResponse#disconnect}. Example usage:
*
- * Subclasses may override by calling the super implementation.
*
@@ -461,14 +461,14 @@ public HttpResponse executeUnparsed() throws IOException {
* Callers are responsible for disconnecting the HTTP response by calling {@link
* HttpResponse#disconnect}. Example usage:
*
- * Subclasses may override by calling the super implementation.
*
@@ -487,10 +487,10 @@ protected HttpResponse executeMedia() throws IOException {
* be empty and ignored. Calls {@link HttpResponse#ignore()} so there is no need to disconnect the
* response. Example usage:
*
- * Subclasses may override by calling the super implementation.
*
@@ -571,14 +571,14 @@ public T execute() throws IOException {
*
* Callers are responsible for closing the input stream after it is processed. Example sample:
*
- * Subclasses may override by calling the super implementation.
*
@@ -594,14 +594,14 @@ public InputStream executeAsInputStream() throws IOException {
*
* Callers are responsible for closing the input stream after it is processed. Example sample:
*
- * Subclasses may override by calling the super implementation.
*
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/services/CommonGoogleClientRequestInitializer.java b/google-api-client/src/main/java/com/google/api/client/googleapis/services/CommonGoogleClientRequestInitializer.java
index 7491a10f7..f26572c42 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/CommonGoogleClientRequestInitializer.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/services/CommonGoogleClientRequestInitializer.java
@@ -20,53 +20,53 @@
*
* The simplest usage is to use it to set the key parameter:
*
- * There is also a constructor to set both the key and userIp parameters:
*
- * If you want to implement custom logic, extend it like this:
*
- * Finally, to set the key and userIp parameters and insert custom logic, extend it like this:
*
- * Subclasses should be thread-safe.
*
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/services/GoogleClientRequestInitializer.java b/google-api-client/src/main/java/com/google/api/client/googleapis/services/GoogleClientRequestInitializer.java
index f8bcf90db..8644a4c39 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/GoogleClientRequestInitializer.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/services/GoogleClientRequestInitializer.java
@@ -19,13 +19,13 @@
*
* For example, this might be used to set a key URL query parameter on all requests:
*
- * Implementations should be thread-safe.
*
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/AbstractGoogleJsonClientRequest.java b/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/AbstractGoogleJsonClientRequest.java
index a1f2d3694..f0fb5a98d 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/AbstractGoogleJsonClientRequest.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/AbstractGoogleJsonClientRequest.java
@@ -92,18 +92,18 @@ public AbstractGoogleJsonClientRequest Example usage:
*
- * The simplest usage is to use it to set the key parameter:
*
- * There is also a constructor to set both the key and userIp parameters:
*
- * If you want to implement custom logic, extend it like this:
*
- * Finally, to set the key and userIp parameters and insert custom logic, extend it like this:
*
- * Subclasses should be thread-safe.
*
diff --git a/owlbot.py b/owlbot.py
index 75a649885..d6da82cca 100644
--- a/owlbot.py
+++ b/owlbot.py
@@ -30,5 +30,6 @@
"license-checks.xml",
".github/workflows/ci.yaml",
".github/workflows/samples.yaml",
+ "clirr-ignored-differences.xml"
]
)
diff --git a/pom.xml b/pom.xml
index 49a9c39d6..ffdc5959e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
+ *
*
* {@code
* public static HttpRequestFactory createRequestFactory(HttpTransport transport) {
- * return transport.createRequestFactory(new MethodOverride());
+ * return transport.createRequestFactory(new MethodOverride());
* }
- *
+ * }
+ *
*
* {@code
* public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
- * String url =
- * new GoogleAuthorizationCodeRequestUrl("812741506391.apps.googleusercontent.com",
- * "https://oauth2-login-demo.appspot.com/code", Arrays.asList(
- * "https://www.googleapis.com/auth/userinfo.email",
- * "https://www.googleapis.com/auth/userinfo.profile")).setState("/profile").build();
- * response.sendRedirect(url);
+ * String url = new GoogleAuthorizationCodeRequestUrl(
+ * "812741506391.apps.googleusercontent.com",
+ * "https://oauth2-login-demo.appspot.com/code",
+ * Arrays.asList("https://www.googleapis.com/auth/userinfo.email",
+ * "https://www.googleapis.com/auth/userinfo.profile"))
+ * .setState("/profile").build();
+ * response.sendRedirect(url);
* }
- *
+ * }
+ *
*
* {@code
* static void requestAccessToken() throws IOException {
- * try {
- * GoogleTokenResponse response =
- * new GoogleAuthorizationCodeTokenRequest(new NetHttpTransport(), new GsonFactory(),
- * "812741506391.apps.googleusercontent.com", "{client_secret}",
- * "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7", "https://oauth2-login-demo.appspot.com/code")
- * .execute();
- * System.out.println("Access token: " + response.getAccessToken());
- * } catch (TokenResponseException e) {
- * if (e.getDetails() != null) {
- * System.err.println("Error: " + e.getDetails().getError());
- * if (e.getDetails().getErrorDescription() != null) {
- * System.err.println(e.getDetails().getErrorDescription());
+ * try {
+ * GoogleTokenResponse response = new GoogleAuthorizationCodeTokenRequest(
+ * new NetHttpTransport(), new GsonFactory(),
+ * "812741506391.apps.googleusercontent.com", "{client_secret}",
+ * "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7", "https://oauth2-login-demo.appspot.com/code")
+ * .execute();
+ * System.out.println("Access token: " + response.getAccessToken());
+ * } catch (TokenResponseException e) {
+ * if (e.getDetails() != null) {
+ * System.err.println("Error: " + e.getDetails().getError());
+ * if (e.getDetails().getErrorDescription() != null) {
+ * System.err.println(e.getDetails().getErrorDescription());
+ * }
+ * if (e.getDetails().getErrorUri() != null) {
+ * System.err.println(e.getDetails().getErrorUri());
+ * }
+ * } else {
+ * System.err.println(e.getMessage());
+ * }
+ * }
* }
- * if (e.getDetails().getErrorUri() != null) {
- * System.err.println(e.getDetails().getErrorUri());
- * }
- * } else {
- * System.err.println(e.getMessage());
- * }
- * }
- * }
- *
+ * }
+ *
*
* {@code
* public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
- * String url = new GoogleBrowserClientRequestUrl("812741506391.apps.googleusercontent.com",
- * "https://oauth2-login-demo.appspot.com/oauthcallback", Arrays.asList(
- * "https://www.googleapis.com/auth/userinfo.email",
- * "https://www.googleapis.com/auth/userinfo.profile")).setState("/profile").build();
- * response.sendRedirect(url);
+ * String url = new GoogleBrowserClientRequestUrl("812741506391.apps.googleusercontent.com",
+ * "https://oauth2-login-demo.appspot.com/oauthcallback", Arrays.asList(
+ * "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"))
+ * .setState("/profile").build();
+ * response.sendRedirect(url);
* }
- *
+ * }
+ *
*
* @since 1.7
* @author Yaniv Inbar
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.java
index 45f10da08..632b495e6 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.java
@@ -69,11 +69,11 @@
* credential using {@link Builder#setFromTokenResponse(TokenResponse)}. Google credential uses
* {@link BearerToken#authorizationHeaderAccessMethod()} as the access method. Sample usage:
*
- * {@code
* static GoogleClientSecrets loadClientSecretsResource(JsonFactory jsonFactory)
* throws IOException {
* return GoogleClientSecrets.load(
@@ -39,7 +39,7 @@
* )
* );
* }
- *
+ * }
+ *
*
* {@code
* public static GoogleCredential createCredentialWithAccessTokenOnly(TokenResponse tokenResponse) {
- * return new GoogleCredential().setFromTokenResponse(tokenResponse);
+ * return new GoogleCredential().setFromTokenResponse(tokenResponse);
* }
- *
+ * }
- * public static GoogleCredential createCredentialWithRefreshToken(HttpTransport transport,
- * JsonFactory jsonFactory, GoogleClientSecrets clientSecrets, TokenResponse tokenResponse) {
- * return new GoogleCredential.Builder().setTransport(transport)
- * .setJsonFactory(jsonFactory)
- * .setClientSecrets(clientSecrets)
- * .build()
- * .setFromTokenResponse(tokenResponse);
+ *
*
- * {@code
+ * public static GoogleCredential createCredentialWithRefreshToken(
+ * HttpTransport transport, JsonFactory jsonFactory,
+ * GoogleClientSecrets clientSecrets, TokenResponse tokenResponse) {
+ * return new GoogleCredential.Builder().setTransport(transport)
+ * .setJsonFactory(jsonFactory)
+ * .setClientSecrets(clientSecrets)
+ * .build()
+ * .setFromTokenResponse(tokenResponse);
* }
- *
+ * }
- * public static GoogleCredential createCredentialForServiceAccount(
- * HttpTransport transport,
- * JsonFactory jsonFactory,
- * String serviceAccountId,
- * Collection<String> serviceAccountScopes,
- * File p12File) throws GeneralSecurityException, IOException {
- * return new GoogleCredential.Builder().setTransport(transport)
- * .setJsonFactory(jsonFactory)
- * .setServiceAccountId(serviceAccountId)
- * .setServiceAccountScopes(serviceAccountScopes)
- * .setServiceAccountPrivateKeyFromP12File(p12File)
- * .build();
+ *
*
* {@code
+ * public static GoogleCredential createCredentialForServiceAccount(HttpTransport transport,
+ * JsonFactory jsonFactory,
+ * String serviceAccountId, Collection<String> serviceAccountScopes, File p12File)
+ * throws GeneralSecurityException, IOException {
+ * return new GoogleCredential.Builder().setTransport(transport).setJsonFactory(jsonFactory)
+ * .setServiceAccountId(serviceAccountId).setServiceAccountScopes(serviceAccountScopes)
+ * .setServiceAccountPrivateKeyFromP12File(p12File).build();
* }
- *
+ * }
- * public static GoogleCredential createCredentialForServiceAccountImpersonateUser(
- * HttpTransport transport,
- * JsonFactory jsonFactory,
- * String serviceAccountId,
- * Collection<String> serviceAccountScopes,
- * File p12File,
- * String serviceAccountUser) throws GeneralSecurityException, IOException {
- * return new GoogleCredential.Builder().setTransport(transport)
- * .setJsonFactory(jsonFactory)
- * .setServiceAccountId(serviceAccountId)
- * .setServiceAccountScopes(serviceAccountScopes)
- * .setServiceAccountPrivateKeyFromP12File(p12File)
- * .setServiceAccountUser(serviceAccountUser)
- * .build();
+ *
*
* {@code
+ * public static GoogleCredential createCredentialForServiceAccountImpersonateUser
+ * (HttpTransport transport, JsonFactory jsonFactory, String serviceAccountId,
+ * Collection<String> serviceAccountScopes, File p12File,
+ * String serviceAccountUser) throws GeneralSecurityException, IOException {
+ * return new GoogleCredential.Builder()
+ * .setTransport(transport)
+ * .setJsonFactory(jsonFactory)
+ * .setServiceAccountId(serviceAccountId)
+ * .setServiceAccountScopes(serviceAccountScopes)
+ * .setServiceAccountPrivateKeyFromP12File(p12File)
+ * .setServiceAccountUser(serviceAccountUser)
+ * .build();
* }
- *
+ * }
+ *
*
* @since 1.7
*/
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleRefreshTokenRequest.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleRefreshTokenRequest.java
index 55ba20fc0..4bc245d73 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleRefreshTokenRequest.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleRefreshTokenRequest.java
@@ -37,28 +37,29 @@
*
* {@code
* GoogleIdTokenVerifier verifier = new GoogleIdTokenVerifier.Builder(transport, jsonFactory)
- * .setAudience(Arrays.asList("myClientId"))
- * .build();
+ * .setAudience(Arrays.asList("myClientId"))
+ * .build();
+ *
* ...
+ *
* if (!verifier.verify(googleIdToken)) {...}
- *
+ * }
+ *
*
* {@code
* static void refreshAccessToken() throws IOException {
- * try {
- * TokenResponse response =
- * new GoogleRefreshTokenRequest(new NetHttpTransport(), new GsonFactory(),
- * "tGzv3JOkF0XG5Qx2TlKWIA", "s6BhdRkqt3", "7Fjfp0ZBr1KtDRbnfVdmIw").execute();
- * System.out.println("Access token: " + response.getAccessToken());
- * } catch (TokenResponseException e) {
- * if (e.getDetails() != null) {
- * System.err.println("Error: " + e.getDetails().getError());
- * if (e.getDetails().getErrorDescription() != null) {
- * System.err.println(e.getDetails().getErrorDescription());
+ * try {
+ * TokenResponse response = new GoogleRefreshTokenRequest(
+ * new NetHttpTransport(), new GsonFactory(),
+ * "tGzv3JOkF0XG5Qx2TlKWIA", "s6BhdRkqt3",
+ * "7Fjfp0ZBr1KtDRbnfVdmIw").execute();
+ * System.out.println("Access token: " + response.getAccessToken());
+ * } catch (TokenResponseException e) {
+ * if (e.getDetails() != null) {
+ * System.err.println("Error: " + e.getDetails().getError());
+ * if (e.getDetails().getErrorDescription() != null) {
+ * System.err.println(e.getDetails().getErrorDescription());
+ * }
+ * if (e.getDetails().getErrorUri() != null) {
+ * System.err.println(e.getDetails().getErrorUri());
+ * }
+ * } else {
+ * System.err.println(e.getMessage());
+ * }
+ * }
* }
- * if (e.getDetails().getErrorUri() != null) {
- * System.err.println(e.getDetails().getErrorUri());
- * }
- * } else {
- * System.err.println(e.getMessage());
- * }
- * }
- * }
- *
+ * }
+ *
*
* @param {@code
* batch.queue(volumesList.buildHttpRequest(), Volumes.class, GoogleJsonErrorContainer.class,
- * new BatchCallback<Volumes, GoogleJsonErrorContainer>() {
- *
- * public void onSuccess(Volumes volumes, HttpHeaders responseHeaders) {
- * log("Success");
- * printVolumes(volumes.getItems());
- * }
- *
- * public void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders) {
- * log(e.getError().getMessage());
- * }
- * });
- *
+ * new BatchCallback<Volumes, GoogleJsonErrorContainer>() {
+ *
+ * public void onSuccess(Volumes volumes, HttpHeaders responseHeaders) {
+ * log("Success");
+ * printVolumes(volumes.getItems());
+ * }
+ *
+ * public void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders) {
+ * log(e.getError().getMessage());
+ * }
+ * });
+ * }
- * // client is a AbstractGoogleClient (e.g. com.google.api.services.books.Books)
+ *
*
* {@code
+ * // client is a AbstractGoogleClient (e.g.
+ * // com.google.api.services.books.Books)
* BatchRequest batch = client.batch(httpRequestInitializer);
* batch.queue(volumesList, Volumes.class, GoogleJsonErrorContainer.class,
- * new BatchCallback<Volumes, GoogleJsonErrorContainer>() {
+ * new BatchCallback<Volumes, GoogleJsonErrorContainer>() {
*
- * public void onSuccess(Volumes volumes, HttpHeaders responseHeaders) {
- * log("Success");
- * printVolumes(volumes.getItems());
- * }
+ * public void onSuccess(Volumes volumes, HttpHeaders responseHeaders) {
+ * log("Success");
+ * printVolumes(volumes.getItems());
+ * }
*
- * public void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders) {
- * log(e.getError().getMessage());
- * }
- * });
+ * public void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders) {
+ * log(e.getError().getMessage());
+ * }
+ * });
* batch.queue(volumesList, Volumes.class, GoogleJsonErrorContainer.class,
- * new BatchCallback<Volumes, GoogleJsonErrorContainer>() {
+ * new BatchCallback<Volumes, GoogleJsonErrorContainer>() {
*
- * public void onSuccess(Volumes volumes, HttpHeaders responseHeaders) {
- * log("Success");
- * printVolumes(volumes.getItems());
- * }
+ * public void onSuccess(Volumes volumes, HttpHeaders responseHeaders) {
+ * log("Success");
+ * printVolumes(volumes.getItems());
+ * }
*
- * public void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders) {
- * log(e.getError().getMessage());
- * }
- * });
+ * public void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders) {
+ * log(e.getError().getMessage());
+ * }
+ * });
* batch.execute();
- *
+ * }
+ *
*
* @param {@code
* batch.queue(volumesList.buildHttpRequest(), Volumes.class, GoogleJsonErrorContainer.class,
- * new JsonBatchCallback<Volumes>() {
- *
- * public void onSuccess(Volumes volumes, HttpHeaders responseHeaders) {
- * log("Success");
- * printVolumes(volumes.getItems());
- * }
- *
- * public void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) {
- * log(e.getMessage());
- * }
- * });
- *
+ * new JsonBatchCallback<Volumes>() {
+ * public void onSuccess(Volumes volumes, HttpHeaders responseHeaders) {
+ * log("Success");
+ * printVolumes(volumes.getItems());
+ * }
+ *
+ * public void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) {
+ * log(e.getMessage());
+ * }
+ * });
+ * }
- * Google Compute Engine service accounts OAuth 2.0 credential based on Authenticating from Google
- * Compute Engine.
+ * Google Compute Engine service accounts OAuth 2.0 credential based on Authenticating from Google Compute
+ * Engine.
*
*
+ *
*
* {@code
* public static HttpRequestFactory createRequestFactory(
- * HttpTransport transport, JsonFactory jsonFactory) {
- * return transport.createRequestFactory(new GoogleComputeCredential(transport, jsonFactory));
+ * HttpTransport transport, JsonFactory jsonFactory) {
+ * return transport.createRequestFactory(
+ * new GoogleComputeCredential(transport, jsonFactory));
* }
- *
+ * }
+ *
*/
public static NetHttpTransport newTrustedTransport()
throws GeneralSecurityException, IOException {
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/json/GoogleJsonError.java b/google-api-client/src/main/java/com/google/api/client/googleapis/json/GoogleJsonError.java
index 246c3fd1e..c0f0eb86b 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/json/GoogleJsonError.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/json/GoogleJsonError.java
@@ -260,7 +260,7 @@ public void setParameter(String parameter) {
/** Human-readable explanation of the error or {@code null} for none. */
@Key private String message;
- /** Lists type and parameterViolation details of an Exception */
+ /** Lists type and parameterViolation details of an Exception. */
@Key private List{@code
* static HttpTransport newProxyTransport() throws GeneralSecurityException, IOException {
* NetHttpTransport.Builder builder = new NetHttpTransport.Builder();
* builder.trustCertificates(GoogleUtils.getCertificateTrustStore());
* builder.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 3128)));
* return builder.build();
* }
- *
+ * }
+ *
*
* @since 1.6
* @author Yaniv Inbar
@@ -154,14 +154,14 @@ public static GoogleJsonResponseException from(JsonFactory jsonFactory, HttpResp
* is no longer needed. However, {@link HttpResponse#disconnect} does not have to be called if the
* response stream is properly closed. Example usage:
*
- * {@code
* static void executeShowingError(JsonFactory factory, HttpRequest request) throws IOException {
- * try {
- * GoogleJsonResponseException.execute(factory, request);
- * } catch (GoogleJsonResponseException e) {
- * System.err.println(e.getDetails());
+ * try {
+ * GoogleJsonResponseException.execute(factory, request);
+ * } catch (GoogleJsonResponseException e) {
+ * System.err.println(e.getDetails());
+ * }
* }
- * }
- *
+ * }
+ *
*
* @param jsonFactory JSON factory
* @param request HTTP request
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/json/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/json/package-info.java
index d3c81065c..84fe5f78a 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/json/package-info.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/json/package-info.java
@@ -17,151 +17,162 @@
*
* {@code
* HttpResponse response = GoogleJsonResponseException.execute(jsonFactory, request);
* try {
- * // process the HTTP response object
+ * // process the HTTP response object
* } finally {
- * response.disconnect();
+ * response.disconnect();
* }
- *
+ * }Package Specification
*
- *
- *
- *
+ * {@code
* "data":{
- * "updated":"2010-01-07T19:58:42.949Z",
- * "totalItems":800,
- * "startIndex":1,
- * "itemsPerPage":1,
- * "items":[
- * {"id":"hYB0mn5zh2c",
- * "updated":"2010-01-07T13:26:50.000Z",
- * "title":"Google Developers Day US - Maps API Introduction",
- * "description":"Google Maps API Introduction ...",
- * "tags":[
- * "GDD07","GDD07US","Maps"
- * ],
- * "player":{
- * "default":"http://www.youtube.com/watch?v\u003dhYB0mn5zh2c"
- * },
- * ...
- * }
- * ]
- * }
- *
+ *
+ *
+ * "updated":"2010-01-07T19:58:42.949Z",
+ * "totalItems":800,
+ * "startIndex":1,
+ * "itemsPerPage":1,
+ * "items":[
+ * {"id":"hYB0mn5zh2c",
+ * "updated":"2010-01-07T13:26:50.000Z",
+ * "title":"Google Developers Day US - Maps API Introduction",
+ * "description":"Google Maps API Introduction ...",
+ * "tags":[
+ * "GDD07","GDD07US","Maps"],
+ * "player":{
+ * "default":"http://www.youtube.com/watch?v\u003dhYB0mn5zh2c" },
+ * ...
+ * }]}
+ * }{@code
* import com.google.api.client.util.*;
* import java.util.List;
*
* public class VideoFeed {
- * @Key public int itemsPerPage;
- * @Key public int startIndex;
- * @Key public int totalItems;
- * @Key public DateTime updated;
- * @Key public List<Video> items;
+ * @Key public int itemsPerPage;
+ * @Key public int startIndex;
+ * @Key public int totalItems;
+ * @Key public DateTime updated;
+ * @Key public List<Video> items;
* }
*
* public class Video {
- * @Key public String id;
- * @Key public String title;
- * @Key public DateTime updated;
- * @Key public String description;
- * @Key public List<String> tags;
- * @Key public Player player;
+ * @Key public String id;
+ * @Key public String title;
+ * @Key public DateTime updated;
+ * @Key public String description;
+ * @Key public List<String> tags;
+ * @Key public Player player;
* }
*
* public class Player {
- * // "default" is a Java keyword, so need to specify the JSON key manually
- * @Key("default")
- * public String defaultUrl;
+ * // "default" is a Java keyword, so need to specify the JSON key manually
+ * @Key("default")
+ * public String defaultUrl;
* }
- *
+ * }
*
- *
+ * public YouTubeUrl(String encodedUrl) {
+ * super(encodedUrl);
+ * this.alt = "jsonc";
+ * }
+ * }
*
- *
+ * {@code
* public class YouTubeUrl extends GoogleUrl {
*
- * @Key
- * public String author;
+ * @Key
+ * public String author;
*
- * @Key("max-results")
- * public Integer maxResults;
+ * @Key("max-results")
+ * public Integer maxResults;
*
- * public YouTubeUrl(String encodedUrl) {
- * super(encodedUrl);
- * this.alt = "jsonc";
- * }
- *
+ * }
*
- *
+ * {@code
* private static HttpTransport setUpTransport() throws IOException {
- * HttpTransport result = new NetHttpTransport();
- * GoogleUtils.useMethodOverride(result);
- * HttpHeaders headers = new HttpHeaders();
- * headers.setApplicationName("Google-YouTubeSample/1.0");
- * headers.gdataVersion = "2";
- * JsonCParser parser = new JsonCParser();
- * parser.jsonFactory = new GsonFactory();
- * transport.addParser(parser);
- * // insert authentication code...
- * return transport;
+ * HttpTransport result = new NetHttpTransport();
+ * GoogleUtils.useMethodOverride(result);
+ * HttpHeaders headers = new HttpHeaders();
+ * headers.setApplicationName("Google-YouTubeSample/1.0");
+ * headers.gdataVersion = "2";
+ * JsonCParser parser = new JsonCParser();
+ * parser.jsonFactory = new GsonFactory();
+ * transport.addParser(parser);
+ * // insert authentication code...
+ * return transport;
* }
- *
+ * }
*
- *
- * public static VideoFeed list(HttpTransport transport, YouTubeUrl url)
- * throws IOException {
- * HttpRequest request = transport.buildGetRequest();
- * request.url = url;
- * return request.execute().parseAs(VideoFeed.class);
+ * {@code
+ * public static VideoFeed list(HttpTransport transport, YouTubeUrl url) throws IOException {
+ * HttpRequest request = transport.buildGetRequest();
+ * request.url = url;
+ * return request.execute().parseAs(VideoFeed.class);
* }
- *
+ * }
*
- *
+ * {@code
* try {
- * ...
+ * ...
* } catch (HttpResponseException e) {
- * if (e.response.getParser() != null) {
- * Error error = e.response.parseAs(Error.class);
- * // process error response
- * } else {
- * String errorContentString = e.response.parseAsString();
- * // process error response as string
- * }
- * throw e;
+ * if (e.response.getParser() != null) {
+ * Error error = e.response.parseAs(Error.class);
+ * // process error response
+ * } else {
+ * String errorContentString = e.response.parseAsString();
+ * // process error response as string
+ * }
+ * throw e;
* }
- *
+ *
*
* @since 1.9
* @author rmistry@google.com (Ravi Mistry)
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpUploader.java b/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpUploader.java
index 0d85e8e9f..6ea87a96f 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpUploader.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpUploader.java
@@ -277,24 +277,24 @@ public MediaHttpUploader(
* {@code
* public static class MyDownloadProgressListener implements MediaHttpDownloaderProgressListener {
*
- * public void progressChanged(MediaHttpDownloader downloader) throws IOException {
- * switch (downloader.getDownloadState()) {
- * case MEDIA_IN_PROGRESS:
- * System.out.println("Download in progress");
- * System.out.println("Download percentage: " + downloader.getProgress());
- * break;
- * case MEDIA_COMPLETE:
- * System.out.println("Download Completed!");
- * break;
+ * public void progressChanged(MediaHttpDownloader downloader) throws IOException {
+ * switch (downloader.getDownloadState()) {
+ * case MEDIA_IN_PROGRESS:
+ * System.out.println("Download in progress");
+ * System.out.println("Download percentage: " + downloader.getProgress());
+ * break;
+ * case MEDIA_COMPLETE:
+ * System.out.println("Download Completed!");
+ * break;
+ * }
+ * }
* }
- * }
- * }
- *
+ * }
+ *
*
* {@code
* if (!response.isSuccessStatusCode()) {
- * throw GoogleJsonResponseException.from(jsonFactory, response);
+ * throw GoogleJsonResponseException.from(jsonFactory, response);
* }
- *
+ * }
+ *
*
* @param initiationRequestUrl The request URL where the initiation request will be sent
* @return HTTP response
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpUploaderProgressListener.java b/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpUploaderProgressListener.java
index f85708626..6a5c755f0 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpUploaderProgressListener.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpUploaderProgressListener.java
@@ -22,28 +22,28 @@
* {@code
* HttpResponse response = batch.upload(initiationRequestUrl);
* try {
- * // process the HTTP response object
+ * // process the HTTP response object
* } finally {
- * response.disconnect();
+ * response.disconnect();
* }
- *
+ * }
+ *
*
* @since 1.9
* @author rmistry@google.com (Ravi Mistry)
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/mtls/ContextAwareMetadataJson.java b/google-api-client/src/main/java/com/google/api/client/googleapis/mtls/ContextAwareMetadataJson.java
index d900594ac..3612be97a 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/mtls/ContextAwareMetadataJson.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/mtls/ContextAwareMetadataJson.java
@@ -27,7 +27,7 @@
*/
@Beta
public class ContextAwareMetadataJson extends GenericJson {
- /** Cert provider command */
+ /** Cert provider command. */
@Key("cert_provider_command")
private List{@code
* public static class MyUploadProgressListener implements MediaHttpUploaderProgressListener {
*
- * public void progressChanged(MediaHttpUploader uploader) throws IOException {
- * switch (uploader.getUploadState()) {
- * case INITIATION_STARTED:
- * System.out.println("Initiation Started");
- * break;
- * case INITIATION_COMPLETE:
- * System.out.println("Initiation Completed");
- * break;
- * case MEDIA_IN_PROGRESS:
- * System.out.println("Upload in progress");
- * System.out.println("Upload percentage: " + uploader.getProgress());
- * break;
- * case MEDIA_COMPLETE:
- * System.out.println("Upload Completed!");
- * break;
+ * public void progressChanged(MediaHttpUploader uploader) throws IOException {
+ * switch (uploader.getUploadState()) {
+ * case INITIATION_STARTED:
+ * System.out.println("Initiation Started");
+ * break;
+ * case INITIATION_COMPLETE:
+ * System.out.println("Initiation Completed");
+ * break;
+ * case MEDIA_IN_PROGRESS:
+ * System.out.println("Upload in progress");
+ * System.out.println("Upload percentage: " + uploader.getProgress());
+ * break;
+ * case MEDIA_COMPLETE:
+ * System.out.println("Upload Completed!");
+ * break;
+ * }
+ * }
* }
- * }
- * }
- *
+ * }
+ *
*
* @param {@code
* static class MyNotificationCallback
- * extends JsonNotificationCallback{@literal <}ListResponse{@literal >} {
+ * extends JsonNotificationCallback{@literal <}ListResponse{@literal >} {
*
- * private static final long serialVersionUID = 1L;
+ * private static final long serialVersionUID = 1L;
*
- * {@literal @}Override
- * protected void onNotification(
- * StoredChannel subscription, Notification notification, ListResponse content) {
- * switch (notification.getResourceState()) {
- * case ResourceStates.SYNC:
- * break;
- * case ResourceStates.EXISTS:
- * break;
- * case ResourceStates.NOT_EXISTS:
- * break;
- * }
- * }
+ * {@literal @}Override
+ * protected void onNotification
+ * (StoredChannel subscription, Notification notification, ListResponse content) {
+ * switch (notification.getResourceState()) {
+ * case ResourceStates.SYNC:
+ * break;
+ * case ResourceStates.EXISTS:
+ * break;
+ * case ResourceStates.NOT_EXISTS:
+ * break;
+ * }
+ * }
*
- * {@literal @}Override
- * protected ObjectParser getObjectParser(Notification notification) throws IOException {
- * return new JsonObjectParser(new GsonFactory());
- * }
+ * {@literal @}Override
+ * protected ObjectParser getObjectParser(Notification notification) throws IOException {
+ * return new JsonObjectParser(new GsonFactory());
+ * }
*
- * {@literal @}Override
- * protected Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
- * return ListResponse.class;
- * }
+ * {@literal @}Override
+ * protected Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
+ * return ListResponse.class;
+ * }
* }
- *
+ * }
+ *
*
* @author Yaniv Inbar
* @author Matthias Linder (mlinder)
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/json/JsonNotificationCallback.java b/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/json/JsonNotificationCallback.java
index 70658bce7..bc0421017 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/json/JsonNotificationCallback.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/json/JsonNotificationCallback.java
@@ -28,37 +28,37 @@
*
* {@code
* static class MyNotificationCallback implements UnparsedNotificationCallback {
*
- * private static final long serialVersionUID = 1L;
+ * private static final long serialVersionUID = 1L;
*
- * {@literal @}Override
- * public void onNotification(StoredChannel storedChannel, UnparsedNotification notification) {
- * String contentType = notification.getContentType();
- * InputStream contentStream = notification.getContentStream();
- * switch (notification.getResourceState()) {
- * case ResourceStates.SYNC:
- * break;
- * case ResourceStates.EXISTS:
- * break;
- * case ResourceStates.NOT_EXISTS:
- * break;
+ * {@literal @}Override
+ * public void onNotification(StoredChannel storedChannel, UnparsedNotification notification) {
+ * String contentType = notification.getContentType();
+ * InputStream contentStream = notification.getContentStream();
+ * switch (notification.getResourceState()) {
+ * case ResourceStates.SYNC:
+ * break;
+ * case ResourceStates.EXISTS:
+ * break;
+ * case ResourceStates.NOT_EXISTS:
+ * break;
+ * }
+ * }
* }
- * }
- * }
- *
+ * }
+ *
*
* @param {@code
* static class MyNotificationCallback
- * extends JsonNotificationCallback{@literal <}ListResponse{@literal >} {
+ * extends JsonNotificationCallback{@literal <}ListResponse{@literal >} {
*
- * private static final long serialVersionUID = 1L;
+ * private static final long serialVersionUID = 1L;
*
- * {@literal @}Override
- * protected void onNotification(
- * StoredChannel channel, TypedNotification{@literal <}ListResponse{@literal >} notification) {
- * ListResponse content = notification.getContent();
- * switch (notification.getResourceState()) {
- * case ResourceStates.SYNC:
- * break;
- * case ResourceStates.EXISTS:
- * break;
- * case ResourceStates.NOT_EXISTS:
- * break;
- * }
- * }
+ * {@literal @}Override
+ * protected void onNotification(StoredChannel channel,
+ * TypedNotification{@literal <}ListResponse{@literal >} notification) {
+ * ListResponse content = notification.getContent();
+ * switch (notification.getResourceState()) {
+ * case ResourceStates.SYNC:
+ * break;
+ * case ResourceStates.EXISTS:
+ * break;
+ * case ResourceStates.NOT_EXISTS:
+ * break;
+ * }
+ * }
*
- * {@literal @}Override
- * protected JsonFactory getJsonFactory() throws IOException {
- * return new GsonFactory();
- * }
+ * {@literal @}Override
+ * protected JsonFactory getJsonFactory() throws IOException {
+ * return new GsonFactory();
+ * }
*
- * {@literal @}Override
- * protected Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
- * return ListResponse.class;
- * }
+ * {@literal @}Override
+ * protected Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
+ * return ListResponse.class;
+ * }
* }
- *
+ * }
+ *
*
* {@code
* public class Get extends HttpClientRequest {
- * ...
+ * ...
* }
*
* public Get get(String userId) throws IOException {
- * Get result = new Get(userId);
- * initialize(result);
- * return result;
+ * Get result = new Get(userId);
+ * initialize(result);
+ * return result;
* }
- *
+ * }
+ *
*
* @return newly created Batch request
*/
@@ -201,12 +201,12 @@ public final BatchRequest batch() {
*
* {@code
* client.batch()
- * .queue(...)
- * .queue(...)
- * .execute();
- *
+ * .queue(...)
+ * .queue(...)
+ * .execute();
+ * }
+ *
*
* @param httpRequestInitializer The initializer to use when creating the top-level batch HTTP
* request or {@code null} for none
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequest.java b/google-api-client/src/main/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequest.java
index d16a71c5b..72ab6e937 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequest.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequest.java
@@ -438,14 +438,14 @@ public void interceptResponse(HttpResponse response) throws IOException {
* {@code
* client.batch(httpRequestInitializer)
- * .queue(...)
- * .queue(...)
- * .execute();
- *
+ * .queue(...)
+ * .queue(...)
+ * .execute();
+ * }
+ *
*
* {@code
* HttpResponse response = request.executeUnparsed();
* try {
- * // process response..
+ * // process response..
* } finally {
- * response.disconnect();
+ * response.disconnect();
* }
- *
+ * }
+ *
*
* {@code
* HttpResponse response = request.executeMedia();
* try {
- * // process response..
+ * // process response..
* } finally {
- * response.disconnect();
+ * response.disconnect();
* }
- *
+ * }
+ *
*
* {@code
* HttpResponse response = request.executeUsingHead();
* // look at response.getHeaders()
- *
+ * }
+ *
*
* {@code
* InputStream is = request.executeAsInputStream();
* try {
- * // Process input stream..
+ * // Process input stream..
* } finally {
- * is.close();
+ * is.close();
* }
- *
+ * }
+ *
*
* {@code
* InputStream is = request.executeMediaAsInputStream();
* try {
- * // Process input stream..
+ * // Process input stream..
* } finally {
- * is.close();
+ * is.close();
* }
- *
+ * }
+ *
*
* {@code
* public static final GoogleClientRequestInitializer KEY_INITIALIZER =
- * CommonGoogleClientRequestInitializer.newBuilder()
- * .setKey(KEY)
- * .build();
- *
+ * CommonGoogleClientRequestInitializer.newBuilder()
+ * .setKey(KEY)
+ * .build();
+ * }
+ *
*
* {@code
* public static final GoogleClientRequestInitializer INITIALIZER =
* CommonGoogleClientRequestInitializer.newBuilder()
* .setKey(KEY)
* .setUserIp(USER_IP)
* .build();
- *
+ * }
+ *
*
* {@code
* public static class MyRequestInitializer extends CommonGoogleClientRequestInitializer {
*
- * {@literal @}Override
- * public void initialize(AbstractGoogleClientRequest{@literal <}?{@literal >} request)
- * throws IOException {
- * // custom logic
+ * {@literal @}Override
+ * public void initialize
+ * (AbstractGoogleClientRequest{@literal <}?{@literal >} request) throws IOException {
+ * // custom logic
+ * }
* }
- * }
- *
+ * }
+ *
*
* {@code
* public static class MyRequestInitializer2 extends CommonGoogleClientRequestInitializer {
*
- * public MyRequestInitializer2() {
- * super(KEY, USER_IP);
- * }
+ * public MyRequestInitializer2() {
+ * super(KEY, USER_IP);
+ * }
*
- * {@literal @}Override
- * public void initialize(AbstractGoogleClientRequest{@literal <}?{@literal >} request)
- * throws IOException {
- * super.initialize(request); // must be called to set the key and userIp parameters
- * // insert some additional logic
- * }
+ * {@literal @}Override
+ * public void initialize
+ * (AbstractGoogleClientRequest{@literal <}?{@literal >} request) throws IOException {
+ * super.initialize(request); // must be called to set the key and userIp parameters
+ * // insert some additional logic
+ * }
* }
- *
+ * }
+ *
*
* {@code
* public class KeyRequestInitializer implements GoogleClientRequestInitializer {
- * public void initialize(GoogleClientRequest> request) {
- * request.put("key", KEY);
+ * public void initialize(GoogleClientRequest> request) {
+ * request.put("key", KEY);
+ * }
* }
- * }
- *
+ * }
+ *
*
* @param batchRequest batch request container
* @param callback batch callback
diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/CommonGoogleJsonClientRequestInitializer.java b/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/CommonGoogleJsonClientRequestInitializer.java
index 020aba147..c52924b49 100644
--- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/CommonGoogleJsonClientRequestInitializer.java
+++ b/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/CommonGoogleJsonClientRequestInitializer.java
@@ -23,52 +23,52 @@
*
* {@code
* request.queue(batchRequest, new JsonBatchCallback<SomeResponseType>() {
*
- * public void onSuccess(SomeResponseType content, HttpHeaders responseHeaders) {
- * log("Success");
- * }
+ * public void onSuccess(SomeResponseType content, HttpHeaders responseHeaders) {
+ * log("Success");
+ * }
*
- * public void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) {
- * log(e.getMessage());
- * }
+ * public void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) {
+ * log(e.getMessage());
+ * }
* });
- *
+ * }
+ *
*
* {@code
* public static final GoogleClientRequestInitializer KEY_INITIALIZER =
- * CommonGoogleJsonClientRequestInitializer.newBuilder()
- * .setKey(KEY)
- * .build();
- *
+ * CommonGoogleJsonClientRequestInitializer.newBuilder()
+ * .setKey(KEY)
+ * .build();
+ * }
+ *
*
* {@code
* public static final GoogleClientRequestInitializer INITIALIZER =
- * CommonGoogleJsonClientRequestInitializer.newBuilder()
- * .setKey(KEY)
- * .setUserIp(USER_IP)
- * .build();
- *
+ * CommonGoogleJsonClientRequestInitializer.newBuilder()
+ * .setKey(KEY)
+ * .setUserIp(USER_IP)
+ * .build();
+ * }
+ *
*
* {@code
* public static class MyRequestInitializer extends CommonGoogleJsonClientRequestInitializer {
*
- * {@literal @}Override
- * public void initialize(AbstractGoogleJsonClientRequest{@literal <}?{@literal >} request)
- * throws IOException {
- * // custom logic
+ * {@literal @}Override
+ * public void initialize(AbstractGoogleJsonClientRequest{@literal <}?{@literal >} request)
+ * throws IOException {
+ * // custom logic
+ * }
* }
- * }
- *
+ * }
+ *
*
* {@code
* public static class MyKeyRequestInitializer extends CommonGoogleJsonClientRequestInitializer {
*
- * public MyKeyRequestInitializer() {
- * super(KEY, USER_IP);
- * }
+ * public MyKeyRequestInitializer() {
+ * super(KEY, USER_IP);
+ * }
*
- * {@literal @}Override
- * public void initializeJsonRequest(
- * AbstractGoogleJsonClientRequest{@literal <}?{@literal >} request) throws IOException {
- * // custom logic
- * }
+ * {@literal @}Override
+ * public void initializeJsonRequest
+ * (AbstractGoogleJsonClientRequest{@literal <}?{@literal >} request) throws IOException {
+ * // custom logic
+ * }
* }
- *
+ * }