diff --git a/.hgignore b/.hgignore deleted file mode 100644 index 88774422..00000000 --- a/.hgignore +++ /dev/null @@ -1,6 +0,0 @@ - -syntax: regexp -^(.*/)?target$ - -syntax: regexp -^(.*/)?bin$ diff --git a/APIs.md b/APIs.md new file mode 100644 index 00000000..c480d215 --- /dev/null +++ b/APIs.md @@ -0,0 +1,437 @@ +**This content has moved to https://developers.google.com/api-client-library/java/apis/** + +| [Browse All Samples](http://code.google.com/p/google-api-java-client/source/browse?repo=samples) | [Request a New Sample](http://code.google.com/p/google-api-java-client/issues/entry?template=Request%20a%20Sample) | +|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Click on the Google API to download the client library and samples: + + + + +--- + +# ![http://www.google.com/images/icons/feature/filing_cabinet_search-g32.png](http://www.google.com/images/icons/feature/filing_cabinet_search-g32.png) APIs Discovery Service # +**Description:** Lets you discover information about other Google APIs, such as what APIs are available, the resource and method details for each API. + +This content has moved to https://developers.google.com/api-client-library/java/apis#APIs_Discovery_Service + + +--- + +# ![http://www.google.com/images/icons/product/doubleclick-32.gif](http://www.google.com/images/icons/product/doubleclick-32.gif) Ad Exchange Buyer API # +**Description:** Lets you manage your Ad Exchange Buyer account. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Ad_Exchange_Buyer_API + + +--- + +# ![http://www.google.com/images/icons/product/doubleclick-32.gif](http://www.google.com/images/icons/product/doubleclick-32.gif) Ad Exchange Seller API # +**Description:** Gives Ad Exchange seller users access to their inventory and the ability to generate reports + +This content has moved to https://developers.google.com/api-client-library/java/apis#Ad_Exchange_Seller_API + + +--- + +# ![http://www.google.com/images/icons/product/adsense-32.png](http://www.google.com/images/icons/product/adsense-32.png) AdSense Host API # +**Description:** Gives AdSense Hosts access to report generation, ad code generation, and publisher management capabilities. + +This content has moved to https://developers.google.com/api-client-library/java/apis#AdSense_Host_API + + +--- + +# ![http://www.google.com/images/icons/product/adsense-32.png](http://www.google.com/images/icons/product/adsense-32.png) AdSense Management API # +**Description:** Gives AdSense publishers access to their inventory and the ability to generate reports + +This content has moved to https://developers.google.com/api-client-library/java/apis#AdSense_Management_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Admin Reports API # +**Description:** Allows the administrators of Google Apps customers to fetch reports about the usage, collaboration, security and risk for their users. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Admin_Reports_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) BigQuery API # +**Description:** A data platform for customers to create, manage, share and query data. + +This content has moved to https://developers.google.com/api-client-library/java/apis#BigQuery_API + + +--- + +# ![http://www.google.com/images/icons/product/blogger-32.png](http://www.google.com/images/icons/product/blogger-32.png) Blogger API # +**Description:** API for access to the data within Blogger. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Blogger_API + + +--- + +# ![http://www.google.com/images/icons/product/ebooks-32.png](http://www.google.com/images/icons/product/ebooks-32.png) Books API # +**Description:** Lets you search for books and manage your Google Books library. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Books_API + + +--- + +# ![http://www.google.com/images/icons/product/calendar-32.png](http://www.google.com/images/icons/product/calendar-32.png) Calendar API # +**Description:** Lets you manipulate events and other calendar data. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Calendar_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Cloud SQL Administration API # +**Description:** API for Cloud SQL database instance management. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Cloud_SQL_Administration_API + + +--- + +# ![https://www.google.com/images/icons/product/cloud_storage-32.png](https://www.google.com/images/icons/product/cloud_storage-32.png) Cloud Storage API # +**Description:** Lets you store and retrieve potentially-large, immutable data objects. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Cloud_Storage_API + + +--- + +# ![http://www.google.com/images/icons/product/compute_engine-32.png](http://www.google.com/images/icons/product/compute_engine-32.png) Compute Engine API # +**Description:** API for the Google Compute Engine service. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Compute_Engine_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) CustomSearch API # +**Description:** Lets you search over a website or collection of websites + +This content has moved to https://developers.google.com/api-client-library/java/apis#CustomSearch_API + + +--- + +# ![http://www.google.com/images/icons/product/doubleclick-32.gif](http://www.google.com/images/icons/product/doubleclick-32.gif) DFA Reporting API # +**Description:** Lets you create, run and download reports. + +This content has moved to https://developers.google.com/api-client-library/java/apis#DFA_Reporting_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) DoubleClick Bid Manager API # +**Description:** API for viewing and managing your reports in DoubleClick Bid Manager. + +This content has moved to https://developers.google.com/api-client-library/java/apis#DoubleClick_Bid_Manager_API + + +--- + +# ![https://ssl.gstatic.com/docs/doclist/images/drive_icon_32.png](https://ssl.gstatic.com/docs/doclist/images/drive_icon_32.png) Drive API # +**Description:** The API to interact with Drive. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Drive_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Enterprise Apps Reseller API # +**Description:** Lets you create and manage your customers and their subscriptions. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Enterprise_Apps_Reseller_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Enterprise Audit API # +**Description:** Lets you access user activities in your enterprise made through various applications. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Enterprise_Audit_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Enterprise License Manager API # +**Description:** Licensing API to view and manage license for your domain. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Enterprise_License_Manager_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) External API For Ads DoubleClick Search # +**Description:** Let's you create and list campaigns, ad groups, and criterion in Ads DoubleClick Search. + +This content has moved to https://developers.google.com/api-client-library/java/apis#External_API_For_Ads_DoubleClick_Search + + +--- + +# ![http://www.google.com/images/icons/product/freebase-32.png](http://www.google.com/images/icons/product/freebase-32.png) Freebase API # +**Description:** Topic and MQL APIs provide you structured access to Freebase data. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Freebase_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Fusion Tables API # +**Description:** API for working with Fusion Tables data. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Fusion_Tables_API + + +--- + +# ![http://www.google.com/images/icons/product/affiliatenetwork-32.png](http://www.google.com/images/icons/product/affiliatenetwork-32.png) Google Affiliate Network API # +**Description:** Lets you have programmatic access to your Google Affiliate Network data. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_Affiliate_Network_API + + +--- + +# ![http://www.google.com/images/icons/product/analytics-32.png](http://www.google.com/images/icons/product/analytics-32.png) Google Analytics API # +**Description:** View and manage your Google Analytics data + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_Analytics_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Google App State API # +**Description:** The Google App State API. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_App_State_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Google Civic Information API # +**Description:** An API for accessing civic information. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_Civic_Information_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Google Cloud Datastore API # +**Description:** API for accessing Google Cloud Datastore. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_Cloud_Datastore_API + + +--- + +# ![http://www.google.com/images/icons/feature/font_api-32.gif](http://www.google.com/images/icons/feature/font_api-32.gif) Google Fonts Developer API # +**Description:** The Google Fonts Developer API. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_Fonts_Developer_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Google Identity Toolkit API # +**Description:** Help the third party sites to implement federated login. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_Identity_Toolkit_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Google Maps Coordinate API # +**Description:** Lets you view and manage jobs in a Coordinate team. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_Maps_Coordinate_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Google Mirror API # +**Description:** API for interacting with Glass users via the timeline. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_Mirror_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Google OAuth2 API # +**Description:** Lets you access OAuth2 protocol related APIs. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_OAuth2_API + + +--- + +# ![http://www.google.com/images/icons/product/android-32.png](http://www.google.com/images/icons/product/android-32.png) Google Play Android Developer API # +**Description:** Lets Android application developers access their Google Play accounts. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_Play_Android_Developer_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Google Play Game Services API # +**Description:** The API for Google Play Game Services. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_Play_Game_Services_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Google Play Game Services Management API # +**Description:** The Management API for Google Play Game Services. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_Play_Game_Services_Management_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Google Site Verification API # +**Description:** Lets you programatically verify ownership of websites or domains with Google. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google_Site_Verification_API + + +--- + +# ![http://www.google.com/images/icons/product/gplus-32.png](http://www.google.com/images/icons/product/gplus-32.png) Google+ API # +**Description:** The Google+ API enables developers to build on top of the Google+ platform. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google+_API + + +--- + +# ![http://www.google.com/images/icons/product/gplus-32.png](http://www.google.com/images/icons/product/gplus-32.png) Google+ API # +**Description:** The Google+ API enables developers to build on top of the Google+ platform. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Google+_API + + +--- + +# ![http://www.google.com/images/icons/product/discussions-32.gif](http://www.google.com/images/icons/product/discussions-32.gif) Groups Migration API # +**Description:** Groups Migration Api. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Groups_Migration_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Groups Settings API # +**Description:** Lets you manage permission levels and related settings of a group. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Groups_Settings_API + + +--- + +# ![http://www.google.com/images/icons/product/orkut-32.png](http://www.google.com/images/icons/product/orkut-32.png) Orkut API # +**Description:** Lets you manage activities, comments and badges in Orkut. More stuff coming in time. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Orkut_API + + +--- + +# ![http://www.google.com/images/icons/product/pagespeed-32.png](http://www.google.com/images/icons/product/pagespeed-32.png) PageSpeed Insights API # +**Description:** Lets you analyze the performance of a web page and get tailored suggestions to make that page faster. + +This content has moved to https://developers.google.com/api-client-library/java/apis#PageSpeed_Insights_API + + +--- + +# ![http://www.google.com/images/icons/feature/predictionapi-32.png](http://www.google.com/images/icons/feature/predictionapi-32.png) Prediction API # +**Description:** Lets you access a cloud hosted machine learning service that makes it easy to build smart apps + +This content has moved to https://developers.google.com/api-client-library/java/apis#Prediction_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) Search API For Shopping # +**Description:** Lets you search over product data. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Search_API_For_Shopping + + +--- + +# ![http://www.google.com/images/icons/product/app_engine-32.png](http://www.google.com/images/icons/product/app_engine-32.png) TaskQueue API # +**Description:** Lets you access a Google App Engine Pull Task Queue over REST. + +This content has moved to https://developers.google.com/api-client-library/java/apis#TaskQueue_API + + +--- + +# ![http://www.google.com/images/icons/product/tasks-32.png](http://www.google.com/images/icons/product/tasks-32.png) Tasks API # +**Description:** Lets you manage your tasks and task lists. + +This content has moved to https://developers.google.com/api-client-library/java/apis#Tasks_API + + +--- + +# ![http://www.google.com/images/icons/product/translate-32.png](http://www.google.com/images/icons/product/translate-32.png) Translate API # +**Description:** Lets you translate text from one language to another + +This content has moved to https://developers.google.com/api-client-library/java/apis#Translate_API + + +--- + +# ![http://www.google.com/images/icons/product/search-32.gif](http://www.google.com/images/icons/product/search-32.gif) URL Shortener API # +**Description:** Lets you create, inspect, and manage goo.gl short URLs + +This content has moved to https://developers.google.com/api-client-library/java/apis#URL_Shortener_API + + +--- + +# ![http://www.google.com/images/icons/product/youtube-32.png](http://www.google.com/images/icons/product/youtube-32.png) YouTube Analytics API # +**Description:** Retrieve your YouTube Analytics reports. + +This content has moved to https://developers.google.com/api-client-library/java/apis#YouTube_Analytics_API + + +--- + +# ![http://www.google.com/images/icons/product/youtube-32.png](http://www.google.com/images/icons/product/youtube-32.png) YouTube Data API # +**Description:** Programmatic access to YouTube features. + +This content has moved to https://developers.google.com/api-client-library/java/apis#YouTube_Data_API + + + + +--- + + +# Google Data APIs # + +We do not provide service-specific libraries for the Google Data APIs because they are built on an older infrastructure that does not have a Discovery Service. Nevertheless, the base Google API Client Library for Java fully supports Google Data APIs as long as you write your own [Atom XML data model](http://javadoc.google-api-java-client.googlecode.com/hg/1.4.1-beta/com/google/api/client/googleapis/xml/atom/package-summary.html). Please take a look at the following examples for typical usage. + +We've written a few samples to demonstrate how this works: + * Content API for Shopping + * [Samples](http://code.google.com/apis/shopping/content/sample-apps/java/) (note that these samples are built on old version 1.1-alpha of the library and will not work with the latest version of the library) + * Google Cloud Storage API + * [storage-serviceaccount-cmdline-sample](http://samples.google-api-java-client.googlecode.com/hg/storage-serviceaccount-cmdline-sample/instructions.html?r=default) + * [storage-serviceaccount-appengine-sample](http://samples.google-api-java-client.googlecode.com/hg/storage-serviceaccount-appengine-sample/instructions.html?r=default) + * Picasa Web Albums Data API + * [picasa-cmdline-sample](http://samples.google-api-java-client.googlecode.com/hg/picasa-cmdline-sample/instructions.html?r=default) + * YouTube Data API + * [youtube-jsonc-sample](http://samples.google-api-java-client.googlecode.com/hg/youtube-jsonc-sample/instructions.html?r=default) \ No newline at end of file diff --git a/Android.md b/Android.md new file mode 100644 index 00000000..d87a0c0e --- /dev/null +++ b/Android.md @@ -0,0 +1,41 @@ +If you are developing for Android and the Google API you want to use is included in the [Google Play Services library](https://developer.android.com/google/play-services/index.html), use that library for the best performance and experience. If the Google API you want to use with Android is not part of the Google Play Services library, you can use the Google APIs Client Library for Java, which supports Android 1.5 (or higher), and which is described here. + +Contents: + + +# Getting Started # + +Begin by reading the [Android development instructions](http://code.google.com/p/google-http-java-client/wiki/Android) in the Google HTTP Client Library for Java documentation. + +# Authentication # + +As described in the [Android development instructions](http://code.google.com/p/google-http-java-client/wiki/Android), the best practice on Android (since the 2.1 SDK) is to use the [AccountManager](http://developer.android.com/reference/android/accounts/AccountManager.html) class (@Beta) for centralized identity management and credential token storage. + +**OAuth 2.0**
For information about the OAuth 2.0 flow, see the [OAuth 2.0 instructions for Android](OAuth2#Android.md). + +**ClientLogin**
ClientLogin is a [deprecated](https://developers.google.com/accounts/docs/AuthForInstalledApps?csw=1) authentication protocol used by older Google APIs. For new applications, we encourage you to use the more secure [OAuth 2.0](OAuth2.md) protocol. Support for ClientLogin in the Google APIs Client Library for Java will be removed. + +Older Google APIs that support ClientLogin are well supported on Android. To get an auth token, call `AccountManager.getAuthToken()` with the appropriate `authTokenType` for the Google API you are using, for example `cl` for the Google Calendar Data API. + +# Partial Response and Update # + +Google APIs support a partial-response protocol that allows you to specify which fields are returned to you in the HTTP response. This can significantly reduce the size of the response, thereby reducing network usage, parsing response time, and memory usage. It works with both JSON and XML. + +The following snippet of code drawn from the [Google+ Sample](http://code.google.com/p/google-api-java-client/source/browse/plus-cmdline-sample/src/main/java/com/google/api/services/samples/plus/cmdline/PlusSample.java?repo=samples) demonstrates how to use the partial-response protocol: + +``` +Plus.Activities.List listActivities = plus.activities().list("me", "public"); +listActivities.setMaxResults(5L); +// Pro tip: Use partial responses to improve response time considerably +listActivities.setFields("nextPageToken,items(id,URL,object/content)"); +ActivityFeed feed = listActivities.execute(); +``` + +# Samples # + +A good example that uses the generated service-specific library is [tasks-android-sample](http://samples.google-api-java-client.googlecode.com/hg/tasks-android-sample/instructions.html). Another example can be found in [calendar-android-sample](http://samples.google-api-java-client.googlecode.com/hg/calendar-android-sample/instructions.html?r=default), which mixes ClientLogin with the service-specific library. + +# Best-Practices Video (2011) # +In the following hour-long video from Google I/O 2011, Yaniv Inbar describes best practices for accessing Google APIs on Android. + + \ No newline at end of file diff --git a/Batch.md b/Batch.md new file mode 100644 index 00000000..65c7d900 --- /dev/null +++ b/Batch.md @@ -0,0 +1,48 @@ +Each HTTP connection that your client makes results in overhead. To reduce overhead, you can batch multiple API calls together into a single HTTP request. + +The main classes of interest are [BatchRequest](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/batch/BatchRequest.html) and [JsonBatchCallback](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/batch/json/JsonBatchCallback.html). The following example shows how to use these classes with service-specific generated libraries: + +``` +JsonBatchCallback callback = new JsonBatchCallback() { + + public void onSuccess(Calendar calendar, HttpHeaders responseHeaders) { + printCalendar(calendar); + addedCalendarsUsingBatch.add(calendar); + } + + public void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) { + System.out.println("Error Message: " + e.getMessage()); + } +}; + +... + +Calendar client = Calendar.builder(transport, jsonFactory, credential) + .setApplicationName("BatchExample/1.0").build(); +BatchRequest batch = client.batch(); + +Calendar entry1 = new Calendar().setSummary("Calendar for Testing 1"); +client.calendars().insert(entry1).queue(batch, callback); + +Calendar entry2 = new Calendar().setSummary("Calendar for Testing 2"); +client.calendars().insert(entry2).queue(batch, callback); + +batch.execute(); +``` + +A complete example of batch using the [Calendar API](https://developers.google.com/api-client-library/java/apis/calendar/v3) is available in the [calendar-cmdline-sample](http://samples.google-api-java-client.googlecode.com/hg/calendar-cmdline-sample/instructions.html). + +You can also use the batch feature without service-specific generated libraries. To do this: + 1. Change the batch URL to your own URL. + 1. Call [BatchRequest.setBatchUrl](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/batch/BatchRequest.html#setBatchUrl%28com.google.api.client.http.GenericUrl%29). + 1. Queue the HTTP requests by calling [BatchRequest.queue](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/batch/BatchRequest.html#queue%28com.google.api.client.http.HttpRequest,%20java.lang.Class,%20java.lang.Class,%20com.google.api.client.googleapis.batch.BatchCallback%29). + +The following example shows how to use batch in this generic way: + +``` + BatchRequest batch = new BatchRequest(httpTransport, httpRequestInitializer); + batch.setBatchUrl(new GenericUrl(/*your customized batch URL goes here*/)); + batch.queue(httpRequest1, dataClass, errorClass, callback); + batch.queue(httpRequest1, dataClass, errorClass, callback); + batch.execute(); +``` \ No newline at end of file diff --git a/BecomingAContributor.md b/BecomingAContributor.md new file mode 100644 index 00000000..eb660f9c --- /dev/null +++ b/BecomingAContributor.md @@ -0,0 +1,296 @@ +Contents: + + + +# Contributor License Agreements (CLA) # + +Before we can accept your code patches, you need to submit either an individual or a corporate Contributor License Agreement (CLA): + + * If you are an individual writing original source code and you're certain that you own the intellectual property, submit an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company, your company must submit a [corporate CLA](https://developers.google.com/open-source/cla/corporate) to indicate that you are allowed to contribute your work to this client library. + +Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we can add you to the official list of contributors. + +# Overview of Submitting Patches # + +To contribute code to this project, follow these general steps: + + 1. Sign a Contributor License Agreement, as described above. + 1. Join our [discussion group](http://groups.google.com/group/google-api-java-client). + 1. Set up your [development environment](BecomingAContributor#Setting_up_the_Development_Environment.md). + 1. Associate each of your changesets with an Issue (a bug report or feature request) in this project's [Issue Tracker](http://code.google.com/p/google-api-java-client/issues/list). Create a new Issue if there isn't one already, change its status to "Started," and assign it to yourself. + 1. Check out code, create a new issue on [codereview.appspot.com](http://codereview.appspot.com), and complete the code review process. Detailed instructions for all these processes are given below. + 1. After your code is reviewed and you receive approval, commit the code. If you are not an official Contributor, a Contributor pulls your changeset into the official repository. + +We use the following tools and processes: + * We use the [Mercurial](http://mercurial.selenic.com/) version control system, which is a "distributed" VCS. If you are not familiar with it, we recommend the tutorial by Joel Spolsky at [hginit.com](http://hginit.com/). + * We use [Maven](http://maven.apache.org/) for the build system, as well as a binary distribution system. + * We use [codereview.appspot.com](http://codereview.appspot.com) for code reviews. (But note that in the codereview.appspot.com tool, the term "issue" means a code-review request, while in the Issue Tracker, an "issue" is a feature request or bug report.) + +If you are an Eclipse developer, use the project-specific code formatting specified in the .settings directory that is automatically processed by Eclipse. + + +# Setting up the Development Environment # + +## Prerequisites ## + 1. Install [Java 6](http://java.com). You might need to set your `JAVA_HOME` variable. + 1. Install [Mercurial (Hg)](http://mercurial.selenic.com/), minimum version 1.6. An optional tutorial is located at [hginit.com](http://hginit.com). + 1. Install [Maven](http://maven.apache.org/download.html). (This document assumes you have basic familiarity with Maven commands.) + 1. Optional: Install the [Android SDK](http://developer.android.com/sdk/index.html) and set your ANDROID\_HOME variable to the install location for Android. + 1. Install [Git](http://git-scm.com/). + +**Set up the Mercurial hgrc file:** + +To be able to check out and make changes to the code, you need to authenticate with the Hg repository. + +Add the following in the `[auth]` section of your ~/.hgrc file with your username and password from https://code.google.com/hosting/settings, as follows: + +``` +[auth] +google-api-java-client.prefix = https://code.google.com/p/google-api-java-client/ +google-api-java-client.username = your_username +google-api-java-client.password = your_password +samples-google-api-java-client.prefix = https://code.google.com/p/google-api-java-client.samples/ +samples-google-api-java-client.username = your_username +samples-google-api-java-client.password = your_password +``` +## Checking out the code ## +We use two Mercurial repositories: + * The "default" repository has the library. The "default" branch has the latest unreleased code under development. Additionally, each release has its own branch, e.g. "1.6" branch for the 1.6.X-beta releases. + * The "samples" repository has all of the samples under the "default" branch. +To check out the default library repository in the development "default" branch, run the following command: + +``` +hg clone https://code.google.com/p/google-api-java-client/ google-api-java-client/default +``` + +To switch to an alternative branch (for example 1.12): + +``` +hg update 1.12 +``` + +To switch back to the development branch: + +``` +hg update default +``` + +To pull in the latest changes from the central server and update your local workspace to the latest changeset: + +``` +hg pull --update +``` + +To check out the "samples" repository: + +``` +cd +hg clone https://code.google.com/p/google-api-java-client.samples/ google-api-java-client/samples +``` + +## Maven ## + +**Install Google Play Services** + +The first time you set up the project, you need to install the google-play-services.jar file. To do this: + 1. Launch Eclipse and select **Window > Android SDK Manager**, or run `android` at the command line. + 1. Scroll to the bottom of the package list and select **Extras > Google Play services**. + +``` +mvn install:install-file \ + -Dfile=$ANDROID_HOME/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar \ + -DgroupId=com.google.android.google-play-services \ + -DartifactId=google-play-services \ + -Dversion=1 \ + -Dpackaging=jar +``` + +**Compile the project** + +To clean, compile, test, and install the project, run the following command: + +``` +mvn clean install +``` + +Maven installs the compiled binaries to a local repository (for example ~/.m2/repository). It searches for binaries in that repository before fetching from the [Maven central repository](http://search.maven.org/#search%7Cga%7C1%7C). + +**Note:** +This library depends on [google-http-java-client](https://code.google.com/p/google-http-java-client/) and [google-oauth-java-client](https://code.google.com/p/google-oauth-java-client/). When working on a new version of all three libraries that are not yet released to Maven central, you must compile them in the following order: + 1. google-http-java-client + 1. google-oauth-java-client + 1. google-api-java-client +Compiling in this order ensures that Maven picks up the compiled binaries for dependent library compilation. + +## Eclipse ## +**Import to Eclipse:** + +The project is designed to work well with Eclipse. To convert the Maven project to an Eclipse project (that is, to create `.classpath`, `project.property` and so on), run the following command: + +``` +mvn eclipse:eclipse +``` +To import the project to an Eclipse workspace: + 1. From within Eclipse, select **File > Import...**. + 1. Select **General > Existing Project into Workspace** and click **Next**. + 1. Next to **Select root directory**, browse to the directory where your project is synced (for example google-api-java-client/default) and click **OK**. + 1. Click **Next** and **Finish**. + +**Add the `M2_REPO` classpath variable to Eclipse:** + +When you run `mvn eclipse:eclipse`, Maven creates the entire dependency classpath by using the `M2_REPO` variable, which is not defined in Eclipse by default. To add the `M2_REPO` classpath variable into the Eclipse IDE, follow these instructions: + + 1. From within Eclipse, select **Window > Preferences** (or on Mac, **Eclipse > Preferences...**). + 1. Select **Java > Build Path > Classpath Variables**. + 1. Click **New...**. + 1. Type `M2_REPO` as the name, and choose the local Maven repository, for example ~/.m2/repository. + 1. Click **OK**. Eclipse reminds you to rebuild all projects to work with the new classpath variable. + 1. Click **Done**. + +You only need to add `M2_REPO` once, and it is shared among all of your Eclipse workspaces. + +# Code Review Process # + +## Downloading the upload.py script ## + +Download the [upload.py](http://codereview.appspot.com/static/upload.py) script and optionally add it to your PATH. + +The first time you run `upload.py`, it asks you for an [application-specific password](http://support.google.com/accounts/bin/answer.py?hl=en&answer=185833): + +``` +Email (login for uploading to codereview.appspot.com): your_email_address@yourdomain.com +Password for your_email_address@yourdomain.com: +``` + +## Preparing your code for review ## + +Before you send the code for review, you must run Clirr to catch backwards compatibility problems in your code. If any errors are reported, you need to either fix them or update the clirr-ignored-differences.xml file. + +``` +mvn -q clirr:check +``` + +You must also run the FindBugs tool to catch bugs in the code. If any errors are reported, you need to either fix them or update the findbugs-exclude.xml file. (Note that FindBugs is very slow.) + +``` +mvn findbugs:check +``` + +## Starting the code review ## + +When ready for review, create a new issue on codereview.appspot.com: +``` +upload.py --base_url=https://code.google.com/p/google-api-java-client/ --send_mail -r reviewer@somedomain --cc ... +``` + +After making more changes, upload a new patch, for example to issue number 123456: +``` +upload.py -i 123456 +``` + +For more options, run `upload.py --help`. + +The process is similar for samples: + +``` +upload.py --base_url=https://code.google.com/p/google-api-java-client.samples/ --send_mail -r reviewer@somedomain --cc ... +upload.py -i 123456 +``` + +## Code reviewer ## + +If you are a code reviewer, import and test changesets before you approve them, then remove the changes from your local workspace after you're done. + +**Get set up** + +Download the [hg\_import.py](http://google-http-java-client.googlecode.com/hg/hg_import.py) script and make an alias for easy use: +``` +alias hg_import.py='/hg_import.py' +``` + +**Import a changeset** + +To import a patch into your hg clone: + 1. Open the issue within codereview.appspot.com. + 1. For the patch in question, look for "Download raw" at the top right of the patch specification. + 1. Click "raw" to get a URL for the file to import. + +Now import the file. For example: +``` +hg_import.py http://codereview.appspot.com/download/issue123456_10000.diff +``` + +**Test the changeset** + +To run the tests and install, use the following command: + +``` +mvn clean install checkstyle:check +``` + +**Unpatch a changeset** + +When finishing a code review, use the following command to get rid of an imported patch. **Be careful**: It literally erases all of your local changes. +``` +hg revert -a && hg purge +``` + +**Approve a changeset on codereview.appspot.com** + +In general, code cannot be committed into the Hg server until the code reviewer is satisfied that the code is ready. At that point, the convention is to reply with the message "LGTM" (Looks Good To Me). + +## Committing the code ## + +**Important:** Before you commit your code, pull the latest changes into your local workspace and update your local workspace to the latest changeset: + +``` +hg pull --update +``` + +(If the central Mercurial server has changes that you have not yet pulled into your local workspace, committing your code creates a new branch or "head," because the "parent changeset" for your commit is the latest changeset in the server. The only way to resolve this is to merge the heads. To avoid this complexity, run `hg pull --update` as shown above.) + +To commit the code **locally**: +``` +hg commit +``` + +Enter a message such as the following (assuming you are fixing or implementing Issue # 123, as listed in this project's [Issue Tracker](https://code.google.com/p/google-api-java-client/issues/list)): + +``` +api Issue 123: NullPointerException when passing null to processFoo() + +http://codereview.appspot.com/123456/ +``` + +Before the first colon and the description: + + * Include the project, which is `api`, `http`, or `oauth`. + * If this is a fix to a problem on http://code.google.com/p/google-api-java-client/issues, include the Issue number, as shown. + * If this is a change for a particular branch, include the branch number. + +Following the description, always include a link to the issue on the codereview site. This link is important because without it, there's no convenient way to figure out the code review associated with a commit, which is useful for maintaining a history of the discussion. + +To push the change to the server: + +``` +hg push +``` + +If it asks for your password, use the password from https://code.google.com/hosting/settings. + +If during `hg push` you get an error message about creating a new head (perhaps you forgot to run `hg pull --update`), here's how to merge with the latest changes: +``` +hg pull +hg merge +hg commit +hg push +``` + +If you get an HTTP `403 Forbidden` status code, you are not on the list at https://code.google.com/p/google-api-java-client/people/list . Ask one of the Owners to add you to the list as a Committer. + +## Closing the issue ## + +Make sure to close the issue in the code-review tool. To do this: + 1. Select the issue in [codereview.appspot.com](http://codereview.appspot.com). + 1. Click the "X" that is at the top-left, preceding "Id." \ No newline at end of file diff --git a/ClientLogin.md b/ClientLogin.md new file mode 100644 index 00000000..e26a159f --- /dev/null +++ b/ClientLogin.md @@ -0,0 +1,43 @@ +# Legacy Support for ClientLogin # +ClientLogin is a [deprecated](https://developers.google.com/accounts/docs/AuthForInstalledApps?csw=1) authentication protocol used by older Google APIs, and support for it will be removed from the Google APIs Client Library for Java. + +**Do not use ClientLogin for new applications.** Instead, use the more secure [OAuth 2.0](OAuth2.md) authentication protocol. + +**If your existing application uses ClientLogin**, we encourage you to migrate to OAuth 2.0 as soon as possible. For information about how ClientLogin is implemented within the Google APIs Client Library for Java, see the [ClientLogin JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/clientlogin/package-summary.html) ([@Beta](https://code.google.com/p/google-api-java-client/#@Beta)). For general instructions, see [ClientLogin for Installed Applications](http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html). + +# Sample Program # +The following sample program shows ClientLogin used for authentication. You must manually fill in the username and password in order for this sample to work. Otherwise, you will likely get an HTTP `403 Forbidden` status code. + +Do not base new work on the sample; it is provided only for ClientLogin legacy support. + +``` +import com.google.api.client.googleapis.auth.clientlogin.ClientLogin; +import com.google.api.client.http.HttpResponseException; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.javanet.NetHttpTransport; + +import java.io.IOException; +import java.lang.System; + +public class ClientLoginSample { + public static void main(String[] args) throws IOException { + // HttpTransport used to send login request. + HttpTransport transport = new NetHttpTransport(); + try { + // authenticate with ClientLogin + ClientLogin authenticator = new ClientLogin(); + authenticator.transport = transport; + // Google service trying to access, e.g., "cl" for calendar. + authenticator.authTokenType = "cl"; + authenticator.username = "username"; + authenticator.password = "password"; + authenticator.authenticate(); + System.out.println("Authentication succeeded."); + } catch (HttpResponseException e) { + // Likely a "403 Forbidden" error. + System.err.println(e.getStatusMessage()); + throw e; + } + } +} +``` \ No newline at end of file diff --git a/DeveloperGuide.md b/DeveloperGuide.md new file mode 100644 index 00000000..6c8613c3 --- /dev/null +++ b/DeveloperGuide.md @@ -0,0 +1,36 @@ +## Getting Started ## + +To get started with the Google APIs Client Library for Java, take a look at the [available samples](http://code.google.com/p/google-api-java-client/source/browse?repo=samples). + +For information about the structure of the library and its multiple components, see the [detailed setup instructions](Setup.md), which include [instructions for Maven users](Setup#Maven.md). + +To ask questions, report bugs, discuss the library, and read the announcements, see the [Support](Support.md) page. + +## Authentication ## + +The library supports the following authentication methods: + * [OAuth 2.0](OAuth2.md) + * [ClientLogin (deprecated Google method)](ClientLogin.md) + +## Batching ## + +The library makes it easier to batch multiple HTTP requests/responses. For details, see the [batch documentation](Batch.md). + +## Media Upload/Download ## + +The library has convenient classes that help with [media upload](MediaUpload.md) and [media download](MediaDownload.md). + +## Supported Java Environments ## +The library supports the following Java environments: + * Java 5 (or higher), standard (SE) and enterprise (EE) + * [Android 1.5 (or higher)](Android.md) (Note that this library's support for Android is [@Beta](https://code.google.com/p/google-api-java-client/#@Beta).) + * [Google App Engine](GoogleAppEngine.md) + + +## GData Java Client Library (deprecated) ## + +If you currently use the [GData Java client library](http://code.google.com/p/gdata-java-client/), you need to migrate to the Google APIs Client Library for Java. For details, see the [migration guide](http://code.google.com/p/gdata-java-client/wiki/MigratingToGoogleApiJavaClient). + +## Contribute ## + +This is an [open-source](http://code.google.com/p/google-api-java-client/source/browse/) library, and [contributions](BecomingAContributor.md) are welcome. \ No newline at end of file diff --git a/Downloads.md b/Downloads.md new file mode 100644 index 00000000..fc329736 --- /dev/null +++ b/Downloads.md @@ -0,0 +1,7 @@ +Starting from version 1.18.0-rc, we host library bundles (including both source and compiled files) on dl.google.com. The latest bundle is always named `google-api-java-client-featured.zip`. + +Google APIs Client Library for Java: +| Latest | [google-api-java-client-featured.zip](http://search.maven.org/remotecontent?filepath=com/google/api-client/google-api-client-assembly/1.18.0-rc/google-api-client-assembly-1.18.0-rc-1.18.0-rc.zip) | +|:-------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Archived | [Archived downloads](https://code.google.com/p/google-api-java-client/downloads/list) | +| Deprecated | [Deprecated downloads](https://code.google.com/p/google-api-java-client/downloads/list?can=4&q=&colspec=Filename+Summary+Uploaded+ReleaseDate+Size+DownloadCount) | \ No newline at end of file diff --git a/GoogleAppEngine.md b/GoogleAppEngine.md new file mode 100644 index 00000000..0a440b6d --- /dev/null +++ b/GoogleAppEngine.md @@ -0,0 +1,18 @@ +Google App Engine is one of the supported Java environments for the Google APIs Client Library for Java. + +# Auth Helpers # + +If you are building a web app that interacts with a user's data via an OAuth 2.0-enabled API, we've created some helpers to assist you with the process. The helpers aim to: + * Simplify the process of obtaining access tokens ([AuthorizationCodeFlow](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.html)). + * Manage tokens, after they are obtained, by marking them as [PersistenceCapable](https://developers.google.com/appengine/docs/java/datastore/jdo/dataclasses#Class_and_Field_Annotations). + * Simplify the process of making authenticated calls using the access token's [credential](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/auth/oauth2/Credential.html). + * Insulate you from the details of authentication when writing [servlets](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/appengine/auth/oauth2/package-summary.html). + +# Getting Started # + + 1. Install the Google APIs Client Library for Java: + * Follow the [download instructions](Setup#Download_Library_with_Dependencies.md) and put the library .jar files into your war/WEB-INF/lib directory. + * Alternatively, you can use [Maven](Setup#Maven.md). + 1. Learn about [using OAuth 2.0 with the authorization code flow for Google App Engine applications](OAuth2#Google_App_Engine_applications.md). + 1. Learn about [using OAuth 2.0 with the Google App Engine Identity API](OAuth2#Google_App_Engine_identity.md). + 1. Take a look at the [Calendar App Engine sample](http://samples.google-api-java-client.googlecode.com/hg/calendar-appengine-sample/instructions.html). This sample combines our Java library and auth helpers to show you how to access end-user data from within a Google App Engine web app. The sample also uses [GWT](http://www.gwtproject.org/) for the user interface. \ No newline at end of file diff --git a/HandlingTimeoutsAndErrors.md b/HandlingTimeoutsAndErrors.md new file mode 100644 index 00000000..3d2f702e --- /dev/null +++ b/HandlingTimeoutsAndErrors.md @@ -0,0 +1,36 @@ +# Setting Timeouts # + +In the following example, which uses the [Google Analytics API](https://developers.google.com/api-client-library/java/apis/analytics/v3), the `setConnectTimeout` and `setReadTimeout` methods are used to set the connect and read timeouts to three minutes (in milliseconds) for all requests: + +``` +private HttpRequestInitializer setHttpTimeout(final HttpRequestInitializer requestInitializer) { + return new HttpRequestInitializer() { + @Override + public void initialize(HttpRequest httpRequest) throws IOException { + requestInitializer.initialize(httpRequest); + httpRequest.setConnectTimeout(3 * 60000); // 3 minutes connect timeout + httpRequest.setReadTimeout(3 * 60000); // 3 minutes read timeout + } + }; + +GoogleCredential credential = .... + +final Analytics analytics = Analytics.builder(new NetHttpTransport(), jsonFactory, setHttpTimeout(credential)).build(); +``` + +# Handling HTTP Error Responses from Google APIs # + +A [GoogleJsonResponseException](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/json/GoogleJsonResponseException.html) is thrown from the generated libraries when an error status code is detected in an HTTP response to a Google API that uses the JSON format. +The errors use the format specified in [Error responses](http://code.google.com/apis/urlshortener/v1/getting_started.html#errors). + +The following example shows a way to handle these exceptions: + +``` +Plus.Activities.List listActivities = plus.activities().list("me", "public"); +try { + ActivityFeed feed = listActivities.execute(); + ... +} catch (GoogleJsonResponseException e) { + System.err.println(e.getDetails()); +} +``` \ No newline at end of file diff --git a/MediaDownload.md b/MediaDownload.md new file mode 100644 index 00000000..1c98eee0 --- /dev/null +++ b/MediaDownload.md @@ -0,0 +1,56 @@ +Contents: + + +# Resumable Media Download # + +When you download a large media file from a server, use _resumable media download_ to download the file chunk by chunk. The Google API generated libraries contain convenience methods for interacting with resumable media download, which was introduced in the [1.9.0-beta](http://google-api-java-client.blogspot.com/2012/05/version-190-beta-released.html) version of the Google APIs Client Library for Java. + +The resumable media download protocol is similar to the resumable media upload protocol, which is described in the [Google Drive API documentation](https://developers.google.com/drive/web/manage-uploads#resumable). + +# Implementation Details # +The main classes of interest are [MediaHttpDownloader](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/media/MediaHttpDownloader.html) and [MediaHttpDownloaderProgressListener](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/media/MediaHttpDownloaderProgressListener.html). Media content is downloaded in chunks, and chunk size is configurable. If a server error is encountered in a request, then the request is retried. + +If methods in the service-specific generated libraries support download in the [Discovery document](https://developers.google.com/discovery/v1/using), then a convenient download method is created for these methods that takes in an [OutputStream](http://docs.oracle.com/javase/1.5.0/docs/api/org/omg/CORBA/portable/OutputStream.html). (For more about using media download with the Google APIs Discovery Service, see [Media download](https://developers.google.com/discovery/v1/using#discovery-doc-methods-mediadownload).) + +For example: + +``` +class CustomProgressListener implements MediaHttpDownloaderProgressListener { + public void progressChanged(MediaHttpDownloader downloader) { + switch (downloader.getDownloadState()) { + case MEDIA_IN_PROGRESS: + System.out.println(downloader.getProgress()); + break; + case MEDIA_COMPLETE: + System.out.println("Download is complete!"); + } + } +} + +OutputStream out = new FileOutputStream("/tmp/driveFile.jpg"); + +Drive.Files.Get request = drive.files().get(fileId); +request.getMediaHttpDownloader().setProgressListener(new CustomProgressListener()); +request.executeMediaAndDownloadTo(out); +``` + +You can also use this feature without service-specific generated libraries. Here is an example: +``` +OutputStream out = new FileOutputStream("/tmp/Test.jpg"); + +MediaHttpDownloader downloader = new MediaHttpDownloader(transport, httpRequestInitializer); +downloader.setProgressListener(new CustomProgressListener()); +downloader.download(requestUrl, out); +``` + +# Direct Media Download # + +Resumable media download is enabled by default, but you can disable it and use direct media download instead, for example if you are downloading a small file. Direct media download was introduced in the [1.9.0-beta](http://google-api-java-client.blogspot.com/2012/05/version-190-beta-released.html) version of the Google APIs Client Library for Java. + +Direct media download downloads the whole media content in one HTTP request, as opposed to the resumable media download protocol, which can download in multiple requests. Doing a direct download reduces the number of HTTP requests but increases the chance of failures (such as connection failures) that can happen with large downloads. + +The usage is the same as what is described above, plus the following call that tells [MediaHttpDownloader](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/media/MediaHttpDownloader.html) to do direct downloads: + +``` +mediaHttpDownloader.setDirectDownloadEnabled(true); +``` \ No newline at end of file diff --git a/MediaUpload.md b/MediaUpload.md new file mode 100644 index 00000000..f771a608 --- /dev/null +++ b/MediaUpload.md @@ -0,0 +1,80 @@ +Contents: + + +# Resumable Media Upload # + +When you upload a large media file to a server, use _resumable media upload_ to send the file chunk by chunk. The Google API generated libraries contain convenience methods for interacting with resumable media upload, which was introduced in the [1.7.0-beta](http://google-api-java-client.blogspot.com/2012/03/version-170-beta-released.html) version of the Google APIs Client Library for Java. + +The resumable media upload protocol is similar to the resumable media upload protocol described in the [Google Drive API documentation](https://developers.google.com/drive/web/manage-uploads#resumable). + +# Protocol Design # + +The following sequence diagram shows how the resumable media upload protocol works: +
+ + +# Implementation Details # + +The main classes of interest are [MediaHttpUploader](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/media/MediaHttpUploader.html) and [MediaHttpProgressListener](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/media/MediaHttpUploaderProgressListener.html). + +If methods in the service-specific generated libraries contain the `mediaUpload` parameter in the [Discovery document](https://developers.google.com/discovery/v1/using), then a convenience method is created for these methods that takes an [InputStreamContent](http://javadoc.google-http-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/http/InputStreamContent.html) as a parameter. (For more about using media upload with the Google APIs Discovery Service, see [Media upload](https://developers.google.com/discovery/v1/using#discovery-doc-methods-mediaupload).) + +For example, the `insert` method of the [Drive API](https://www.googleapis.com/discovery/v1/apis/drive/v2.1beta/rest) supports `mediaUpload`, and you can use the following code to upload a file: + +``` +class CustomProgressListener implements MediaHttpUploaderProgressListener { + public void progressChanged(MediaHttpUploader uploader) throws IOException { + switch (uploader.getUploadState()) { + case INITIATION_STARTED: + System.out.println("Initiation has started!"); + break; + case INITIATION_COMPLETE: + System.out.println("Initiation is complete!"); + break; + case MEDIA_IN_PROGRESS: + System.out.println(uploader.getProgress()); + break; + case MEDIA_COMPLETE: + System.out.println("Upload is complete!"); + } + } +} + +File mediaFile = new File("/tmp/driveFile.jpg"); +InputStreamContent mediaContent = + new InputStreamContent("image/jpeg", + new BufferedInputStream(new FileInputStream(mediaFile))); +mediaContent.setLength(mediaFile.length()); + +Drive.Files.Insert request = drive.files().insert(fileMetadata, mediaContent); +request.getMediaHttpUploader().setProgressListener(new CustomProgressListener()); +request.execute(); +``` + +You can also use the resumable media upload feature without the service-specific generated libraries. Here is an example: +``` +File mediaFile = new File("/tmp/Test.jpg"); +InputStreamContent mediaContent = + new InputStreamContent("image/jpeg", + new BufferedInputStream(new FileInputStream(mediaFile))); +mediaContent.setLength(mediaFile.length()); + +MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, transport, httpRequestInitializer); +uploader.setProgressListener(new CustomProgressListener()); +HttpResponse response = uploader.upload(requestUrl); +if (!response.isSuccessStatusCode()) { + throw GoogleJsonResponseException(jsonFactory, response); +} +``` + +# Direct Media Upload # + +Resumable media upload is enabled by default, but you can disable it and use direct media upload instead, for example if you are uploading a small file. Direct media upload was introduced in the [1.9.0-beta](http://google-api-java-client.blogspot.com/2012/05/version-190-beta-released.html) version of the Google APIs Client Library for Java. + +Direct media upload uploads the whole file in one HTTP request, as opposed to the resumable media upload protocol, which uploads the file in multiple requests. Doing a direct upload reduces the number of HTTP requests but increases the chance of failures (such as connection failures) that can happen with large uploads. + +The usage for direct media upload is the same as what is described above for resumable media upload, plus the following call that tells [MediaHttpUploader](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/media/MediaHttpUploader.html) to only do direct uploads: + +``` +mediaHttpUploader.setDirectUploadEnabled(true); +``` \ No newline at end of file diff --git a/OAuth2.md b/OAuth2.md new file mode 100644 index 00000000..9701223d --- /dev/null +++ b/OAuth2.md @@ -0,0 +1,401 @@ +Contents: + + + +# Overview # + +**Purpose:** This document explains how to use the [GoogleCredential](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.html) utility class to do OAuth 2.0 authorization with Google services. For information about the generic OAuth 2.0 functions that we provide, see the [Google OAuth Client Library for Java](https://code.google.com/p/google-oauth-java-client/wiki/OAuth2). + +**Summary:** To access protected data stored on Google services, use [OAuth 2.0](https://developers.google.com/accounts/docs/OAuth2) for authorization. Google APIs support OAuth 2.0 flows for different types of client applications. In all of these flows, the client application requests an access token that is associated with only your client application and the owner of the protected data being accessed. The access token is also associated with a limited scope that defines the kind of data your client application has access to (for example "Manage your tasks"). An important goal for OAuth 2.0 is to provide secure and convenient access to the protected data, while minimizing the potential impact if an access token is stolen. + +The OAuth 2.0 packages in the Google APIs Client Library for Java are built on the general-purpose [Google OAuth 2.0 Client Library for Java](http://code.google.com/p/google-oauth-java-client/wiki/OAuth2). + +For details, see the Javadoc documentation for the following packages: + * [com.google.api.client.googleapis.auth.oauth2](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/package-summary.html) (from [google-api-client](Setup#google-api-client.md)) + * [com.google.api.client.googleapis.extensions.appengine.auth.oauth2](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/package-summary.html) (from [google-api-client-appengine](Setup#google-api-client-appengine.md)) + +# Google Developers Console # + +Before you can access Google APIs, you need to set up a project on the [Google Developers Console](https://console.developers.google.com/) for auth and billing purposes, whether your client is an installed application, a mobile application, a web server, or a client that runs in browser. + +For instructions on setting up your credentials properly, see the [Google Developers Console Help](https://developers.google.com/console/help/new/). + + +# Credential # + +## GoogleCredential ## + +[GoogleCredential](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.html) is a thread-safe helper class for OAuth 2.0 for accessing protected resources using an access token. For example, if you already have an access token, you can make a request in the following way: + +``` +GoogleCredential credential = new GoogleCredential().setAccessToken(accessToken); +Plus plus = new Plus.builder(new NetHttpTransport(), JacksonFactory.getDefaultInstance(), credential) + .setApplicationName("Google-PlusSample/1.0") + .build(); +``` + +## Google App Engine identity ## + +This alternative credential is based on the [Google App Engine App Identity Java API](http://code.google.com/appengine/docs/java/appidentity/overview.html#Asserting_Identity_to_Google_APIs). Unlike the credential in which a client application requests access to an end-user's data, the App Identity API provides access to the client application's own data. + +Use [AppIdentityCredential](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredential.html) (from [google-api-client-appengine](Setup#google-api-client-appengine.md)). This credential is much simpler because Google App Engine takes care of all of the details. You only specify the OAuth 2.0 scope you need. + +Example code taken from [urlshortener-robots-appengine-sample](http://samples.google-api-java-client.googlecode.com/hg/urlshortener-robots-appengine-sample/instructions.html): + +``` +static Urlshortener newUrlshortener() { + AppIdentityCredential credential = + new AppIdentityCredential(Arrays.asList(UrlshortenerScopes.URLSHORTENER)); + return new Urlshortener.Builder(new UrlFetchTransport(), JacksonFactory.getDefaultInstance(), credential) + .build(); +} +``` + +# Data Store # + +An access token typically has an expiration date of 1 hour, after which you will get an error if you try to use it. [GoogleCredential](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.html) takes care of automatically "refreshing" the token, which simply means getting a new access token. This is done by means of a long-lived refresh token, which is typically received along with the access token if you use the `access_type=offline` parameter during the authorization code flow (see [GoogleAuthorizationCodeFlow.Builder.setAccessType(String)](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow.Builder.html#setAccessType(java.lang.String))). + +Most applications will need to persist the credential's access token and/or refresh token. To persist the credential's access and/or refresh tokens, you can provide your own implementation of [DataStoreFactory](http://javadoc.google-http-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/util/store/DataStoreFactory.html) and [DataStore](http://javadoc.google-http-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/util/store/DataStore.html) with [StoredCredential](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/auth/oauth2/StoredCredential.html); or you can use one of the following implementations provided by the library: + * [JdoDataStoreFactory](http://javadoc.google-http-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/jdo/JdoDataStoreFactory.html): persists the credential using JDO. + * [AppEngineDataStoreFactory](http://javadoc.google-http-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/appengine/datastore/AppEngineDataStoreFactory.html): persists the credential using the Google App Engine Data Store API. + * [MemoryDataStoreFactory](http://javadoc.google-http-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/util/store/MemoryDataStoreFactory.html) "persists" the credential in memory, which is only useful as a short-term storage for the lifetime of the process. + * [FileDataStoreFactory](http://javadoc.google-http-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/util/store/FileDataStoreFactory.html): persists the credential in a file. + +**AppEngine Users:** +> [AppEngineCredentialStore](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/appengine/auth/oauth2/AppEngineCredentialStore.html) is deprecated and will be removed soon. You are recommended to use [AppEngineDataStoreFactory](http://javadoc.google-http-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/appengine/datastore/AppEngineDataStoreFactory.html) with [StoredCredential](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/auth/oauth2/StoredCredential.html). If you have credentials stored in the old fasion, you can use the added helper methods [migrateTo(AppEngineDataStoreFactory)](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/appengine/auth/oauth2/AppEngineCredentialStore.html#migrateTo%28com.google.api.client.extensions.appengine.datastore.AppEngineDataStoreFactory%29) or [migrateTo(DataStore)](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/appengine/auth/oauth2/AppEngineCredentialStore.html#migrateTo%28com.google.api.client.util.store.DataStore%29) to do the migration. + +You may use [DataStoreCredentialRefreshListener](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/auth/oauth2/DataStoreCredentialRefreshListener.html) and set it for the credential using [GoogleCredential.Builder.addRefreshListener(CredentialRefreshListener)](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.Builder.html#addRefreshListener(com.google.api.client.auth.oauth2.CredentialRefreshListener)). + + + +# Authorization Code Flow # + +Use the authorization code flow to allow the end-user to grant your application access to their protected data on Google APIs. The protocol for this flow is specified in [Authorization Code Grant](http://tools.ietf.org/html/draft-ietf-oauth-v2-23#section-4.1). + +This flow is implemented using [GoogleAuthorizationCodeFlow](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow.html). The steps are: + * End-user logs in to your application. You will need to associate that user with a user ID that is unique for your application. + * Call [AuthorizationCodeFlow.loadCredential(String)](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.html#loadCredential(java.lang.String)) based on the user ID to check if the end-user's credentials are already known. If so, we're done. + * If not, call [AuthorizationCodeFlow.newAuthorizationUrl()](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.html#newAuthorizationUrl()) and direct the end-user's browser to an authorization page to grant your application access to their protected data. + * The Google authorization server will then redirect the browser back to the redirect URL specified by your application, along with a `code` query parameter. Use the `code` parameter to request an access token using [AuthorizationCodeFlow.newTokenRequest(String)](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.html#newTokenRequest(java.lang.String)). + * Use [AuthorizationCodeFlow.createAndStoreCredential(TokenResponse, String)](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.html#createAndStoreCredential(com.google.api.client.auth.oauth2.TokenResponse,%20java.lang.String)) to store and obtain a credential for accessing protected resources. + +Alternatively, if you are not using [GoogleAuthorizationCodeFlow](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow.html), you may use the lower-level classes: + + * Use [DataStore.get(String)](http://javadoc.google-http-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/util/store/DataStore.html#get%28java.lang.String%29) to load the credential from the store based on the user ID. + * Use [GoogleAuthorizationCodeRequestUrl](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeRequestUrl.html) to direct the browser to the authorization page. + * Use [AuthorizationCodeResponseUrl](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/auth/oauth2/AuthorizationCodeResponseUrl.html) to process the authorization response and parse the authorization code. + * Use [GoogleAuthorizationCodeTokenRequest](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeTokenRequest.html) to request an access token and possibly a refresh token. + * Create a new [GoogleCredential](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.html) and store it using [DataStore.set(String, V)](http://javadoc.google-http-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/util/store/DataStore.html#set%28java.lang.String,%20V%29). + * Access protected resources using the [GoogleCredential](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.html). Expired access tokens will automatically be refreshed using the refresh token (if applicable). Make sure to use [DataStoreCredentialRefreshListener](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/auth/oauth2/DataStoreCredentialRefreshListener.html) and set it for the credential using [GoogleCredential.Builder.addRefreshListener(CredentialRefreshListener)](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.Builder.html#addRefreshListener(com.google.api.client.auth.oauth2.CredentialRefreshListener))]. + +When you set up your project in the [Google Developers Console](http://console.developers.google.com), you select among different credentials, depending on the flow you are using. For more details, see [Setting up OAuth 2.0](https://developers.google.com/console/help/new/#generatingoauth2) and [OAuth 2.0 Scenarios](https://developers.google.com/accounts/docs/OAuth2#scenarios). Below we provide code snippets for each of the flows. + +## Web server applications ## + +The protocol for this flow is explained in [Using OAuth 2.0 for Web Server Applications](https://developers.google.com/accounts/docs/OAuth2WebServer). + +This library provides servlet helper classes to significantly simplify the authorization code flow for basic use cases. You just provide concrete subclasses of [AbstractAuthorizationCodeServlet](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/servlet/auth/oauth2/AbstractAuthorizationCodeServlet.html) and [AbstractAuthorizationCodeCallbackServlet](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/servlet/auth/oauth2/AbstractAuthorizationCodeCallbackServlet.html) (from [google-oauth-client-servlet](http://code.google.com/p/google-oauth-java-client/wiki/Setup#google-oauth-client-servlet)) and add them to your web.xml file. Note that you still need to take care of user login for your web application and extract a user ID. [JdoDataStoreFactory](http://javadoc.google-http-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/jdo/JdoDataStoreFactory.html) (from [google-oauth-client-servlet](http://code.google.com/p/google-oauth-java-client/wiki/Setup#google-oauth-client-servlet)) is a good option for persisting the credential using JDO. + +``` +public class CalendarServletSample extends AbstractAuthorizationCodeServlet { + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws IOException { + // do stuff + } + + @Override + protected String getRedirectUri(HttpServletRequest req) throws ServletException, IOException { + GenericUrl url = new GenericUrl(req.getRequestURL().toString()); + url.setRawPath("/oauth2callback"); + return url.build(); + } + + @Override + protected AuthorizationCodeFlow initializeFlow() throws IOException { + return new GoogleAuthorizationCodeFlow.Builder( + new NetHttpTransport(), JacksonFactory.getDefaultInstance(), + "[[ENTER YOUR CLIENT ID]]", "[[ENTER YOUR CLIENT SECRET]]", + Collections.singleton(CalendarScopes.CALENDAR)).setDataStoreFactory( + DATA_STORE_FACTORY).setAccessType("offline").build(); + } + + @Override + protected String getUserId(HttpServletRequest req) throws ServletException, IOException { + // return user ID + } +} + +public class CalendarServletCallbackSample extends AbstractAuthorizationCodeCallbackServlet { + + @Override + protected void onSuccess(HttpServletRequest req, HttpServletResponse resp, Credential credential) + throws ServletException, IOException { + resp.sendRedirect("/"); + } + + @Override + protected void onError( + HttpServletRequest req, HttpServletResponse resp, AuthorizationCodeResponseUrl errorResponse) + throws ServletException, IOException { + // handle error + } + + @Override + protected String getRedirectUri(HttpServletRequest req) throws ServletException, IOException { + GenericUrl url = new GenericUrl(req.getRequestURL().toString()); + url.setRawPath("/oauth2callback"); + return url.build(); + } + + @Override + protected AuthorizationCodeFlow initializeFlow() throws IOException { + return new GoogleAuthorizationCodeFlow.Builder( + new NetHttpTransport(), JacksonFactory.getDefaultInstance() + "[[ENTER YOUR CLIENT ID]]", "[[ENTER YOUR CLIENT SECRET]]", + Collections.singleton(CalendarScopes.CALENDAR)).setDataStoreFactory( + DATA_STORE_FACTORY).setAccessType("offline").build(); + } + + @Override + protected String getUserId(HttpServletRequest req) throws ServletException, IOException { + // return user ID + } +} +``` + +### Google App Engine applications ### + +The authorization code flow on App Engine is almost identical to the servlet authorization code flow, except that we can leverage Google App Engine's [Users Java API](http://code.google.com/appengine/docs/java/users/overview.html). The user needs to be logged in for the Users Java API to be enabled; for information about redirecting users to a login page if they are not already logged in, see [Security and Authentication](http://code.google.com/appengine/docs/java/config/webxml.html#Security_and_Authentication) (in web.xml). + +The primary difference from the servlet case is that you provide concrete subclasses of [AbstractAppEngineAuthorizationCodeServlet](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/appengine/auth/oauth2/AbstractAppEngineAuthorizationCodeServlet.html) and [AbstractAppEngineAuthorizationCodeCallbackServlet](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/appengine/auth/oauth2/AbstractAppEngineAuthorizationCodeCallbackServlet.html) (from [google-oauth-client-appengine](http://code.google.com/p/google-oauth-java-client/wiki/Setup#google-oauth-client-appengine)). They extend the abstract servlet classes and implement the `getUserId` method for you using the Users Java API. [AppEngineDataStoreFactory](http://javadoc.google-http-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/extensions/appengine/datastore/AppEngineDataStoreFactory.html) (from [google-http-client-appengine](http://code.google.com/p/google-http-java-client/wiki/Setup#google-http-client-appengine)) is a good option for persisting the credential using the Google App Engine Data Store API. + +Example taken (slightly modified) from [calendar-appengine-sample](http://samples.google-api-java-client.googlecode.com/hg/calendar-appengine-sample/instructions.html): + +``` +public class CalendarAppEngineSample extends AbstractAppEngineAuthorizationCodeServlet { + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws IOException { + // do stuff + } + + @Override + protected String getRedirectUri(HttpServletRequest req) throws ServletException, IOException { + return Utils.getRedirectUri(req); + } + + @Override + protected AuthorizationCodeFlow initializeFlow() throws IOException { + return Utils.newFlow(); + } +} + +class Utils { + static String getRedirectUri(HttpServletRequest req) { + GenericUrl url = new GenericUrl(req.getRequestURL().toString()); + url.setRawPath("/oauth2callback"); + return url.build(); + } + + static GoogleAuthorizationCodeFlow newFlow() throws IOException { + return new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, + getClientCredential(), Collections.singleton(CalendarScopes.CALENDAR)).setDataStoreFactory( + DATA_STORE_FACTORY).setAccessType("offline").build(); + } +} + +public class OAuth2Callback extends AbstractAppEngineAuthorizationCodeCallbackServlet { + + private static final long serialVersionUID = 1L; + + @Override + protected void onSuccess(HttpServletRequest req, HttpServletResponse resp, Credential credential) + throws ServletException, IOException { + resp.sendRedirect("/"); + } + + @Override + protected void onError( + HttpServletRequest req, HttpServletResponse resp, AuthorizationCodeResponseUrl errorResponse) + throws ServletException, IOException { + String nickname = UserServiceFactory.getUserService().getCurrentUser().getNickname(); + resp.getWriter().print("

" + nickname + ", why don't you want to play with me?

"); + resp.setStatus(200); + resp.addHeader("Content-Type", "text/html"); + } + + @Override + protected String getRedirectUri(HttpServletRequest req) throws ServletException, IOException { + return Utils.getRedirectUri(req); + } + + @Override + protected AuthorizationCodeFlow initializeFlow() throws IOException { + return Utils.newFlow(); + } +} +``` + +Please also see [storage-serviceaccount-appengine-sample](https://github.com/GoogleCloudPlatform/cloud-storage-docs-xml-api-examples) for an additional example. + +## Service accounts ## + +[GoogleCredential](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.html) also supports [service accounts](https://developers.google.com/accounts/docs/OAuth2ServiceAccount). Unlike the credential in which a client application requests access to an end-user's data, Service Accounts provide access to the client application's own data. Your client application signs the request for an access token using a private key downloaded from the [Google Developers console](#Google_Developers_Console.md). + +Example code taken from [plus-serviceaccount-cmdline-sample](http://samples.google-api-java-client.googlecode.com/hg/plus-serviceaccount-cmdline-sample/instructions.html): + +``` +HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); +JsonFactory jsonFactory = JacksonFactory.getDefaultInstance(); +... +// Build service account credential. +GoogleCredential credential = new GoogleCredential.Builder().setTransport(httpTransport) + .setJsonFactory(jsonFactory) + .setServiceAccountId(SERVICE_ACCOUNT_EMAIL) + .setServiceAccountScopes(Collections.singleton(PlusScopes.PLUS_ME)) + .setServiceAccountPrivateKeyFromP12File(new File("key.p12")) + .build(); +// set up global Plus instance +plus = new Plus.Builder(httpTransport, jsonFactory, credential) + .setApplicationName(APPLICATION_NAME).build(); +... +``` + +Please also see [storage-serviceaccount-cmdline-sample](https://github.com/GoogleCloudPlatform/cloud-storage-docs-xml-api-examples) for an additional example. + +### Impersonation ### +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 [GoogleCredential.BuildersetServiceAccountUser(String)](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.Builder.html#setServiceAccountUser%28java.lang.String%29). + + +## Installed applications ## + +This is the command-line authorization code flow described in [Using OAuth 2.0 for Installed Applications](https://developers.google.com/accounts/docs/OAuth2InstalledApp). + +Example snippet from [plus-cmdline-sample](http://samples.google-api-java-client.googlecode.com/hg/plus-cmdline-sample/instructions.html) + +``` +public static void main(String[] args) { + try { + httpTransport = GoogleNetHttpTransport.newTrustedTransport(); + dataStoreFactory = new FileDataStoreFactory(DATA_STORE_DIR); + // authorization + Credential credential = authorize(); + // set up global Plus instance + plus = new Plus.Builder(httpTransport, JSON_FACTORY, credential).setApplicationName( + APPLICATION_NAME).build(); + // ... +} + +private static Credential authorize() throws Exception { + // load client secrets + GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, + new InputStreamReader(PlusSample.class.getResourceAsStream("/client_secrets.json"))); + // set up authorization code flow + GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder( + httpTransport, JSON_FACTORY, clientSecrets, + Collections.singleton(PlusScopes.PLUS_ME)).setDataStoreFactory( + dataStoreFactory).build(); + // authorize + return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user"); +} +``` + +## Client-side applications ## + +These are the typical steps of the the browser-based client flow described in [Using OAuth 2.0 for Client-side Applications](https://developers.google.com/accounts/docs/OAuth2UserAgent): + + * Redirect the end user in the browser to the authorization page using [GoogleBrowserClientRequestUrl](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleBrowserClientRequestUrl.html) to grant your browser application access to the end user's protected data. + * Use the [Google API Client Library for JavaScript](http://code.google.com/p/google-api-javascript-client/) to process the access token found in the URL fragment at the redirect URI registered at the [Google Developers Console](#Google_Developers_Console.md). + +Sample usage for a web application: + +``` +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); +} +``` + +## Android ## +[@Beta](https://code.google.com/p/google-api-java-client/#@Beta) + +**Which library to use with Android:** + +If you are developing for Android and the Google API you want to use is included in the [Google Play Services library](https://developer.android.com/google/play-services/index.html), use that library for the best performance and experience. If the Google API you want to use with Android is not part of the Google Play Services library, you can use the Google APIs Client Library for Java, which supports Android 1.5 (or higher), and which is described here. The support for Android in the Google APIs Client Library for Java is [@Beta](https://code.google.com/p/google-api-java-client/#@Beta). + +**Background:** + +Starting with Eclair (SDK 2.1), user accounts are managed on an Android device using the Account Manager. All Android application authorization is centrally managed by the SDK using [AccountManager](http://developer.android.com/reference/android/accounts/AccountManager.html). You specify the OAuth 2.0 scope your application needs, and it returns an access token to use. + +The OAuth 2.0 scope is specified via the `authTokenType` parameter as `oauth2:` plus the scope. For example: + +``` +oauth2:https://www.googleapis.com/auth/tasks +``` + +This specifies read/write access to the Google Tasks API. If you need multiple OAuth 2.0 scopes, use a space-separated list. + +Some APIs have special `authTokenType` parameters that also work. For example, "Manage your tasks" is an alias for the `authtokenType` example shown above. + +You must also specify the API key from the [Google Developers Console](#Google_Developers_Console.md). Otherwise, the token that the AccountManager gives you only provides you with anonymous quota, which is usually very low. By contrast, by specifying an API key you receive a higher free quota, and can optionally set up billing for usage above that. + +Example code snippet taken from [tasks-android-sample](http://samples.google-api-java-client.googlecode.com/hg/tasks-android-sample/instructions.html): + +``` +com.google.api.services.tasks.Tasks service; + +@Override +public void onCreate(Bundle savedInstanceState) { + credential = + GoogleAccountCredential.usingOAuth2(this, Collections.singleton(TasksScopes.TASKS)); + SharedPreferences settings = getPreferences(Context.MODE_PRIVATE); + credential.setSelectedAccountName(settings.getString(PREF_ACCOUNT_NAME, null)); + service = + new com.google.api.services.tasks.Tasks.Builder(httpTransport, jsonFactory, credential) + .setApplicationName("Google-TasksAndroidSample/1.0").build(); +} + +private void chooseAccount() { + startActivityForResult(credential.newChooseAccountIntent(), REQUEST_ACCOUNT_PICKER); +} + +@Override +protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case REQUEST_GOOGLE_PLAY_SERVICES: + if (resultCode == Activity.RESULT_OK) { + haveGooglePlayServices(); + } else { + checkGooglePlayServicesAvailable(); + } + break; + case REQUEST_AUTHORIZATION: + if (resultCode == Activity.RESULT_OK) { + AsyncLoadTasks.run(this); + } else { + chooseAccount(); + } + break; + case REQUEST_ACCOUNT_PICKER: + if (resultCode == Activity.RESULT_OK && data != null && data.getExtras() != null) { + String accountName = data.getExtras().getString(AccountManager.KEY_ACCOUNT_NAME); + if (accountName != null) { + credential.setSelectedAccountName(accountName); + SharedPreferences settings = getPreferences(Context.MODE_PRIVATE); + SharedPreferences.Editor editor = settings.edit(); + editor.putString(PREF_ACCOUNT_NAME, accountName); + editor.commit(); + AsyncLoadTasks.run(this); + } + } + break; + } +} +``` \ No newline at end of file diff --git a/ProjectHome.md b/ProjectHome.md new file mode 100644 index 00000000..4ce80287 --- /dev/null +++ b/ProjectHome.md @@ -0,0 +1,170 @@ +| [Developer's Guide](DeveloperGuide.md) | [Libraries and Samples](https://developers.google.com/api-client-library/java/apis/) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/index.html) | [Get Help](Support.md) | +|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +# Google APIs Client Library for Java # + +This has moved to GitHub: https://github.com/google/google-api-java-client + +_Issues have been migrated to the [GitHub issue tracker](https://github.com/google/google-api-java-client/issues). If you own an open issue on this site, you can find a copy of it on GitHub. Please leave your comments over there._ + + * [Overview](#Overview.md) + * [Highlighted Features](#Highlighted_Features.md) + * [Dependencies](#Dependencies.md) + * [Important Warnings](#Important_Warnings.md) + * [@Beta](#@Beta.md) + * [Deprecations](#Deprecations.md) + +# Overview # + +The Google APIs Client Library for Java is a flexible, efficient, and powerful Java client library for accessing any HTTP-based API on the web, not just Google APIs. + +The library has the following features: + * A powerful [OAuth 2.0](http://code.google.com/p/google-api-java-client/wiki/OAuth2) library with a consistent interface. + * Lightweight, efficient XML and JSON data models that support any data schema. + * Support for [protocol buffers](https://code.google.com/p/protobuf/). + * A set of [generated libraries for Google APIs](https://developers.google.com/api-client-library/java/apis/). + +**Accessing Google APIs** + +To use Google's Java client libraries to call any Google API, you need two libraries: + + * The core Google APIs Client Library for Java (google-api-java-client), which is the generic runtime library described here. This library provides functionality common to all APIs, for example HTTP transport, error handling, authentication, JSON parsing, media download/upload, and batching. + * An auto-generated Java library for the API you are accessing, for example the [generated Java library for the BigQuery API](https://code.google.com/p/google-api-java-client/source/browse/bigquery-appengine-sample/?repo=samples#bigquery-appengine-sample%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fapi%2Fclient%2Fsample%2Fbigquery%2Fappengine%2Fdashboard%253Fstate%253Dclosed). These generated libraries include API-specific information such as the root URL, and classes that represent entities in the context of the API. These classes are useful for making conversions between JSON objects and Java objects. + +To find the generated library for a Google API, visit [Google APIs Client Library for Java](https://developers.google.com/api-client-library/java/apis/). The API-specific Java packages include both the core google-api-java-client and the client-specific libraries. + +If you are using the old GData library, you need to [migrate](http://code.google.com/p/gdata-java-client/wiki/MigratingToGoogleApiJavaClient). + +**Developing for Android** + +If you are developing for Android and the Google API you want to use is included in the [Google Play Services library](https://developer.android.com/google/play-services/index.html), you should use that library for the best performance and experience. + +To access other Google APIs, you can use the Google APIs Client Library for Java, which supports [Android 1.5 (or higher)](Android.md). + +**Other Java environments** + +In addition to Android 1.5 or higher, the Google APIs Client Library for Java supports the following Java environments: + * Java 5 (or higher), standard (SE) and enterprise (EE) + * [Google App Engine](GoogleAppEngine.md) + +Not supported: Google Web Toolkit (GWT), Java mobile (ME), and Java 1.4 (or earlier). + +# Highlighted Features # +**The library makes it simple to call Google APIs.** + +> You can call Google APIs using Google service-specific generated libraries with the Google APIs Client Library for Java. Here's an example that makes a call to the [Google Calendar API](https://developers.google.com/google-apps/calendar/): + +``` + // Show events on user's calendar. + View.header("Show Calendars"); + CalendarList feed = client.calendarList().list().execute(); + View.display(feed); +``` + +**The library makes authentication easier.** + +> The authentication library can reduce the amount of code needed to handle [OAuth 2.0](OAuth2.md), and sometimes a few lines is all you need. For example: + +``` + /** Authorizes the installed application to access user's protected data. */ + private static Credential authorize() throws Exception { + // load client secrets + GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, + new InputStreamReader(CalendarSample.class.getResourceAsStream("/client_secrets.json"))); + // set up authorization code flow + GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder( + httpTransport, JSON_FACTORY, clientSecrets, + Collections.singleton(CalendarScopes.CALENDAR)).setDataStoreFactory(dataStoreFactory) + .build(); + // authorize + return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user"); + } +``` +**The library makes batching and media upload/download easier.** + +> The library offers helper classes for [batching](Batch.md), [media upload](MediaUpload.md), and [media download](MediaDownload.md). + +**The library runs on Google App Engine.** + +> [App Engine-specific helpers](GoogleAppEngine.md) make quick work of authenticated calls to APIs, and you do not need to worry about exchanging code for tokens. For example: + +``` + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { + AppIdentityCredential credential = + new AppIdentityCredential(Arrays.asList(UrlshortenerScopes.URLSHORTENER)); + Urlshortener shortener = + new Urlshortener.Builder(new UrlFetchTransport(), new JacksonFactory(), credential) + .build(); + UrlHistory history = shortener.URL().list().execute(); + ... + } +``` + +**The library runs on [Android (@Beta)](#@Beta.md).** + +> If you are developing for Android and the Google API you want to use is included in the [Google Play Services library](https://developer.android.com/google/play-services/index.html), you should use that library for the best performance and experience. + +> To access other Google APIs, you can use the Google Client Library for Java's Android-specific helper classes, which are are well-integrated with [Android AccountManager](http://developer.android.com/reference/android/accounts/AccountManager.html). For example: + +``` + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + // Google Accounts + credential = + GoogleAccountCredential.usingOAuth2(this, Collections.singleton(TasksScopes.TASKS)); + SharedPreferences settings = getPreferences(Context.MODE_PRIVATE); + credential.setSelectedAccountName(settings.getString(PREF_ACCOUNT_NAME, null)); + // Tasks client + service = + new com.google.api.services.tasks.Tasks.Builder(httpTransport, jsonFactory, credential) + .setApplicationName("Google-TasksAndroidSample/1.0").build(); + } +``` + +**The library is easy to install.** + +> The Google APIs Client Library for Java is easy to install, and you can download the binary directly from the [Downloads page](Downloads.md), or you can use Maven or Gradle. +> To use Maven, add the following lines to your pom.xml file: + +``` + + + + com.google.api-client + google-api-client + 1.18.0-rc + + + +``` + +> To use Gradle, add the following lines to your build.gradle file: + +``` + repositories { + mavenCentral() + } + dependencies { + compile 'com.google.api-client:google-api-client:1.18.0-rc' + } +``` + +# Dependencies # +This library is built on top of two common libraries, also built by Google, and also designed to work with any HTTP service on the web: + * [Google HTTP Client Library for Java](http://code.google.com/p/google-http-java-client/) + * [Google OAuth Client Library for Java](http://code.google.com/p/google-oauth-java-client/) + +# Important Warnings # + +## @Beta ## + +Features marked with the @Beta annotation at the class or method level are subject to change. They might be modified in any way, or even removed, in any major release. You should not use beta features if your code is a library itself (that is, if your code is used on the CLASSPATH of users outside your own control). + +## Deprecations ## + +Deprecated non-beta features will be removed eighteen months after the release in which they are first deprecated. You must fix your usages before this time. If you don't, any type of breakage might result, and you are not guaranteed a compilation error. + + + \ No newline at end of file diff --git a/ReleaseNotes.md b/ReleaseNotes.md new file mode 100644 index 00000000..300b3f38 --- /dev/null +++ b/ReleaseNotes.md @@ -0,0 +1,322 @@ + + +# Version 1.18.0-rc # + +_April 10, 2014_ + +| [New Features in base library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.18.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/jdiff/changes.html) | +|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +# Version 1.16.0-rc # + +_August 5, 2013_ + +| [New Features in base library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.16.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.16.0-rc/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.16.0-rc/jdiff/changes.html) | +|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Highlights: + + * [Updated to google-http-java-client version 1.16.0-rc](http://google-http-java-client.blogspot.com/2013/08/version-1160-rc-released.html) + * [Updated to google-oauth-java-client version 1.16.0-rc](http://google-oauth-java-client.blogspot.com/2013/08/version-1160-rc-released.html) + * [[Issue 783](https://code.google.com/p/google-api-java-client/issues/detail?id=783)] Created google-api-client-protobuf for the generated service-specific libraries based on the Protobuf format + * [[Issue 772](https://code.google.com/p/google-api-java-client/issues/detail?id=772)] Fixed a bug where MediaHttpUploader.serverErrorCallback() would not work if the data was partially or fully uploaded + * [[Issue 796](https://code.google.com/p/google-api-java-client/issues/detail?id=796)] Removed Beta API deprecated in 1.15 _(backwards incompatible change)_ + * [[Issue 530](https://code.google.com/p/google-api-java-client/issues/detail?id=530)] Added the App Engine test framework to google-api-client-appengine + + +# Version 1.15.0-rc # + +_May 10, 2013_ + +| [New Features in base library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.15.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.15.0-rc/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.15.0-rc/jdiff/changes.html) | +|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Announcing the first release candidate of the Google API Java Client library! The library is finally going out of beta. + +Note that there are still some features of the library in active development that may require backwards incompatible changes in future releases before they are ready to fully go out of beta. Each of these features is annotated with a @Beta tag. + +In addition, the core and generated libraries have fully transitioned from our own Maven repository to the Central Maven Repository. +Users of older versions should remove the reference to our `` at `https://google-api-client-libraries.appspot.com/mavenrepo` in pom.xml, in order to fetch the latest version from the Central Repository. + +Highlights: + + * Updated to [google-http-java-client version 1.15.0-rc](http://google-http-java-client.blogspot.com/2013/05/version-1150-rc-released.html) + * Updated to [google-oauth-java-client version 1.15.0-rc](http://google-oauth-java-client.blogspot.com/2013/05/version-1150-rc-released.html) + * [[Issue 686](https://code.google.com/p/google-api-java-client/issues/detail?id=686)]: Marked specific parts of the library as Beta + * [[Issue 753](https://code.google.com/p/google-api-java-client/issues/detail?id=753)]: Removed deprecated API from 1.14 (backwards incompatible) + * [[Issue 745](https://code.google.com/p/google-api-java-client/issues/detail?id=745)]: Added Google Compute Engine service accounts + * [[Issue 755](https://code.google.com/p/google-api-java-client/issues/detail?id=755)]: Added ability to specify public certs URL for ID Token verification + * [[Issue 734](https://code.google.com/p/google-api-java-client/issues/detail?id=734)]: Allowed exponential backoff behavior to be customized via backoff handlers. + +# Version 1.14.1-beta # + +_Mar 25, 2013_ + +| [New Features in base library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.14.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.14.1-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.14.1-beta/jdiff/changes.html) | +|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Highlights: + + * Updated to [google-http-java-client version 1.14.1-beta](http://google-http-java-client.blogspot.com/2013/03/version-1141-beta-released.html) + * Updated to [google-oauth-java-client version 1.14.1-beta](http://google-oauth-java-client.blogspot.com/2013/03/version-1141-beta-released.html) + * [[Issue 685](http://code.google.com/p/google-api-java-client/issues/detail?id=685)]: Restrict trusted CAs to only those used by Google + * [[Issue 705](http://code.google.com/p/google-api-java-client/issues/detail?id=705)]: Updated to the latest OpenID Connect specification + * [[Issue 693](http://code.google.com/p/google-api-java-client/issues/detail?id=693)]: Now generate a BigInteger instead of UnsignedLong for uint64 _(backwards incompatible change)_ + * [[Issue 647](http://code.google.com/p/google-api-java-client/issues/detail?id=647)]: Added support for Google’s subscriptions protocol + * [[Issue 650](http://code.google.com/p/google-api-java-client/issues/detail?id=650)]: Removed some deprecated API from 1.13 _(backwards incompatible change)_ + * [[Issue 708](http://code.google.com/p/google-api-java-client/issues/detail?id=708)]: Now uses supportsMediaDownload flag from Discovery to determine if a method supports media download + * [[Issue 443](http://code.google.com/p/google-api-java-client/issues/detail?id=443)]: Fixed an issue where empty XScopes files were being generated + * [[Issue 437](http://code.google.com/p/google-api-java-client/issues/detail?id=437)]: Added methods to decode and encode base64 data to generated classes + * [[Issue 693](http://code.google.com/p/google-api-java-client/issues/detail?id=693)]: Generate a clone method in model classes + * [[Issue 466](http://code.google.com/p/google-api-java-client/issues/detail?id=466)] and [[Issue 692](http://code.google.com/p/google-api-java-client/issues/detail?id=692)]: Now throw an exception if a required schema parameter isn’t specified or required content is missing + * [[Issue 579](http://code.google.com/p/google-api-java-client/issues/detail?id=579)] and [[Issue 581](http://code.google.com/p/google-api-java-client/issues/detail?id=581)]: Fixed issues with resumable direct downloads and uploads + * [[Issue 697](http://code.google.com/p/google-api-java-client/issues/detail?id=697)]: Renamed dependencies files to match package names. + + +# Version 1.13.2-beta # + +_Jan 17, 2013_ + +| [New Features in base library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.13.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.13.2-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.13.2-beta/jdiff/changes.html) | +|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Highlights: + + * Updated to [google-http-java-client version 1.13.1-beta](http://google-http-java-client.blogspot.com/2013/01/version-1131-beta-released.html) + * Updated to [google-oauth-java-client version 1.13.1-beta](http://google-oauth-java-client.blogspot.com/2013/01/version-1131-beta-released.html) + * [[Issue 673](http://code.google.com/p/google-api-java-client/issues/detail?id=673)] Fixed: NullPointerException on error when doing resumable media upload + * [[Issue 663](http://code.google.com/p/google-api-java-client/issues/detail?id=663)] Fixed: range query request in MediaHttpUploader#serverErrorCallback fails with a 411 + * [[Issue 662](http://code.google.com/p/google-api-java-client/issues/detail?id=662)] MediaHttpUploader enforces that chunk sizes are multiples of 256KB + * [[Issue 660](http://code.google.com/p/google-api-java-client/issues/detail?id=660)] Deprecated GoogleHeaders in preference of HttpHeaders, and deprecated GoogleUrl in preference of GenericUrl (backwards incompatible change) + * [[Issue 653](http://code.google.com/p/google-api-java-client/issues/detail?id=653)] Change GET to POST if URI is too long + * [[Issue 649](http://code.google.com/p/google-api-java-client/issues/detail?id=649)] Support PEM file format as input format for service accounts + * [[Issue 641](http://code.google.com/p/google-api-java-client/issues/detail?id=641)] MediaHttpUploader: direct upload sets the request headers + * [[Issue 638](http://code.google.com/p/google-api-java-client/issues/detail?id=638)] MediaHttpUploader now respects AbstractGoogleClientRequest.setDisableGZipContent(true) + * [[Issue 634](http://code.google.com/p/google-api-java-client/issues/detail?id=634)] MediaHttpDownloader: added setContentRange + * [[Issue 591](http://code.google.com/p/google-api-java-client/issues/detail?id=591)] MediaHttpUploader.upload() requires a known InputStreamContent size + * AbstractGoogleClient now logs a warning if no application name has been set. + +# Version 1.12.0-beta # + +_Nov 8, 2012_ + +| [New Features in base library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.12.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.12.0-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.12.0-beta/jdiff/changes.html) | +|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Highlights: + + * Updated to [google-http-java-client version 1.12](http://google-http-java-client.blogspot.com/2012/11/version-1120-beta-released_2495.html). + * Updated to [google-oauth-java-client version 1.12](http://google-oauth-java-client.blogspot.com/2012/11/version-1120-beta-released.html). + * Google API libraries version skipped from 1.9 to 1.12 so we can match the version of the core google-api-java-client library and thus reduce confusion. + * Maven: repository URL of the Google API libraries has changed to http://google-api-client-libraries.appspot.com/mavenrepo + * Updated [calendar-android-sample](http://samples.google-api-java-client.googlecode.com/hg/calendar-android-sample/instructions.html) and [tasks-android-sample](http://samples.google-api-java-client.googlecode.com/hg/tasks-android-sample/instructions.html) to demonstrate best practice of using Google Play services for OAuth 2. + * [[Issue 629](http://code.google.com/p/google-api-java-client/issues/detail?id=629)] Fixed the 411 Length Required error in custom PUT methods. + * [[Issue 561](http://code.google.com/p/google-api-java-client/issues/detail?id=561)] Added [GoogleAccountCredential](http://javadoc.google-api-java-client.googlecode.com/hg/1.12.0-beta/com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAccountCredential.html) for Android. + * [[Issue 55](http://code.google.com/p/google-oauth-java-client/issues/detail?id=55)] Fixed [FileCredentialStore](http://javadoc.google-oauth-java-client.googlecode.com/hg/1.12.0-beta/com/google/api/client/extensions/java6/auth/oauth2/FileCredentialStore.html) failure on Windows. + * [[Issue 601](http://code.google.com/p/google-api-java-client/issues/detail?id=601)] Service-specific Eclipse Android properties file has been added. + * [[Issue 642](http://code.google.com/p/google-api-java-client/issues/detail?id=642)] Fixed classpath entries in the generated libraries manifest. + * [[Issue 643](http://code.google.com/p/google-api-java-client/issues/detail?id=643)] Using wrong version of the core library now throws an Error. + * [[Issue 645](http://code.google.com/p/google-api-java-client/issues/detail?id=645)] setXYZRequestInitializer has been added to the generated libraries Builder. + * [[Issue 622](http://code.google.com/p/google-api-java-client/issues/detail?id=622)] Can now execute using HEAD. + * [[Issue 220](http://code.google.com/p/google-api-java-client/issues/detail?id=220)] Added support for non-json alt types. + +# Version 1.11.0-beta # + +_Sept 25, 2012_ + +| [New Features in base library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.11.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [New Features in generated library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=Milestone%3DCodeGenVersion1.8.0+status%3DFixed&colspec=ID+Type+Priority+Summary) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.11.0-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.11.0-beta/jdiff/changes.html) | +|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Highlights: + + * [[Issue 574](http://code.google.com/p/google-api-java-client/issues/detail?id=574)] Removed deprecated classes/methods/fields from version 1.10. + * [[Issue 310](http://code.google.com/p/google-api-java-client/issues/detail?id=310)] Added command line auth helpers to google-api-java-client. + * [[Issue 594](http://code.google.com/p/google-api-java-client/issues/detail?id=594)] Renamed g-a-c-android2 to g-a-c-android. + * [[Issue 597](http://code.google.com/p/google-api-java-client/issues/detail?id=597)] Created properties files for Eclipse Android support. + * [[Issue 389](http://code.google.com/p/google-api-java-client/issues/detail?id=389)] Added support for UnsignedLong in service-specific libraries + * [[Issue 583](http://code.google.com/p/google-api-java-client/issues/detail?id=583)] DateTime is now used for “date†values in service-specific libraries + * [[Issue 525](http://code.google.com/p/google-api-java-client/issues/detail?id=525)] Added support for redirects in BatchRequest. + * [[Issue 560](http://code.google.com/p/google-api-java-client/issues/detail?id=560)] Batch now adds authorization to the top-level request. + * Updated to google-http-java-client version 1.11. + * Updated to google-oauth-java-client version 1.11. + +# Version 1.10.3-beta # + +_June 25, 2012_ + +| [Bugs Fixed](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone=Version1.10.3%20status=Fixed&colspec=ID%20Type%20Priority%20Summary) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.10.3-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.10.3-beta/jdiff/changes.html) | +|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +[Bugs Fixed](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone=Version1.10.3%20status=Fixed&colspec=ID%20Type%20Priority%20Summary):
+Issue [527](http://code.google.com/p/google-api-java-client/issues/detail?id=527): Proguard does not strip out GoogleJsonError.ErrorInfo anymore.
+Issue [528](http://code.google.com/p/google-api-java-client/issues/detail?id=528): Proguard does not strip out model. anymore.
+Updated to google-http-java-client version 1.10.3-beta.
+Updated to google-oauth-java-client version 1.10.1-beta.
+ + +# Version 1.10.2-beta # + +_June 18, 2012_ + +| [Bugs Fixed](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone=Version1.10.2%20status=Fixed&colspec=ID%20Type%20Priority%20Summary) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.10.2-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.10.2-beta/jdiff/changes.html) | +|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +[Bugs Fixed](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone=Version1.10.2%20status=Fixed&colspec=ID%20Type%20Priority%20Summary):
+Issue [521](http://code.google.com/p/google-api-java-client/issues/detail?id=521): Fixed resumable upload failure when writing multiple chunks.
+Issue [512](http://code.google.com/p/google-api-java-client/issues/detail?id=512): Added exponential backoff to Batch.
+ +# Version 1.10.1-beta # + +_June 14, 2012_ + +| [New Features in base library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.10.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [New Features in generated library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=Milestone%3DCodeGenVersion1.7.0+status%3DFixed&colspec=ID+Type+Priority+Summary) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.10.1-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.10.1-beta/jdiff/changes.html) | +|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Highlights: + * [[Issue 516](http://code.google.com/p/google-api-java-client/issues/detail?id=516)] Changed accessType and approvalPrompt defaults in GoogleAuthorizationCodeFlow. + * [[Issue 402](http://code.google.com/p/google-api-java-client/issues/detail?id=402)] Fixed memory leaks. + * [[Issue 125](http://code.google.com/p/google-http-java-client/issues/detail?id=125)] Fixed issue of creating UrlFetchTransport in GAE SDK 1.6.6 in google-http-java-client. + * [[Issue 116](http://code.google.com/p/google-http-java-client/issues/detail?id=116)] Fixed CloseGuard error after EOFException in google-http-java-client. + * [[Issue 78](http://code.google.com/p/google-http-java-client/issues/detail?id=78)] Fixed memory leaks in google-http-java-client. + * [[Issue 118](http://code.google.com/p/google-http-java-client/issues/detail?id=118)] UriTemplate.expand now supports Iterable for list parameters in google-http-java-client. + * [[Issue 514](http://code.google.com/p/google-api-java-client/issues/detail?id=514)] Added HttpRequestInitializer to constructor and Builder of generated service-specific libraries. + * [[Issue 511](http://code.google.com/p/google-api-java-client/issues/detail?id=511)] Moved enableGZipContent to JsonHttpRequest and removed builder() methods. + * [[Issue 500](http://code.google.com/p/google-api-java-client/issues/detail?id=500)] Updated GoogleClient to use rootUrl and servicePath. + * Improvements to the surface of the service-specific generated libraries: + * [[Issue 505](http://code.google.com/p/google-api-java-client/issues/detail?id=505)] New structure for jars in zip package of generated libraries. + * [[Issue 483](http://code.google.com/p/google-api-java-client/issues/detail?id=483)] setFields are now overridden. + * [[Issue 387](http://code.google.com/p/google-api-java-client/issues/detail?id=387)] Created an isX() method for boolean parameters. + * [[Issue 515](http://code.google.com/p/google-api-java-client/issues/detail?id=515)] Generated service-specific libraries now use rootUrl rather than baseUrl. + * [[Issue 518](http://code.google.com/p/google-api-java-client/issues/detail?id=518)] Added Maven archtype catalog. + * Updated to google-http-java-client version 1.10. + * Updated to google-oauth-java-client version 1.10. + +# Version 1.9.0-beta # + +_May 18, 2012_ + +| [New Features in base library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.9.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [New Features in generated library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=Milestone%3DCodeGenVersion1.6.0+status%3DFixed&colspec=ID+Type+Priority+Summary) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.9.0-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.9.0-beta/jdiff/changes.html) | +|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Highlights: + * [[Issue 308](http://code.google.com/p/google-api-java-client/issues/detail?id=308)] Added support for [Batch](http://code.google.com/p/google-api-java-client/wiki/Batch). + * [[Issue 448](http://code.google.com/p/google-api-java-client/issues/detail?id=448)] Added support for [Resumable Media Download](http://code.google.com/p/google-api-java-client/wiki/MediaDownload#Resumable_Media_Download). + * [[Issue 391](http://code.google.com/p/google-api-java-client/issues/detail?id=391)] Added support for [Direct Media Upload](http://code.google.com/p/google-api-java-client/wiki/MediaUpload#Direct_Media_Upload). + * [[Issue 459](http://code.google.com/p/google-api-java-client/issues/detail?id=459)] [GoogleIdTokenVerifier](http://javadoc.google-api-java-client.googlecode.com/hg/1.9.0-beta/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenVerifier.html) now has support for specifying multiple client ids. + * [[Issue 452](http://code.google.com/p/google-api-java-client/issues/detail?id=452)] Handled connection errors in [MediaHttpUploader](http://javadoc.google-api-java-client.googlecode.com/hg/1.9.0-beta/com/google/api/client/googleapis/media/MediaHttpUploader.html). + * [[Issue 473](http://code.google.com/p/google-api-java-client/issues/detail?id=473)] [MediaHttpUploader](http://javadoc.google-api-java-client.googlecode.com/hg/1.9.0-beta/com/google/api/client/googleapis/media/MediaHttpUploader.html) now handles input streams that do not support mark(). + * Improvements to the surface of the service-specific generated libraries: + * [[Issue 215](http://code.google.com/p/google-api-java-client/issues/detail?id=215)] Added support for specifying HTTP headers on a request. + * [[Issue 346](http://code.google.com/p/google-api-java-client/issues/detail?id=346)] Handled case where default value for alt parameter is not json. + * [[Issue 489](http://code.google.com/p/google-api-java-client/issues/detail?id=489)] Fixed compilation error when method names are the same name as the collection. + * [[Issue 490](http://code.google.com/p/google-api-java-client/issues/detail?id=490)] Fixed compilation error when deeply nested classes have the same name as one of its ancestors. + * [[Issue 480](http://code.google.com/p/google-api-java-client/issues/detail?id=480)] Removed xpp3 as a dependency for Android. + * [[Issue 461](http://code.google.com/p/google-api-java-client/issues/detail?id=461)] Generalized dependency instructions for non-Android. + * [[Issue 487](http://code.google.com/p/google-api-java-client/issues/detail?id=487)] Created new structure for jars in the zip package. + * [[Issue 471](http://code.google.com/p/google-api-java-client/issues/detail?id=471)] Removed deprecated classes/methods/fields from version 1.8. + * Updated to [google-http-java-client version 1.9](http://google-http-java-client.blogspot.com/2012/05/version-190-beta-released.html). + * Updated to [google-oauth-java-client version 1.9](http://google-oauth-java-client.blogspot.com/2012/05/version-190-beta-released.html). + +# Version 1.8.0-beta # + +_April 4, 2012_ + +| [New Features in base library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.8.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [New Features in generated library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=Milestone%3DCodeGenVersion1.5.0+status%3DFixed&colspec=ID+Type+Priority+Summary) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.8.0-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.8.0-beta/jdiff/changes.html) | +|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Highlights: + * Improvements to the surface of the service-specific generated libraries: + * [[Issue 434](http://code.google.com/p/google-api-java-client/issues/detail?id=434)] Added support for direct media download. + * [[Issue 444](http://code.google.com/p/google-api-java-client/issues/detail?id=444)] Resumable media upload now uses the base URL set through builder.setBaseUrl. + * [[Issue 436](http://code.google.com/p/google-api-java-client/issues/detail?id=436)] [GoogleKeyInitializer](http://javadoc.google-api-java-client.googlecode.com/hg/1.8.0-beta/com/google/api/client/googleapis/services/GoogleKeyInitializer.html) has been added. + * [[Issue 440](http://code.google.com/p/google-api-java-client/issues/detail?id=440)] [GoogleJsonResponseException](http://javadoc.google-api-java-client.googlecode.com/hg/1.8.0-beta/com/google/api/client/googleapis/json/GoogleJsonResponseException.html) no longer throws an NPE when the response has no content. + * [[Issue 430](http://code.google.com/p/google-api-java-client/issues/detail?id=430)] [GoogleIdTokenVerifier](http://javadoc.google-api-java-client.googlecode.com/hg/1.8.0-beta/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenVerifier.html) now supports arbitary client\_ids. + * [[Issue 431](http://code.google.com/p/google-api-java-client/issues/detail?id=431)] [AppIdentityCredential.intercept](http://javadoc.google-api-java-client.googlecode.com/hg/1.8.0-beta/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredential.html#intercept(com.google.api.client.http.HttpRequest)) now throws IOException on AppIdentityServiceFailureException. + * [[Issue 145](http://code.google.com/p/google-api-java-client/issues/detail?id=145)] Constructors that take required parameters for compile-time checking. + * [[Issue 432](http://code.google.com/p/google-api-java-client/issues/detail?id=432)] Some deprecated classes/methods/fields from version 1.7 have been removed. + * Updated to [google-http-java-client version 1.8](http://google-http-java-client.blogspot.com/2012/04/version-183-beta-released.html). + * Updated to [google-oauth-java-client version 1.8](http://google-oauth-java-client.blogspot.com/2012/04/version-180-beta-released.html). + +# Version 1.7.0-beta # + +_Mar 12, 2012_ + +| [New Features in base library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.7.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [New Features in generated library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=Milestone%3DCodeGenVersion1.4.0+status%3DFixed&colspec=ID+Type+Priority+Summary) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.7.0-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.7.0-beta/jdiff/changes.html) | +|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Highlights: + * [[Issue 2](http://code.google.com/p/google-api-java-client/issues/detail?id=2)] Resumable media upload is now supported. + * [[Issue 365](http://code.google.com/p/google-api-java-client/issues/detail?id=365)] Updated to the latest [OAuth 2.0](http://code.google.com/p/google-api-java-client/wiki/OAuth2) (draft 23). + * [[Issue 338](http://code.google.com/p/google-api-java-client/issues/detail?id=338)] Support for client\_secrets.json has been added. + * [[Issue 406](http://code.google.com/p/google-api-java-client/issues/detail?id=406)] Google ID Tokens based on JSON Web Tokens is now supported. + * [[Issue 321](http://code.google.com/p/google-api-java-client/issues/detail?id=321)] Asserting identity on Google App Engine to Google APIs is now supported. + * [[Issue 140](http://code.google.com/p/google-api-java-client/issues/detail?id=140)] Exponential backoff is now supported. + * Improvements to the surface of the service-specific generated libraries: + * [[Issue 306](http://code.google.com/p/google-api-java-client/issues/detail?id=306)] Top level schema classes which are arrays are now generated correctly. + * [[Issue 304](http://code.google.com/p/google-api-java-client/issues/detail?id=304)] Inner classes for unnamed objects. + * [[Issue 359](http://code.google.com/p/google-api-java-client/issues/detail?id=359)] OAuth 2.0 scopes are now generated. + * Library version now includes a revision number, e.g. “rev2â€, that indicates a revision of the API without changing the version. + * [[Issue 407](http://code.google.com/p/google-api-java-client/issues/detail?id=407)] Split and renamed extension projects to be more intuitive. + * [[Issue 352](http://code.google.com/p/google-api-java-client/issues/detail?id=352)] Deprecated classes/methods/fields from version 1.6 have been removed. + * Updated to [google-http-java-client version 1.7](http://google-http-java-client.blogspot.com/2012/03/version-170-beta-released.html). + * Updated to [google-oauth-java-client version 1.7](http://google-oauth-java-client.blogspot.com/2012/03/version-170-beta-released.html). + +# Version 1.6.0-beta # + +_Nov 8, 2011_ + +| [New Features in base library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.6.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [New Features in generated library](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=Milestone%3DCodeGenVersion1.3.0+status%3DFixed&colspec=ID+Type+Priority+Summary) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.6.0-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.6.0-beta/jdiff/changes.html) | +|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Highlights: + * Many improvements to the surface of the generated libraries. Improvements are listed [here](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=Milestone%3DCodeGenVersion1.3.0+status%3DFixed&colspec=ID+Type+Priority+Summary). + * The service-specific client now adheres to the Builder pattern to follow our thread-safety style guidelines. + * The global parameters (prettyPrint, fields, keys etc) are now generated in a service-specific class that extends [JsonHttpRequest](http://javadoc.google-http-java-client.googlecode.com/hg/1.6.0-beta/com/google/api/client/http/json/JsonHttpRequest.html) and are initialized with [JsonHttpRequestInitializer](http://javadoc.google-http-java-client.googlecode.com/hg/1.6.0-beta/com/google/api/client/http/json/JsonHttpRequestInitializer.html). + * Better exception model by introducing [GoogleJsonResponseException](http://javadoc.google-api-java-client.googlecode.com/hg/1.6.0-beta/com/google/api/client/googleapis/json/GoogleJsonResponseException.html). + * Updated to [google-http-java-client](http://code.google.com/p/google-http-java-client/wiki/ReleaseNotes#Version_1.6.0-beta) version 1.6. + * Updated to [google-oauth-java-client](http://code.google.com/p/google-oauth-java-client/wiki/ReleaseNotes#Version_1.6.0-beta) version 1.6. + * All [samples](http://code.google.com/p/google-api-java-client/source/browse/?repo=samples) have been updated. + +# Version 1.5.1-beta # + +_Oct 25, 2011_ + +| [Bugs Fixed](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone=Version1.5.1%20status=Fixed&colspec=ID%20Type%20Priority%20Summary) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.5.1-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.5.1-beta/jdiff/changes.html) | +|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +[Bugs Fixed](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone=Version1.5.1%20status=Fixed&colspec=ID%20Type%20Priority%20Summary):
+Issue [329](http://code.google.com/p/google-api-java-client/issues/detail?id=329): Update pom.xml to point to google-http-java-client 1.5.3-beta and google-oauth-java-client 1.5.2-beta
+Issue [325](http://code.google.com/p/google-api-java-client/issues/detail?id=325): Add Javadoc that refreshToken can be null in GoogleAccessProtectedResource
+Please take a look at the [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.5.1-beta/index.html). + + +--- + + +# Version 1.5.0-beta # + +_Sep 19, 2011_ + +| [New Features](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone=Version1.5.0%20status=Fixed&colspec=ID%20Type%20Priority%20Summary) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.5.0-beta/index.html) | [JDiff](http://javadoc.google-api-java-client.googlecode.com/hg/1.5.0-beta/jdiff/changes.html) | +|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Announcing the release of the new [Google HTTP Client Library for Java](http://code.google.com/p/google-http-java-client) and [Google OAuth Client Library for Java](http://code.google.com/p/google-oauth-java-client) split off from the [Google API Client Library for Java](http://code.google.com/p/google-api-java-client)! These are the core package that work with any HTTP REST, OAuth 1.0a or OAuth 2.0 (draft 10) service on the web. + +For more details, please take a look at our blog post on the Google Code Blog ["Google APIs Client Library for Java: now with OAuth 2.0"](http://googlecode.blogspot.com/2011/09/google-apis-client-library-for-java-now.html). + + +--- + + +# Version 1.4.1-beta # + +_May 7, 2011_ + +| [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.4.1-beta/index.html) | [JDiff relative to 1.3.2-alpha](http://javadoc.google-api-java-client.googlecode.com/hg/1.4.1-beta/jdiff/changes.html) | [New Features](http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone%3DVersion1.4.0+status%3DFixed&colspec=ID+Type+Priority+Summary&x=component&y=milestone&cells=tiles) | [Compatibility notes with 1.3](http://google-api-java-client.googlecode.com/hg/google-api-client-assembly/readme.html) | +|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + +Highlights: + * [Generated libraries for Google APIs](http://code.google.com/p/google-api-java-client/wiki/Setup#Generated_libraries_for_Google_APIs) based on the new Google API infrastructure, like Google Buzz. + * Better OAuth 2.0 support, including ability to [refresh expired tokens](http://javadoc.google-api-java-client.googlecode.com/hg/1.4.1-beta/com/google/api/client/googleapis/auth/oauth2/draft10/GoogleAccessProtectedResource.html), and [servlet-based 3-legged flows](http://javadoc.google-api-java-client.googlecode.com/hg/1.4.1-beta/com/google/api/client/googleapis/extensions/auth/helpers/oauth2/draft10/GoogleOAuth2ThreeLeggedFlow.html) that persist credentials + * Smarter data model that supports Java features like enums, generic types, and primitive arrays, as well as support for JSON nulls + * [Android JSON Factory](http://javadoc.google-api-java-client.googlecode.com/hg/1.4.1-beta/com/google/api/client/extensions/android3/json/AndroidJsonFactory.html) implementation that works with the built-in streaming JSON library on Honeycomb (SDK 3.0) or higher. \ No newline at end of file diff --git a/Samples.md b/Samples.md new file mode 100644 index 00000000..7ff7fdab --- /dev/null +++ b/Samples.md @@ -0,0 +1,53 @@ +# Available Samples # + +To view all the samples that are available for the Google APIs Client Library for Java, browse through the [samples in the project site](http://code.google.com/p/google-api-java-client/source/browse?repo=samples). Each sample has an instructions.html file that explains how to set up and use the sample. (To more easily view the instructions in a browser, visit http://samples.google-api-java-client.googlecode.com/hg/.) + +We welcome contributions for samples for other APIs, as described in our guide to [becoming a contributor](BecomingAContributor.md). + +If you would like to request a sample for other APIs that are not listed here, please post your requests on the API specific sites such as developers.google.com or [StackOverflow](http://stackoverflow.com/) + + +# Google+ Sample # + +A complete Google+ example is given in the [plus-cmdline-sample](http://samples.google-api-java-client.googlecode.com/hg/plus-cmdline-sample/instructions.html) sample. + +The following code snippet shows a short example of how to use the client library with the [Google+ API](https://developers.google.com/+/api/). + +``` +... + +String APPLICATION_NAME = "PlusSample"; +java.io.File DATA_STORE_DIR = + new java.io.File(System.getProperty("user.home"), ".store/plus_sample"); +FileDataStoreFactory dataStoreFactory; + +// Set up the HTTP transport and JSON factory +HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); +JsonFactory jsonFactory = JacksonFactory.getDefaultInstance(); + +// Load client secrets +GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(jsonFactory, + new InputStreamReader(PlusSample.class.getResourceAsStream("/client_secrets.json"))); + +// Set up authorization code flow +GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder( + httpTransport, jsonFactory, clientSecrets, + Collections.singleton(PlusScopes.PLUS_ME)).setDataStoreFactory(dataStoreFactory) + .build(); + +// Authorize +Credential credential = + new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user"); + +// Set up the main Google+ class +Plus plus = new Plus.Builder(httpTransport, jsonFactory, credential) + .setApplicationName(APPLICATION_NAME) + .build(); + +// Make a request to access your profile and display it to console +Person profile = plus.people().get("me").execute(); +System.out.println("ID: " + profile.getId()); +System.out.println("Name: " + profile.getDisplayName()); +System.out.println("Image URL: " + profile.getImage().getUrl()); +System.out.println("Profile URL: " + profile.getUrl()); +``` \ No newline at end of file diff --git a/Setup.md b/Setup.md new file mode 100644 index 00000000..cd41604a --- /dev/null +++ b/Setup.md @@ -0,0 +1,264 @@ +You can download the Google APIs Client Library for Java and its dependencies in a zip file, or you can use Maven. + + +Also see the [ProGuard setup instructions](http://code.google.com/p/google-http-java-client/wiki/Setup#ProGuard) that are part of the Google HTTP Client Library for Java documentation. + +# Download the Library with Dependencies # + +Download the latest zip file, which you can find on the [Downloads page](Downloads.md), and extract it on your computer. This zip file contains the client library class .jar files and the associated source .jar files for each artifact and their dependencies. You can find dependency graphs and licenses for the different libraries in the dependencies folder. For more details about the contents of the download, see the readme.html file. + +## Eclipse ## + +If you use [Eclipse](http://www.eclipse.org), set the "Source attachment" for each class .jar file to its corresponding "-sources" .jar file. + +## Android ## + +If you are developing for Android and the Google API you want to use is included in the [Google Play Services library](https://developer.android.com/google/play-services/index.html), use that library for the best performance and experience. + +If you are using the Google APIs Client Library for Java with Android, it is important to know which dependencies are compatible with Android, specifically which Android SDK level. Android applications require the following .jar files, or newer compatible versions, from the libs folder: + * google-api-client-1.18.0-rc.jar + * google-api-client-android-1.18.0-rc.jar + * google-oauth-client-1.18.0-rc.jar + * google-http-client-1.18.0-rc.jar + * google-http-client-android-1.18.0-rc.jar + * gson-2.1.jar + * jackson-core-asl-1.9.11.jar + * jackson-core-2.1.3.jar + * jsr305-1.3.9.jar + * protobuf-java-2.4.1.jar + +**WARNING:** For Android, you MUST place the .jar files in a directory named "libs" so that the APK packager can find them. Otherwise, you will get a `NoClassDefFoundError` error at runtime. + +## Google App Engine ## + +Google App Engine applications require the following .jar files, or newer compatible versions, from the libs folder: + * google-api-client-1.18.0-rc.jar + * google-api-client-appengine-1.18.0-rc.jar + * google-api-client-servlet-1.18.0-rc.jar + * google-oauth-client-1.18.0-rc.jar + * google-oauth-client-appengine-1.18.0-rc.jar + * google-oauth-client-servlet-1.18.0-rc.jar + * google-http-client-1.18.0-rc.jar + * google-http-client-appengine-1.18.0-rc.jar + * gson-2.1.jar + * jackson-core-asl-1.9.11.jar + * jackson-core-2.1.3.jar + * jdo2-api-2.3-eb.jar + * jsr305-1.3.9.jar + * protobuf-java-2.4.1.jar + * transaction-api-1.1.jar + * xpp3-1.1.4c.jar + +## Servlet ## + +Servlet applications require the following .jar files, or newer compatible versions, from the libs folder: + * google-api-client-1.18.0-rc.jar + * google-api-client-servlet-1.18.0-rc.jar + * google-oauth-client-1.18.0-rc.jar + * google-oauth-client-servlet-1.18.0-rc.jar + * google-http-client-1.18.0-rc.jar + * commons-logging-1.1.1.jar + * gson-2.1.jar + * httpclient-4.0.1.jar + * httpcore-4.0.1.jar + * jackson-core-asl-1.9.11.jar + * jackson-core-2.1.3.jar + * jdo2-api-2.3-eb.jar + * jsr305-1.3.9.jar + * protobuf-java-2.4.1.jar + * transaction-api-1.1.jar + * xpp3-1.1.4c.jar + +## Generic Java ## + +General purpose Java 5 applications require the following .jar files, or newer compatible versions, from the libs folder: + * google-api-client-1.18.0-rc.jar + * google-oauth-client-1.18.0-rc.jar + * google-http-client-1.18.0-rc.jar + * google-http-client-jackson2-1.18.0-rc.jar + * commons-logging-1.1.1.jar + * gson-2.1.jar + * httpclient-4.0.1.jar + * httpcore-4.0.1.jar + * jackson-core-asl-1.9.11.jar + * jackson-core-2.1.3.jar + * jsr305-1.3.9.jar + * protobuf-java-2.4.1.jar + * xpp3-1.1.4c.jar + +# Generated Libraries for Google APIs # + +Take a look at the [setup instructions for the generated libraries for Google APIs](https://developers.google.com/api-client-library/java/apis/). + +# Maven # + +The Google APIs Client Library for Java is in the central [Maven](http://maven.apache.org) repository. The Maven `groupId` for all artifacts for this library is `com.google.api-client`. Specific Maven instructions are given for each module (below). + +If you use [Eclipse](http://www.eclipse.org), install the [Maven plugin](http://www.eclipse.org/m2e/). Also make sure to set your Eclipse preferences as follows: + 1. Within Eclipse, select **Window > Preferences** (or on Mac, **Eclipse > Preferences**). + 1. Select **Maven** and select the following options: + * "Download Artifact Sources" + * "Download Artifact JavaDoc" + +# Google Plugin for Eclipse # + +With Google Plugin for Eclipse 2.6, you can [add Google APIs to your App Engine or Android project](https://developers.google.com/eclipse/docs/googleapis). To do this: + 1. Within Eclipse, right-click on a project and select **Google > Add Google APIs**. + 1. Select the Google API you need from the list of available Google APIs. + 1. Click Finish. +Eclipse will automatically download the API client library (along with its dependencies and source) onto your project's classpath and into the war/WEB-INF/lib directory. It will provide you with update notifications when the Google API or the client library has been updated. + +**WARNING:** Eclipse will show "Update available" when a newer version of the library is available. To update, use the same **Google > Add Google APIs** utility. Make sure to update all the Google API libraries on your project. Also, you must remove any old versions of the .jar files that this tool updates in your war/WEB-INF/lib directory. + +# Modules # + +This library is composed of nine modules: [google-api-client](#google-api-client.md), [google-api-client-android](#google-api-client-android.md), [google-api-client-appengine](#google-api-client-appengine.md), [google-api-client-servlet](#google-api-client-servlet.md), [google-api-client-gson](#google-api-client-gson.md), [google-api-client-jackson2](#google-api-client-jackson2.md), [google-api-client-java6](#google-api-client-java6.md), [google-api-client-protobuf](#google-api-client-protobuf.md), and [google-api-client-xml](#google-api-client-xml.md). + +## google-api-client ## + +The Google HTTP Client Library for Java (google-api-client) is designed to be compatible with all supported Java platforms, including Android. + +Maven usage: + +``` + + com.google.api-client + google-api-client + 1.18.0-rc + +``` + +On Android, you will need to explicitly exclude unused dependencies: + +``` + + com.google.api-client + google-api-client + 1.18.0-rc + + + xpp3 + xpp3 + + + httpclient + org.apache.httpcomponents + + + junit + junit + + + android + com.google.android + + + +``` + +## google-api-client-android ## + +Extensions to the Google API Client Library for Java (google-api-client-android) support Java Google Android (only for SDK >= 2.1) applications. This module depends on google-api-client and google-http-client-android. + +Maven usage: + +``` + + com.google.api-client + google-api-client-android + 1.18.0-rc + +``` + +## google-api-client-servlet ## + +Servlet and JDO extensions to the Google API Client Library for Java (google-api-client-servlet) support Java servlet web applications. This module depends on google-api-client and google-oauth-client-servlet. + +Maven usage: + +``` + + com.google.api-client + google-api-client-servlet + 1.18.0-rc + +``` + +## google-api-client-appengine ## + +Google App Engine extensions to the Google HTTP Client Library for Java (google-api-client-appengine) support Java Google App Engine applications. This module depends on google-api-client, google-api-client-servlet, google-oauth-client-appengine and google-http-client-appengine. + +Maven usage: + +``` + + com.google.api-client + google-api-client-appengine + 1.18.0-rc + +``` + +## google-api-client-gson ## +GSON extensions to the Google HTTP Client Library for Java (google-api-client-gson). This module depends on google-api-client and google-http-client-gson. + +Maven usage: + +``` + + com.google.api-client + google-api-client-gson + 1.18.0-rc + +``` + +## google-api-client-jackson2 ## +Jackson2 extensions to the Google HTTP Client Library for Java (google-api-client-jackson2). This module depends on google-api-client and google-http-client-jackson2. + +Maven usage: + +``` + + com.google.api-client + google-api-client-jackson2 + 1.18.0-rc + +``` + +## google-api-client-java6 ## +Java 6 (and higher) extensions to the Google HTTP Client Library for Java (google-api-client-java6). This module depends on google-api-client and google-oauth-client-java6. + +Maven usage: + +``` + + com.google.api-client + google-api-client-java6 + 1.18.0-rc + +``` + +## google-api-client-protobuf ## +[Protocol buffer](https://developers.google.com/protocol-buffers/docs/overview) extensions to the Google HTTP Client Library for Java (google-api-client-protobuf). This module depends on google-http-client-protobuf and google-api-client. + +Maven usage: + +``` + + com.google.api-client + google-api-client-protobuf + 1.18.0-rc + +``` + +## google-api-client-xml ## +XML extensions to the Google HTTP Client Library for Java (google-api-client-xml). This module depends on google-api-client and google-http-client-xml. + +Maven usage: + +``` + + com.google.api-client + google-api-client-xml + 1.18.0-rc + +``` \ No newline at end of file diff --git a/Support.md b/Support.md new file mode 100644 index 00000000..dde6a0ea --- /dev/null +++ b/Support.md @@ -0,0 +1,48 @@ +# The Google APIs Client Library for Java Community # + +## Ask Development Questions ## + +Ask questions on StackOverflow: + * When you ask questions about the Google APIs Client Library for Java, use the [google-api-java-client](http://stackoverflow.com/questions/tagged/google-api-java-client) tag. Before you post a new question, review the [most asked questions](http://stackoverflow.com/questions/tagged/google-api-java-client?sort=faq&pagesize=50). + * For questions about Google APIs, use the [google-api](http://stackoverflow.com/questions/tagged/google-api) tag. + * Optionally include a tag to specify the language or platform, for example [java](http://stackoverflow.com/questions/tagged/google-api-java-client+java), [android](http://stackoverflow.com/questions/tagged/google-api-java-client+android), or [google-app-engine](http://stackoverflow.com/questions/tagged/google-api-java-client+google-app-engine). + * For tips on asking StackOverflow questions, see [How to Ask](http://stackoverflow.com/questions/ask). +| **Note:** Please do not email the project contributors directly. | +|:-----------------------------------------------------------------| + +## File Feature Requests and Defects ## + +You can suggest features and report issues on our public [Issue Tracker](https://code.google.com/p/google-api-java-client/issues/list). This is a great place for the community to discuss and track implementations of features or resolution of bug fixes, as well as share workarounds and patches. + +If you find a bug: + * View [known bugs](http://code.google.com/p/google-api-java-client/issues/list?can=2&q=Type%3DDefect&sort=priority&colspec=ID+Milestone+Summary), and if a known bug corresponds to the issue you are seeing, "star" it or comment on it. + * If the issue you are seeing has not yet been reported, [file a bug report](http://code.google.com/p/google-api-java-client/issues/entry). + +If you have a feature request: + * View [existing feature requests](http://code.google.com/p/google-api-java-client/issues/list?can=2&q=type%3DEnhancement&sort=milestone+priority&colspec=ID+Milestone+Summary), and if a requested feature corresponds to a feature you would like, "star" it or comment on it . + * If the feature has not yet been requested, [file a feature request](http://code.google.com/p/google-api-java-client/issues/entry?template=Request%20a%20Feature). + +If you have a sample request: + * View existing [samples for Google APIs](Samples.md). View existing [sample requests](http://code.google.com/p/google-api-java-client/issues/list?can=2&q=type%3DSample&sort=priority&colspec=ID+Priority+Summary), and if a requested sample corresponds to a sample you would like, "star" it or comment on it. + * If the sample has not been requested, [file a sample request](http://code.google.com/p/google-api-java-client/issues/entry?template=Request%20a%20Sample). + +## Discuss ## + +We've established a [discussion group](http://groups.google.com/group/google-api-java-client) for both users and contributors to discuss the Google APIs Client Library for Java. + +## Contribute ## + +This is an [open-source](http://code.google.com/p/google-api-java-client/source/browse/) library, and [contributions](BecomingAContributor.md) are welcome. + +## Keep Up with the Library ## + +For the latest news about the Google APIs Client Library for Java, read the [announcements blog](http://google-api-java-client.blogspot.com/), or [subscribe to its feed](http://google-api-java-client.blogspot.com/feeds/posts/default). + +You can also take a look at the [release notes](ReleaseNotes.md). + + +<hr/> + + +# Migrating from GData Java Client # +For information about migrating from the [GData Java Client Library](http://code.google.com/p/gdata-java-client/) to the Google APIs Client Library for Java, see the [migration guide](http://code.google.com/p/gdata-java-client/wiki/MigratingToGoogleApiJavaClient). \ No newline at end of file diff --git a/TableOfContents.md b/TableOfContents.md new file mode 100644 index 00000000..67b44fcb --- /dev/null +++ b/TableOfContents.md @@ -0,0 +1,17 @@ +## [Developer's Guide](DeveloperGuide.md) ## + * [Download and Setup](Setup.md) + * [Samples](Samples.md) + * [Support](Support.md) + * [Android](Android.md) + * [OAuth 2.0](OAuth2.md) + * [ClientLogin (Deprecated)](ClientLogin.md) + * [Batch](Batch.md) + * [Media Upload](MediaUpload.md) + * [Media Download](MediaDownload.md) + * [Google App Engine](GoogleAppEngine.md) + * [Timeouts and Errors](HandlingTimeoutsAndErrors.md) + * [Release Notes](ReleaseNotes.md) + * [Becoming a Contributor](BecomingAContributor.md) + +| [Discussion](http://groups.google.com/group/google-http-java-client) | [JavaDoc](http://javadoc.google-api-java-client.googlecode.com/hg/1.18.0-rc/index.html) | +|:---------------------------------------------------------------------------------------------------------------------------------------------------------------| \ No newline at end of file diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml deleted file mode 100644 index 350c453f..00000000 --- a/checkstyle-suppressions.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/checkstyle.xml b/checkstyle.xml deleted file mode 100644 index c2e2a4c8..00000000 --- a/checkstyle.xml +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/clirr-ignored-differences.xml b/clirr-ignored-differences.xml deleted file mode 100644 index 11400842..00000000 --- a/clirr-ignored-differences.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/findbugs-exclude.xml b/findbugs-exclude.xml deleted file mode 100644 index 779eef93..00000000 --- a/findbugs-exclude.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/google-api-client-android/.classpath b/google-api-client-android/.classpath deleted file mode 100644 index 68a2c33f..00000000 --- a/google-api-client-android/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/google-api-client-android/.project b/google-api-client-android/.project deleted file mode 100644 index 8c99250a..00000000 --- a/google-api-client-android/.project +++ /dev/null @@ -1,24 +0,0 @@ - - - google-api-client-android - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/google-api-client-android/.settings/org.eclipse.jdt.core.prefs b/google-api-client-android/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 511d2482..00000000 --- a/google-api-client-android/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,380 +0,0 @@ -#Thu Nov 17 08:38:45 EST 2011 -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_member=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=24 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16|4|80 -org.eclipse.jdt.core.formatter.alignment_for_assignment=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16|5|48 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_field_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_for_statement=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class=0 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16|4|49 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16|4|48 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=0 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=true -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=false -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=100 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph=true -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.force_if_else_statement_brace=true -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=100 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=3 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false -org.eclipse.jdt.core.formatter.sort_local_variable_annotations=false -org.eclipse.jdt.core.formatter.sort_member_annotations=false -org.eclipse.jdt.core.formatter.sort_package_annotations=false -org.eclipse.jdt.core.formatter.sort_parameter_annotations=false -org.eclipse.jdt.core.formatter.sort_type_annotations=false -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_comment_inline_tags=false -org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation=false -org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments=false diff --git a/google-api-client-android/.settings/org.eclipse.jdt.ui.prefs b/google-api-client-android/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 08ebc976..00000000 --- a/google-api-client-android/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,119 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=false -cleanup.add_serial_version_id=true -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_parentheses_in_expressions=true -cleanup.use_this_for_non_static_field_access=true -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=true -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup_profile=_google-api-java-client -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_google-api-java-client 100 -formatter_settings_version=12 -org.eclipse.jdt.ui.exception.name=exception -org.eclipse.jdt.ui.gettersetter.use.is=false -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=com.google;;java;javax; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=999 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=999 -org.eclipse.jdt.ui.text.custom_code_templates= -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=false -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=false -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/google-api-client-android/AndroidManifest.xml b/google-api-client-android/AndroidManifest.xml deleted file mode 100644 index 02259485..00000000 --- a/google-api-client-android/AndroidManifest.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/google-api-client-android/pom.xml b/google-api-client-android/pom.xml deleted file mode 100644 index 63bd01aa..00000000 --- a/google-api-client-android/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - 4.0.0 - - com.google.api-client - google-api-client-parent - 1.20.0-SNAPSHOT - ../pom.xml - - google-api-client-android - Android Platform Extensions to the Google APIs Client Library for Java. - - - - - maven-javadoc-plugin - - - http://download.oracle.com/javase/1.5.0/docs/api/ - - ${project.name} ${project.version} - ${project.artifactId} ${project.version} - - - - maven-source-plugin - - - source-jar - compile - - jar - - - - - - - - - com.google.android - android - 4.1.1.4 - provided - - - com.google.api-client - google-api-client - - - com.google.http-client - google-http-client-android - - - com.google.android.google-play-services - google-play-services - provided - - - diff --git a/google-api-client-android/project.properties b/google-api-client-android/project.properties deleted file mode 100644 index c0442c37..00000000 --- a/google-api-client-android/project.properties +++ /dev/null @@ -1 +0,0 @@ -target=android-18 diff --git a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/accounts/GoogleAccountManager.java b/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/accounts/GoogleAccountManager.java deleted file mode 100644 index fde0d093..00000000 --- a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/accounts/GoogleAccountManager.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.android.accounts; - -import com.google.api.client.util.Beta; -import com.google.api.client.util.Preconditions; - -import android.accounts.Account; -import android.accounts.AccountManager; -import android.content.Context; - -/** - * {@link Beta}
- * Account manager wrapper for Google accounts. - * - * @since 1.11 - * @author Yaniv Inbar - */ -@Beta -public final class GoogleAccountManager { - - /** Google account type. */ - public static final String ACCOUNT_TYPE = "com.google"; - - /** Account manager. */ - private final AccountManager manager; - - /** - * @param accountManager account manager - */ - public GoogleAccountManager(AccountManager accountManager) { - this.manager = Preconditions.checkNotNull(accountManager); - } - - /** - * @param context context from which to retrieve the account manager - */ - public GoogleAccountManager(Context context) { - this(AccountManager.get(context)); - } - - /** - * Returns the account manager. - * - * @since 1.8 - */ - public AccountManager getAccountManager() { - return manager; - } - - /** - * Returns all Google accounts. - * - * @return array of Google accounts - */ - public Account[] getAccounts() { - return manager.getAccountsByType("com.google"); - } - - /** - * Returns the Google account of the given {@link Account#name}. - * - * @param accountName Google account name or {@code null} for {@code null} result - * @return Google account or {@code null} for none found or for {@code null} input - */ - public Account getAccountByName(String accountName) { - if (accountName != null) { - for (Account account : getAccounts()) { - if (accountName.equals(account.name)) { - return account; - } - } - } - return null; - } - - /** - * Invalidates the given Google auth token by removing it from the account manager's cache (if - * necessary) for example if the auth token has expired or otherwise become invalid. - * - * @param authToken auth token - */ - public void invalidateAuthToken(String authToken) { - manager.invalidateAuthToken(ACCOUNT_TYPE, authToken); - } -} diff --git a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/accounts/package-info.java b/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/accounts/package-info.java deleted file mode 100644 index 71655b40..00000000 --- a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/accounts/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Utilities for Account Manager for Google accounts on Android Eclair (SDK 2.1) and later. - * - * @since 1.11 - * @author Yaniv Inbar - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.extensions.android.accounts; - diff --git a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAccountCredential.java b/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAccountCredential.java deleted file mode 100644 index 5e911ce3..00000000 --- a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAccountCredential.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.android.gms.auth; - -import com.google.android.gms.auth.GoogleAuthException; -import com.google.android.gms.auth.GoogleAuthUtil; -import com.google.android.gms.auth.GooglePlayServicesAvailabilityException; -import com.google.android.gms.auth.UserRecoverableAuthException; -import com.google.android.gms.common.AccountPicker; -import com.google.api.client.googleapis.extensions.android.accounts.GoogleAccountManager; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpUnsuccessfulResponseHandler; -import com.google.api.client.util.BackOff; -import com.google.api.client.util.BackOffUtils; -import com.google.api.client.util.Beta; -import com.google.api.client.util.ExponentialBackOff; -import com.google.api.client.util.Joiner; -import com.google.api.client.util.Preconditions; -import com.google.api.client.util.Sleeper; - -import android.accounts.Account; -import android.content.Context; -import android.content.Intent; - -import java.io.IOException; -import java.util.Collection; - -/** - * {@link Beta}
- * Manages authorization and account selection for Google accounts. - * - *

- * When fetching a token, any thrown {@link GoogleAuthException} would be wrapped: - *

    - *
  • {@link GooglePlayServicesAvailabilityException} would be wrapped inside of - * {@link GooglePlayServicesAvailabilityIOException}
  • - *
  • {@link UserRecoverableAuthException} would be wrapped inside of - * {@link UserRecoverableAuthIOException}
  • - *
  • {@link GoogleAuthException} when be wrapped inside of {@link GoogleAuthIOException}
  • - *
- *

- * - *

- * Upgrade warning: in prior version 1.14 exponential back-off was enabled by default when I/O - * exception was thrown inside {@link #getToken}, but starting with version 1.15 you need to call - * {@link #setBackOff} with {@link ExponentialBackOff} to enable it. - *

- * - * @since 1.12 - * @author Yaniv Inbar - */ -@Beta -public class GoogleAccountCredential implements HttpRequestInitializer { - - /** Context. */ - final Context context; - - /** Scope to use on {@link GoogleAuthUtil#getToken}. */ - final String scope; - - /** Google account manager. */ - private final GoogleAccountManager accountManager; - - /** - * Selected Google account name (e-mail address), for example {@code "johndoe@gmail.com"}, or - * {@code null} for none. - */ - private String accountName; - - /** Selected Google account or {@code null} for none. */ - private Account selectedAccount; - - /** Sleeper. */ - private Sleeper sleeper = Sleeper.DEFAULT; - - /** - * Back-off policy which is used when an I/O exception is thrown inside {@link #getToken} or - * {@code null} for none. - */ - private BackOff backOff; - - /** - * @param context context - * @param scope scope to use on {@link GoogleAuthUtil#getToken} - */ - public GoogleAccountCredential(Context context, String scope) { - accountManager = new GoogleAccountManager(context); - this.context = context; - this.scope = scope; - } - - /** - * Constructs a new instance using OAuth 2.0 scopes. - * - * @param context context - * @param scopes non empty OAuth 2.0 scope list - * @return new instance - * - * @since 1.15 - */ - public static GoogleAccountCredential usingOAuth2(Context context, Collection scopes) { - Preconditions.checkArgument(scopes != null && scopes.iterator().hasNext()); - String scopesStr = "oauth2: " + Joiner.on(' ').join(scopes); - return new GoogleAccountCredential(context, scopesStr); - } - - /** - * Sets the audience scope to use with Google Cloud Endpoints. - * - * @param context context - * @param audience audience - * @return new instance - */ - public static GoogleAccountCredential usingAudience(Context context, String audience) { - Preconditions.checkArgument(audience.length() != 0); - return new GoogleAccountCredential(context, "audience:" + audience); - } - - /** - * Sets the selected Google account name (e-mail address) -- for example - * {@code "johndoe@gmail.com"} -- or {@code null} for none. - */ - public final GoogleAccountCredential setSelectedAccountName(String accountName) { - selectedAccount = accountManager.getAccountByName(accountName); - // check if account has been deleted - this.accountName = selectedAccount == null ? null : accountName; - return this; - } - - public void initialize(HttpRequest request) { - RequestHandler handler = new RequestHandler(); - request.setInterceptor(handler); - request.setUnsuccessfulResponseHandler(handler); - } - - /** Returns the context. */ - public final Context getContext() { - return context; - } - - /** Returns the scope to use on {@link GoogleAuthUtil#getToken}. */ - public final String getScope() { - return scope; - } - - /** Returns the Google account manager. */ - public final GoogleAccountManager getGoogleAccountManager() { - return accountManager; - } - - /** Returns all Google accounts or {@code null} for none. */ - public final Account[] getAllAccounts() { - return accountManager.getAccounts(); - } - - /** Returns the selected Google account or {@code null} for none. */ - public final Account getSelectedAccount() { - return selectedAccount; - } - - /** - * Returns the back-off policy which is used when an I/O exception is thrown inside - * {@link #getToken} or {@code null} for none. - * - * @since 1.15 - */ - public BackOff getBackOff() { - return backOff; - } - - /** - * Sets the back-off policy which is used when an I/O exception is thrown inside {@link #getToken} - * or {@code null} for none. - * - * @since 1.15 - */ - public GoogleAccountCredential setBackOff(BackOff backOff) { - this.backOff = backOff; - return this; - } - - /** - * Returns the sleeper. - * - * @since 1.15 - */ - public final Sleeper getSleeper() { - return sleeper; - } - - /** - * Sets the sleeper. The default value is {@link Sleeper#DEFAULT}. - * - * @since 1.15 - */ - public final GoogleAccountCredential setSleeper(Sleeper sleeper) { - this.sleeper = Preconditions.checkNotNull(sleeper); - return this; - } - - /** - * Returns the selected Google account name (e-mail address), for example - * {@code "johndoe@gmail.com"}, or {@code null} for none. - */ - public final String getSelectedAccountName() { - return accountName; - } - - /** - * Returns an intent to show the user to select a Google account, or create a new one if there are - * none on the device yet. - * - *

- * Must be run from the main UI thread. - *

- */ - public final Intent newChooseAccountIntent() { - return AccountPicker.newChooseAccountIntent(selectedAccount, - null, - new String[] {GoogleAccountManager.ACCOUNT_TYPE}, - true, - null, - null, - null, - null); - } - - /** - * Returns an OAuth 2.0 access token. - * - *

- * Must be run from a background thread, not the main UI thread. - *

- */ - public String getToken() throws IOException, GoogleAuthException { - if (backOff != null) { - backOff.reset(); - } - - while (true) { - try { - return GoogleAuthUtil.getToken(context, accountName, scope); - } catch (IOException e) { - // network or server error, so retry using back-off policy - try { - if (backOff == null || !BackOffUtils.next(sleeper, backOff)) { - throw e; - } - } catch (InterruptedException e2) { - // ignore - } - } - } - } - - - @Beta - class RequestHandler implements HttpExecuteInterceptor, HttpUnsuccessfulResponseHandler { - - /** Whether we've received a 401 error code indicating the token is invalid. */ - boolean received401; - String token; - - public void intercept(HttpRequest request) throws IOException { - try { - token = getToken(); - request.getHeaders().setAuthorization("Bearer " + token); - } catch (GooglePlayServicesAvailabilityException e) { - throw new GooglePlayServicesAvailabilityIOException(e); - } catch (UserRecoverableAuthException e) { - throw new UserRecoverableAuthIOException(e); - } catch (GoogleAuthException e) { - throw new GoogleAuthIOException(e); - } - } - - public boolean handleResponse( - HttpRequest request, HttpResponse response, boolean supportsRetry) { - if (response.getStatusCode() == 401 && !received401) { - received401 = true; - GoogleAuthUtil.invalidateToken(context, token); - return true; - } - return false; - } - } -} diff --git a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAuthIOException.java b/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAuthIOException.java deleted file mode 100644 index b51cabbe..00000000 --- a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAuthIOException.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.android.gms.auth; - -import com.google.android.gms.auth.GoogleAuthException; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Preconditions; - -import java.io.IOException; - -/** - * {@link Beta}
- * Wraps a {@link GoogleAuthException} into an {@link IOException} so it can be caught directly. - * - *

- * Use {@link #getCause()} to get the wrapped {@link GoogleAuthException}. - *

- * - * @since 1.12 - * @author Yaniv Inbar - */ -@Beta -public class GoogleAuthIOException extends IOException { - - private static final long serialVersionUID = 1L; - - /** - * @param wrapped wrapped {@link GoogleAuthException} - */ - GoogleAuthIOException(GoogleAuthException wrapped) { - initCause(Preconditions.checkNotNull(wrapped)); - } - - @Override - public GoogleAuthException getCause() { - return (GoogleAuthException) super.getCause(); - } -} diff --git a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GooglePlayServicesAvailabilityIOException.java b/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GooglePlayServicesAvailabilityIOException.java deleted file mode 100644 index 7d35b661..00000000 --- a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GooglePlayServicesAvailabilityIOException.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.android.gms.auth; - -import com.google.android.gms.auth.GooglePlayServicesAvailabilityException; -import com.google.android.gms.common.GooglePlayServicesUtil; -import com.google.api.client.util.Beta; - -import android.app.Activity; - -import java.io.IOException; - -/** - * {@link Beta}
- * Wraps a {@link GooglePlayServicesAvailabilityException} into an {@link IOException} so it can be - * caught directly. - * - *

- * Use {@link #getConnectionStatusCode()} to display the error dialog. Alternatively, use - * {@link #getCause()} to get the wrapped {@link GooglePlayServicesAvailabilityException}. Example - * usage: - *

- * - *
-    } 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();
-        }
-      });
- * 
- * - * @since 1.12 - * @author Yaniv Inbar - */ -@Beta -public class GooglePlayServicesAvailabilityIOException extends UserRecoverableAuthIOException { - - private static final long serialVersionUID = 1L; - - GooglePlayServicesAvailabilityIOException(GooglePlayServicesAvailabilityException wrapped) { - super(wrapped); - } - - @Override - public GooglePlayServicesAvailabilityException getCause() { - return (GooglePlayServicesAvailabilityException) super.getCause(); - } - - /** - * Returns the error code to use with - * {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)}. - */ - public final int getConnectionStatusCode() { - return getCause().getConnectionStatusCode(); - } -} 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 deleted file mode 100644 index c047d3ea..00000000 --- a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/UserRecoverableAuthIOException.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.android.gms.auth; - -import com.google.android.gms.auth.UserRecoverableAuthException; -import com.google.api.client.util.Beta; - -import android.app.Activity; -import android.content.Intent; - -import java.io.IOException; - -/** - * {@link Beta}
- * Wraps a {@link UserRecoverableAuthException} into an {@link IOException} so it can be caught - * directly. - * - *

- * Use {@link #getIntent()} to allow user interaction to recover. Alternatively, use - * {@link #getCause()} to get the wrapped {@link UserRecoverableAuthException}. Example usage: - *

- * - *
-    } catch (UserRecoverableAuthIOException userRecoverableException) {
-      myActivity.startActivityForResult(
-          userRecoverableException.getIntent(), MyActivity.REQUEST_AUTHORIZATION);
-    }
- * 
- * - * @since 1.12 - * @author Yaniv Inbar - */ -@Beta -public class UserRecoverableAuthIOException extends GoogleAuthIOException { - - private static final long serialVersionUID = 1L; - - UserRecoverableAuthIOException(UserRecoverableAuthException wrapped) { - super(wrapped); - } - - @Override - public UserRecoverableAuthException getCause() { - return (UserRecoverableAuthException) super.getCause(); - } - - /** - * Returns the {@link Intent} that when supplied to - * {@link Activity#startActivityForResult(Intent, int)} will allow user intervention. - */ - public final Intent getIntent() { - return getCause().getIntent(); - } -} diff --git a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/package-info.java b/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/package-info.java deleted file mode 100644 index 5ad2c183..00000000 --- a/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Utilities based on Google - * Play services. - * - * @since 1.12 - * @author Yaniv Inbar - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.extensions.android.gms.auth; - diff --git a/google-api-client-appengine/.classpath b/google-api-client-appengine/.classpath deleted file mode 100644 index 2c81b208..00000000 --- a/google-api-client-appengine/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/google-api-client-appengine/.project b/google-api-client-appengine/.project deleted file mode 100644 index a99e1411..00000000 --- a/google-api-client-appengine/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - google-api-client-appengine - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/google-api-client-appengine/.settings/org.eclipse.jdt.core.prefs b/google-api-client-appengine/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 1eb99c2c..00000000 --- a/google-api-client-appengine/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,379 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.7 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_member=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=24 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16|4|80 -org.eclipse.jdt.core.formatter.alignment_for_assignment=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16|5|48 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_field_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_for_statement=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class=0 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16|4|49 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16|4|48 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=0 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=true -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=false -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=100 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph=true -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.force_if_else_statement_brace=true -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=100 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=3 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false -org.eclipse.jdt.core.formatter.sort_local_variable_annotations=false -org.eclipse.jdt.core.formatter.sort_member_annotations=false -org.eclipse.jdt.core.formatter.sort_package_annotations=false -org.eclipse.jdt.core.formatter.sort_parameter_annotations=false -org.eclipse.jdt.core.formatter.sort_type_annotations=false -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_comment_inline_tags=false -org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation=false -org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments=false diff --git a/google-api-client-appengine/.settings/org.eclipse.jdt.ui.prefs b/google-api-client-appengine/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index fea3eb89..00000000 --- a/google-api-client-appengine/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,119 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=true -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_parentheses_in_expressions=true -cleanup.use_this_for_non_static_field_access=true -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=true -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup_profile=_google-api-java-client -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_google-api-java-client 100 -formatter_settings_version=12 -org.eclipse.jdt.ui.exception.name=exception -org.eclipse.jdt.ui.gettersetter.use.is=false -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=com.google;;java;javax; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=999 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=999 -org.eclipse.jdt.ui.text.custom_code_templates= -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=true -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=false -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/google-api-client-appengine/pom.xml b/google-api-client-appengine/pom.xml deleted file mode 100644 index 944dd328..00000000 --- a/google-api-client-appengine/pom.xml +++ /dev/null @@ -1,142 +0,0 @@ - - 4.0.0 - - com.google.api-client - google-api-client-parent - 1.20.0-SNAPSHOT - ../pom.xml - - google-api-client-appengine - Google App Engine extensions to the Google API Client Library for Java. - - - - maven-javadoc-plugin - - - http://download.oracle.com/javase/6/docs/api/ - http://code.google.com/appengine/docs/java/javadoc - http://javadoc.google-http-java-client.googlecode.com/hg/${project.http.version} - http://javadoc.google-oauth-java-client.googlecode.com/hg/${project.oauth.version} - - ${project.name} ${project.version} - ${project.artifactId} ${project.version} - - - - maven-jar-plugin - - - - true - - - - - - jar - compile - - jar - - - - - - maven-source-plugin - - - source-jar - compile - - jar - - - - - - org.datanucleus - maven-datanucleus-plugin - 2.2.1 - - true - - - - process-classes - - enhance - - - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - org.codehaus.mojo.signature - java16 - 1.0 - - - - - - - - com.google.appengine - appengine-api-1.0-sdk - provided - - - com.google.oauth-client - google-oauth-client-appengine - - - com.google.api-client - google-api-client - - - com.google.api-client - google-api-client-servlet - - - com.google.http-client - google-http-client-appengine - - - - junit - junit - test - - - com.google.appengine - appengine-testing - test - - - com.google.appengine - appengine-api-labs - test - - - com.google.appengine - appengine-api-stubs - test - - - com.google.http-client - google-http-client-jackson2 - test - - - com.google.guava - guava-jdk5 - test - - - diff --git a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredential.java b/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredential.java deleted file mode 100644 index d714a602..00000000 --- a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredential.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.appengine.auth.oauth2; - -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Preconditions; -import com.google.appengine.api.appidentity.AppIdentityService; -import com.google.appengine.api.appidentity.AppIdentityServiceFactory; - -import java.io.IOException; -import java.util.Collection; -import java.util.Collections; - -/** - * OAuth 2.0 credential in which a client Google App Engine application needs to access data that it - * owns, based on Asserting Identity to Google APIs - * - *

- * Intercepts the request by using the access token obtained from - * {@link AppIdentityService#getAccessToken(Iterable)}. - *

- * - *

- * Sample usage: - *

- * - *
-  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. - *

- * - * @since 1.7 - * @author Yaniv Inbar - */ -public class AppIdentityCredential implements HttpRequestInitializer, HttpExecuteInterceptor { - - /** App Identity Service that provides the access token. */ - private final AppIdentityService appIdentityService; - - /** OAuth scopes (unmodifiable). */ - private final Collection scopes; - - /** - * @param scopes OAuth scopes - * @since 1.15 - */ - public AppIdentityCredential(Collection scopes) { - this(new Builder(scopes)); - } - - /** - * @param builder builder - * - * @since 1.14 - */ - protected AppIdentityCredential(Builder builder) { - // Lazily retrieved rather than setting as the default value in order to not add runtime - // dependencies on AppIdentityServiceFactory unless it is actually being used. - appIdentityService = builder.appIdentityService == null - ? AppIdentityServiceFactory.getAppIdentityService() : builder.appIdentityService; - scopes = builder.scopes; - } - - @Override - public void initialize(HttpRequest request) throws IOException { - request.setInterceptor(this); - } - - @Override - public void intercept(HttpRequest request) throws IOException { - String accessToken = appIdentityService.getAccessToken(scopes).getAccessToken(); - BearerToken.authorizationHeaderAccessMethod().intercept(request, accessToken); - } - - /** - * Gets the App Identity Service that provides the access token. - * - * @since 1.12 - */ - public final AppIdentityService getAppIdentityService() { - return appIdentityService; - } - - /** - * Gets the OAuth scopes (unmodifiable). - * - * @since 1.12 - */ - public final Collection getScopes() { - return scopes; - } - - /** - * Builder for {@link AppIdentityCredential}. - * - *

- * Implementation is not thread-safe. - *

- * - * @since 1.12 - */ - public static class Builder { - - /** - * App Identity Service that provides the access token or {@code null} to use - * {@link AppIdentityServiceFactory#getAppIdentityService()}. - */ - AppIdentityService appIdentityService; - - /** OAuth scopes (unmodifiable). */ - final Collection scopes; - - /** - * Returns an instance of a new builder. - * - * @param scopes OAuth scopes - * @since 1.15 - */ - public Builder(Collection scopes) { - this.scopes = Collections.unmodifiableCollection(scopes); - } - - /** - * Returns the App Identity Service that provides the access token or {@code null} to use - * {@link AppIdentityServiceFactory#getAppIdentityService()}. - * - * @since 1.14 - */ - public final AppIdentityService getAppIdentityService() { - return appIdentityService; - } - - /** - * Sets the App Identity Service that provides the access token or {@code null} to use - * {@link AppIdentityServiceFactory#getAppIdentityService()}. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setAppIdentityService(AppIdentityService appIdentityService) { - this.appIdentityService = appIdentityService; - return this; - } - - /** - * Returns a new {@link AppIdentityCredential}. - */ - public AppIdentityCredential build() { - return new AppIdentityCredential(this); - } - - /** - * Returns the OAuth scopes (unmodifiable). - * - * @since 1.14 - */ - public final Collection getScopes() { - return scopes; - } - } - - /** - * {@link Beta}
- * Credential wrapper for application identity that inherits from GoogleCredential. - */ - @Beta - public static class AppEngineCredentialWrapper extends GoogleCredential { - - private final AppIdentityCredential appIdentity; - private final boolean scopesRequired; - - /** - * Constructs the wrapper using the default AppIdentityService. - * - * @param transport the transport for Http calls. - * @param jsonFactory the factory for Json parsing and formatting. - * @throws IOException if the credential cannot be created for the current environment, - * such as when the AppIndentityService is not available. - */ - public AppEngineCredentialWrapper(HttpTransport transport, JsonFactory jsonFactory) - throws IOException { - // May be called via reflection to test whether running on App Engine, so fail even if - // the type can be loaded but the service is not available. - this(getCheckedAppIdentityCredential(), Preconditions.checkNotNull(transport), - Preconditions.checkNotNull(jsonFactory)); - } - - AppEngineCredentialWrapper( - AppIdentityCredential appIdentity, - HttpTransport transport, - JsonFactory jsonFactory) { - super(new GoogleCredential.Builder() - .setRequestInitializer(appIdentity) - .setTransport(transport) - .setJsonFactory(jsonFactory)); - this.appIdentity = appIdentity; - Collection scopes = appIdentity.getScopes(); - scopesRequired = (scopes == null || scopes.isEmpty()); - } - - private static AppIdentityCredential getCheckedAppIdentityCredential() throws IOException { - Collection emptyScopes = Collections.emptyList(); - AppIdentityCredential appIdentity = new AppIdentityCredential(emptyScopes); - // May be called via reflection to test whether running on App Engine, so fail even if - // the type can be loaded but the service is not available. - if (appIdentity.getAppIdentityService() == null) { - throw new IOException("AppIdentityService not available."); - } - return appIdentity; - } - - @Override - public void intercept(HttpRequest request) throws IOException { - appIdentity.intercept(request); - } - - public boolean createScopedRequired() { - return scopesRequired; - } - - public GoogleCredential createScoped(Collection scopes) { - return new AppEngineCredentialWrapper( - new AppIdentityCredential.Builder(scopes) - .setAppIdentityService(appIdentity.getAppIdentityService()) - .build(), - getTransport(), - getJsonFactory()); - } - } -} diff --git a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/package-info.java b/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/package-info.java deleted file mode 100644 index d63ca8d2..00000000 --- a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Google App Engine utilities for OAuth 2.0 for Google APIs. - * - * @since 1.7 - * @author Yaniv Inbar - */ - -package com.google.api.client.googleapis.extensions.appengine.auth.oauth2; - 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 deleted file mode 100644 index 68e0da6f..00000000 --- a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/notifications/AppEngineNotificationServlet.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.appengine.notifications; - -import com.google.api.client.extensions.appengine.datastore.AppEngineDataStoreFactory; -import com.google.api.client.googleapis.extensions.servlet.notifications.WebhookUtils; -import com.google.api.client.util.Beta; -import com.google.api.client.util.store.DataStoreFactory; - -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * {@link Beta}
- * Thread-safe Webhook App Engine Servlet to receive notifications. - * - *

- * In order to use this servlet you need to register the servlet in your web.xml. You may optionally - * extend {@link AppEngineNotificationServlet} with custom behavior. - *

- * - *

- * It is a simple wrapper around {@link WebhookUtils#processWebhookNotification(HttpServletRequest, - * HttpServletResponse, DataStoreFactory)} that uses - * {@link AppEngineDataStoreFactory#getDefaultInstance()}, so you may alternatively call that method - * instead from your {@link HttpServlet#doPost} with no loss of functionality. - *

- * - * Sample web.xml setup: - * - *
-  {@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 >}
-  {@literal <}/servlet{@literal >}
-  {@literal <}servlet-mapping{@literal >}
-      {@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 - */ -@Beta -public class AppEngineNotificationServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - WebhookUtils.processWebhookNotification( - req, resp, AppEngineDataStoreFactory.getDefaultInstance()); - } -} diff --git a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/notifications/package-info.java b/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/notifications/package-info.java deleted file mode 100644 index bc0e761e..00000000 --- a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/notifications/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Support for subscribing to topics and receiving notifications on servlet-based platforms. - * - * @since 1.16 - * @author Yaniv Inbar - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.extensions.appengine.notifications; - diff --git a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/testing/auth/oauth2/MockAppIdentityService.java b/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/testing/auth/oauth2/MockAppIdentityService.java deleted file mode 100644 index 7d9f600e..00000000 --- a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/testing/auth/oauth2/MockAppIdentityService.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2014 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.appengine.testing.auth.oauth2; - -import com.google.api.client.util.Beta; -import com.google.appengine.api.appidentity.AppIdentityService; -import com.google.appengine.api.appidentity.AppIdentityServiceFailureException; -import com.google.appengine.api.appidentity.PublicCertificate; - -import java.util.Collection; - -/** - * {@link Beta}
- * Mock implementation of AppIdentityService interface for testing. - * - * @since 1.19 - */ -@Beta -public class MockAppIdentityService implements AppIdentityService { - - private int getAccessTokenCallCount = 0; - private String accessTokenText = null; - - public MockAppIdentityService() { - } - - public int getGetAccessTokenCallCount() { - return getAccessTokenCallCount; - } - - public String getAccessTokenText() { - return accessTokenText; - } - - public void setAccessTokenText(String text) { - accessTokenText = text; - } - - @Override - public SigningResult signForApp(byte[] signBlob) { - return null; - } - - @Override - public Collection getPublicCertificatesForApp() { - return null; - } - - @Override - public GetAccessTokenResult getAccessToken(Iterable scopes) { - getAccessTokenCallCount++; - int scopeCount = 0; - for (String scope : scopes) { - if (scope != null) { - scopeCount++; - } - } - if (scopeCount == 0) { - throw new AppIdentityServiceFailureException("No scopes specified."); - } - return new GetAccessTokenResult(accessTokenText, null); - } - - @Override - public GetAccessTokenResult getAccessTokenUncached(Iterable scopes) { - return null; - } - - @Override - public String getServiceAccountName() { - return null; - } - - @Override - public ParsedAppId parseFullAppId(String fullAppId) { - return null; - } -} diff --git a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/testing/auth/oauth2/package-info.java b/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/testing/auth/oauth2/package-info.java deleted file mode 100644 index 5b79c380..00000000 --- a/google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/testing/auth/oauth2/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Test utilities for the {@code com.google.api.client.googleapis.extensions.appengine.auth.oauth2} - * package. - * - * @since 1.19 - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.extensions.appengine.testing.auth.oauth2; - diff --git a/google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java b/google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java deleted file mode 100644 index 55278902..00000000 --- a/google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.appengine.auth.oauth2; - -import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; -import com.google.api.client.googleapis.extensions.appengine.testing.auth.oauth2.MockAppIdentityService; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.MockHttpTransport; - -import junit.framework.TestCase; - -import java.io.IOException; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; - -/** - * Tests {@link AppIdentityCredential}. - * - * @author Yaniv Inbar - */ -public class AppIdentityCredentialTest extends TestCase { - - private static final Collection SCOPES = - Collections.unmodifiableCollection(Arrays.asList("scope1", "scope2")); - - public void testBuilder() { - String[] scopes = SCOPES.toArray(new String[SCOPES.size()]); - AppIdentityCredential.Builder builder = new AppIdentityCredential.Builder(SCOPES); - scopes[1] = "somethingelse"; - assertTrue(Arrays.deepEquals(SCOPES.toArray(), builder.getScopes().toArray())); - AppIdentityCredential credential = builder.build(); - assertTrue(Arrays.deepEquals(SCOPES.toArray(), credential.getScopes().toArray())); - } - - public void testUsesAppIdentityService() throws IOException { - final String expectedAccessToken = "ExpectedAccessToken"; - - MockAppIdentityService appIdentity = new MockAppIdentityService(); - appIdentity.setAccessTokenText(expectedAccessToken); - AppIdentityCredential.Builder builder = new AppIdentityCredential.Builder(SCOPES); - builder.setAppIdentityService(appIdentity); - AppIdentityCredential appCredential = builder.build(); - HttpTransport transport = new MockHttpTransport(); - HttpRequest request = transport.createRequestFactory().buildRequest( - "get", null, null); - - appCredential.intercept(request); - - assertEquals(appIdentity.getGetAccessTokenCallCount(), 1); - HttpHeaders headers = request.getHeaders(); - String authHeader = headers.getAuthorization(); - Boolean headerContainsToken = authHeader.contains(expectedAccessToken); - assertTrue(headerContainsToken); - } - - public void testAppEngineCredentialWrapper() throws IOException { - final String expectedAccessToken = "ExpectedAccessToken"; - final Collection emptyScopes = Collections.emptyList(); - - HttpTransport transport = new MockHttpTransport(); - JsonFactory jsonFactory = new JacksonFactory(); - - MockAppIdentityService appIdentity = new MockAppIdentityService(); - appIdentity.setAccessTokenText(expectedAccessToken); - - AppIdentityCredential.Builder builder = new AppIdentityCredential.Builder(emptyScopes); - builder.setAppIdentityService(appIdentity); - AppIdentityCredential appCredential = builder.build(); - - GoogleCredential wrapper = new - AppIdentityCredential.AppEngineCredentialWrapper(appCredential, transport, jsonFactory); - - HttpRequest request = transport.createRequestFactory().buildRequest("get", null, null); - - assertTrue(wrapper.createScopedRequired()); - try { - wrapper.intercept(request); - fail("Should not be able to use credential without scopes."); - } catch (Exception expected) { - } - assertEquals(appIdentity.getGetAccessTokenCallCount(), 1); - - GoogleCredential scopedWrapper = wrapper.createScoped(SCOPES); - assertNotSame(wrapper, scopedWrapper); - scopedWrapper.intercept(request); - - assertEquals(appIdentity.getGetAccessTokenCallCount(), 2); - HttpHeaders headers = request.getHeaders(); - String authHeader = headers.getAuthorization(); - assertTrue(authHeader.contains(expectedAccessToken)); - } - - public void testAppEngineCredentialWrapperNullTransportThrows() throws IOException { - JsonFactory jsonFactory = new JacksonFactory(); - try { - new AppIdentityCredential.AppEngineCredentialWrapper(null, jsonFactory); - fail(); - } catch (NullPointerException expected) { - } - } - - public void testAppEngineCredentialWrapperNullJsonFactoryThrows() throws IOException { - HttpTransport transport = new MockHttpTransport(); - try { - new AppIdentityCredential.AppEngineCredentialWrapper(transport, null); - fail(); - } catch (NullPointerException expected) { - } - } -} diff --git a/google-api-client-assembly/.project b/google-api-client-assembly/.project deleted file mode 100644 index adf98952..00000000 --- a/google-api-client-assembly/.project +++ /dev/null @@ -1,11 +0,0 @@ - - - google-api-client-assembly - - - - - - - - diff --git a/google-api-client-assembly/LICENSE.txt b/google-api-client-assembly/LICENSE.txt deleted file mode 100644 index d6456956..00000000 --- a/google-api-client-assembly/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/google-api-client-assembly/android-properties/google-api-client-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-api-client-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index 66912a9d..00000000 --- a/google-api-client-assembly/android-properties/google-api-client-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-api-client-${project.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-api-client-android-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-api-client-android-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index ac9b62fd..00000000 --- a/google-api-client-assembly/android-properties/google-api-client-android-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-api-client-android-${project.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-api-client-gson-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-api-client-gson-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index f235a13e..00000000 --- a/google-api-client-assembly/android-properties/google-api-client-gson-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-api-client-gson-${project.api.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-api-client-jackson2-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-api-client-jackson2-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index b81ed0a5..00000000 --- a/google-api-client-assembly/android-properties/google-api-client-jackson2-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-api-client-jackson2-${project.api.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-api-client-protobuf-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-api-client-protobuf-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index 29dfeda3..00000000 --- a/google-api-client-assembly/android-properties/google-api-client-protobuf-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-api-client-protobuf-${project.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-api-client-xml-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-api-client-xml-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index 0fc9b8d8..00000000 --- a/google-api-client-assembly/android-properties/google-api-client-xml-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-api-client-xml-${project.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-http-client-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-http-client-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index e03d23e5..00000000 --- a/google-api-client-assembly/android-properties/google-http-client-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-http-client-${project.http.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-http-client-android-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-http-client-android-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index de418ae8..00000000 --- a/google-api-client-assembly/android-properties/google-http-client-android-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-http-client-android-${project.http.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-http-client-gson-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-http-client-gson-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index e3d87316..00000000 --- a/google-api-client-assembly/android-properties/google-http-client-gson-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-http-client-gson-${project.http.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-http-client-jackson-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-http-client-jackson-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index f5b631c1..00000000 --- a/google-api-client-assembly/android-properties/google-http-client-jackson-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-http-client-jackson-${project.http.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-http-client-jackson2-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-http-client-jackson2-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index 506ef00b..00000000 --- a/google-api-client-assembly/android-properties/google-http-client-jackson2-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-http-client-jackson2-${project.http.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-http-client-protobuf-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-http-client-protobuf-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index 688c6ece..00000000 --- a/google-api-client-assembly/android-properties/google-http-client-protobuf-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-http-client-protobuf-${project.http.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-http-client-xml-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-http-client-xml-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index 03ce7ed6..00000000 --- a/google-api-client-assembly/android-properties/google-http-client-xml-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-http-client-xml-${project.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/google-oauth-client-1.20.0-SNAPSHOT.jar.properties b/google-api-client-assembly/android-properties/google-oauth-client-1.20.0-SNAPSHOT.jar.properties deleted file mode 100644 index ac2b82d4..00000000 --- a/google-api-client-assembly/android-properties/google-oauth-client-1.20.0-SNAPSHOT.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/google-oauth-client-${project.oauth.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/gson-2.1.jar.properties b/google-api-client-assembly/android-properties/gson-2.1.jar.properties deleted file mode 100644 index 5bd85268..00000000 --- a/google-api-client-assembly/android-properties/gson-2.1.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/gson-${project.gson.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/jackson-core-2.1.3.jar.properties b/google-api-client-assembly/android-properties/jackson-core-2.1.3.jar.properties deleted file mode 100644 index 2691195a..00000000 --- a/google-api-client-assembly/android-properties/jackson-core-2.1.3.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/jackson-core-${project.jackson-core2.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/jackson-core-asl-1.9.11.jar.properties b/google-api-client-assembly/android-properties/jackson-core-asl-1.9.11.jar.properties deleted file mode 100644 index d613b8e6..00000000 --- a/google-api-client-assembly/android-properties/jackson-core-asl-1.9.11.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/jackson-core-asl-${project.jackson-core-asl.version}-sources.jar diff --git a/google-api-client-assembly/android-properties/protobuf-java-2.4.1.jar.properties b/google-api-client-assembly/android-properties/protobuf-java-2.4.1.jar.properties deleted file mode 100644 index 3f734a01..00000000 --- a/google-api-client-assembly/android-properties/protobuf-java-2.4.1.jar.properties +++ /dev/null @@ -1 +0,0 @@ -src=../libs-sources/protobuf-java-${project.protobuf-java.version}-sources.jar diff --git a/google-api-client-assembly/assembly.xml b/google-api-client-assembly/assembly.xml deleted file mode 100644 index 6578dd86..00000000 --- a/google-api-client-assembly/assembly.xml +++ /dev/null @@ -1,51 +0,0 @@ - - ${project.version} - false - - zip - - - - LICENSE.txt - google-api-java-client - - - classpath-include - true - google-api-java-client - - - proguard-google-api-client.txt - google-api-java-client - - - readme.html - true - google-api-java-client - - - - - dependencies - google-api-java-client/dependencies - - - target/libs - - *.pom - - google-api-java-client/libs - - - android-properties - google-api-java-client/libs - true - - - target/libs-sources - google-api-java-client/libs-sources - - - diff --git a/google-api-client-assembly/classpath-include b/google-api-client-assembly/classpath-include deleted file mode 100644 index e5be4f92..00000000 --- a/google-api-client-assembly/classpath-include +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/google-api-client-assembly/dependencies/APACHE-LICENSE.txt b/google-api-client-assembly/dependencies/APACHE-LICENSE.txt deleted file mode 100644 index 75b52484..00000000 --- a/google-api-client-assembly/dependencies/APACHE-LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/google-api-client-assembly/dependencies/BSD-LICENSE.txt b/google-api-client-assembly/dependencies/BSD-LICENSE.txt deleted file mode 100644 index 5ebe92c5..00000000 --- a/google-api-client-assembly/dependencies/BSD-LICENSE.txt +++ /dev/null @@ -1,27 +0,0 @@ -BSD License - -Copyright (c) 2000-2006, www.hamcrest.org -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of -conditions and the following disclaimer. Redistributions in binary form must reproduce -the above copyright notice, this list of conditions and the following disclaimer in -the documentation and/or other materials provided with the distribution. - -Neither the name of Hamcrest nor the names of its contributors may be used to endorse -or promote products derived from this software without specific prior written -permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT -SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. diff --git a/google-api-client-assembly/dependencies/CDDL-LICENSE.txt b/google-api-client-assembly/dependencies/CDDL-LICENSE.txt deleted file mode 100644 index 1154e0ae..00000000 --- a/google-api-client-assembly/dependencies/CDDL-LICENSE.txt +++ /dev/null @@ -1,119 +0,0 @@ -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - -1. Definitions. - -1.1. Contributor means each individual or entity that creates or contributes to the creation of Modifications. - -1.2. Contributor Version means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. - -1.3. Covered Software means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. - -1.4. Executable means the Covered Software in any form other than Source Code. - -1.5. Initial Developer means the individual or entity that first makes Original Software available under this License. - -1.6. Larger Work means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. - -1.7. License means this document. - -1.8. Licensable means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. - -1.9. Modifications means the Source Code and Executable form of any of the following: - -A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; - -B. Any new file that contains any part of the Original Software or previous Modification; or - -C. Any new file that is contributed or otherwise made available under the terms of this License. - -1.10. Original Software means the Source Code and Executable form of computer software code that is originally released under this License. - -1.11. Patent Claims means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. - -1.12. Source Code means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. - -1.13. You (or Your) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, You includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, control means (a)áthe power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b)áownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. - -2. License Grants. - -2.1. The Initial Developer Grant. -Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: -(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and -(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). -(c) The licenses granted in Sectionsá2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. -(d) Notwithstanding Sectioná2.1(b) above, no patent license is granted: (1)áfor code that You delete from the Original Software, or (2)áfor infringements caused by: (i)áthe modification of the Original Software, or (ii)áthe combination of the Original Software with other software or devices. - -2.2. Contributor Grant. -Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: -(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and -(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1)áModifications made by that Contributor (or portions thereof); and (2)áthe combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). -(c) The licenses granted in Sectionsá2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. -(d) Notwithstanding Sectioná2.2(b) above, no patent license is granted: (1)áfor any code that Contributor has deleted from the Contributor Version; (2)áfor infringements caused by: (i)áthird party modifications of Contributor Version, or (ii)áthe combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3)áunder Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. - -3. Distribution Obligations. - -3.1. Availability of Source Code. - -Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. - -3.2. Modifications. - -The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. - -3.3. Required Notices. -You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. - -3.4. Application of Additional Terms. -You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. - -3.5. Distribution of Executable Versions. -You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipients rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. - -3.6. Larger Works. -You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. - -4. Versions of the License. - -4.1. New Versions. -Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. - -4.2. Effect of New Versions. - -You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. -4.3. Modified Versions. - -When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a)árename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b)áotherwise make it clear that the license contains terms which differ from this License. - -5. DISCLAIMER OF WARRANTY. - -COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. - -6. TERMINATION. - -6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. - -6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as Participant) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sectionsá2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. - -6.3. In the event of termination under Sectionsá6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. - -7. LIMITATION OF LIABILITY. - -UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTYS NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -8. U.S. GOVERNMENT END USERS. - -The Covered Software is a commercial item, as that term is defined in 48áC.F.R.á2.101 (Oct. 1995), consisting of commercial computer software (as that term is defined at 48 C.F.R. á252.227-7014(a)(1)) and commercial computer software documentation as such terms are used in 48áC.F.R.á12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. - -9. MISCELLANEOUS. - -This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdictions conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. - -10. RESPONSIBILITY FOR CLAIMS. - -As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. - -NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) -The GlassFish code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California. - - - diff --git a/google-api-client-assembly/dependencies/css/maven-base.css b/google-api-client-assembly/dependencies/css/maven-base.css deleted file mode 100644 index 584ba23b..00000000 --- a/google-api-client-assembly/dependencies/css/maven-base.css +++ /dev/null @@ -1,151 +0,0 @@ -body { - margin: 0px; - padding: 0px; -} -img { - border:none; -} -table { - padding:0px; - width: 100%; - margin-left: -2px; - margin-right: -2px; -} -acronym { - cursor: help; - border-bottom: 1px dotted #feb; -} -table.bodyTable th, table.bodyTable td { - padding: 2px 4px 2px 4px; - vertical-align: top; -} -div.clear{ - clear:both; - visibility: hidden; -} -div.clear hr{ - display: none; -} -#bannerLeft, #bannerRight { - font-size: xx-large; - font-weight: bold; -} -#bannerLeft img, #bannerRight img { - margin: 0px; -} -.xleft, #bannerLeft img { - float:left; -} -.xright, #bannerRight { - float:right; -} -#banner { - padding: 0px; -} -#banner img { - border: none; -} -#breadcrumbs { - padding: 3px 10px 3px 10px; -} -#leftColumn { - width: 170px; - float:left; - overflow: auto; -} -#bodyColumn { - margin-right: 1.5em; - margin-left: 197px; -} -#legend { - padding: 8px 0 8px 0; -} -#navcolumn { - padding: 8px 4px 0 8px; -} -#navcolumn h5 { - margin: 0; - padding: 0; - font-size: small; -} -#navcolumn ul { - margin: 0; - padding: 0; - font-size: small; -} -#navcolumn li { - list-style-type: none; - background-image: none; - background-repeat: no-repeat; - background-position: 0 0.4em; - padding-left: 16px; - list-style-position: outside; - line-height: 1.2em; - font-size: smaller; -} -#navcolumn li.expanded { - background-image: url(../images/expanded.gif); -} -#navcolumn li.collapsed { - background-image: url(../images/collapsed.gif); -} -#poweredBy { - text-align: center; -} -#navcolumn img { - margin-top: 10px; - margin-bottom: 3px; -} -#poweredBy img { - display:block; - margin: 20px 0 20px 17px; -} -#search img { - margin: 0px; - display: block; -} -#search #q, #search #btnG { - border: 1px solid #999; - margin-bottom:10px; -} -#search form { - margin: 0px; -} -#lastPublished { - font-size: x-small; -} -.navSection { - margin-bottom: 2px; - padding: 8px; -} -.navSectionHead { - font-weight: bold; - font-size: x-small; -} -.section { - padding: 4px; -} -#footer { - padding: 3px 10px 3px 10px; - font-size: x-small; -} -#breadcrumbs { - font-size: x-small; - margin: 0pt; -} -.source { - padding: 12px; - margin: 1em 7px 1em 7px; -} -.source pre { - margin: 0px; - padding: 0px; -} -#navcolumn img.imageLink, .imageLink { - padding-left: 0px; - padding-bottom: 0px; - padding-top: 0px; - padding-right: 2px; - border: 0px; - margin: 0px; -} diff --git a/google-api-client-assembly/dependencies/css/maven-theme.css b/google-api-client-assembly/dependencies/css/maven-theme.css deleted file mode 100644 index c982168b..00000000 --- a/google-api-client-assembly/dependencies/css/maven-theme.css +++ /dev/null @@ -1,141 +0,0 @@ -body { - padding: 0px 0px 10px 0px; -} -body, td, select, input, li{ - font-family: Verdana, Helvetica, Arial, sans-serif; - font-size: 13px; -} -code{ - font-family: Courier, monospace; - font-size: 13px; -} -a { - text-decoration: none; -} -a:link { - color:#36a; -} -a:visited { - color:#47a; -} -a:active, a:hover { - color:#69c; -} -#legend li.externalLink { - background: url(../images/external.png) left top no-repeat; - padding-left: 18px; -} -a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover { - background: url(../images/external.png) right center no-repeat; - padding-right: 18px; -} -#legend li.newWindow { - background: url(../images/newwindow.png) left top no-repeat; - padding-left: 18px; -} -a.newWindow, a.newWindow:link, a.newWindow:visited, a.newWindow:active, a.newWindow:hover { - background: url(../images/newwindow.png) right center no-repeat; - padding-right: 18px; -} -h2 { - padding: 4px 4px 4px 6px; - border: 1px solid #999; - color: #900; - background-color: #ddd; - font-weight:900; - font-size: x-large; -} -h3 { - padding: 4px 4px 4px 6px; - border: 1px solid #aaa; - color: #900; - background-color: #eee; - font-weight: normal; - font-size: large; -} -h4 { - padding: 4px 4px 4px 6px; - border: 1px solid #bbb; - color: #900; - background-color: #fff; - font-weight: normal; - font-size: large; -} -h5 { - padding: 4px 4px 4px 6px; - color: #900; - font-size: normal; -} -p { - line-height: 1.3em; - font-size: small; -} -#breadcrumbs { - border-top: 1px solid #aaa; - border-bottom: 1px solid #aaa; - background-color: #ccc; -} -#leftColumn { - margin: 10px 0 0 5px; - border: 1px solid #999; - background-color: #eee; -} -#navcolumn h5 { - font-size: smaller; - border-bottom: 1px solid #aaaaaa; - padding-top: 2px; - color: #000; -} - -table.bodyTable th { - color: white; - background-color: #bbb; - text-align: left; - font-weight: bold; -} - -table.bodyTable th, table.bodyTable td { - font-size: 1em; -} - -table.bodyTable tr.a { - background-color: #ddd; -} - -table.bodyTable tr.b { - background-color: #eee; -} - -.source { - border: 1px solid #999; -} -dl { - padding: 4px 4px 4px 6px; - border: 1px solid #aaa; - background-color: #ffc; -} -dt { - color: #900; -} -#organizationLogo img, #projectLogo img, #projectLogo span{ - margin: 8px; -} -#banner { - border-bottom: 1px solid #fff; -} -.errormark, .warningmark, .donemark, .infomark { - background: url(../images/icon_error_sml.gif) no-repeat; -} - -.warningmark { - background-image: url(../images/icon_warning_sml.gif); -} - -.donemark { - background-image: url(../images/icon_success_sml.gif); -} - -.infomark { - background-image: url(../images/icon_info_sml.gif); -} - diff --git a/google-api-client-assembly/dependencies/css/print.css b/google-api-client-assembly/dependencies/css/print.css deleted file mode 100644 index 26ad7f0b..00000000 --- a/google-api-client-assembly/dependencies/css/print.css +++ /dev/null @@ -1,7 +0,0 @@ -#banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn { - display: none !important; -} -#bodyColumn, body.docs div.docs { - margin: 0 !important; - border: none !important -} diff --git a/google-api-client-assembly/dependencies/css/site.css b/google-api-client-assembly/dependencies/css/site.css deleted file mode 100644 index 055e7e28..00000000 --- a/google-api-client-assembly/dependencies/css/site.css +++ /dev/null @@ -1 +0,0 @@ -/* You can override this file with your own styles */ \ No newline at end of file diff --git a/google-api-client-assembly/dependencies/google-api-client-android-dependencies.html b/google-api-client-assembly/dependencies/google-api-client-android-dependencies.html deleted file mode 100644 index 99b9fead..00000000 --- a/google-api-client-assembly/dependencies/google-api-client-android-dependencies.html +++ /dev/null @@ -1,763 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.api-clientgoogle-api-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-android1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.androidandroid4.1.1.4jarApache 2.0
com.google.android.google-play-servicesgoogle-play-services1jar-
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.fasterxml.jackson.corejackson-core2.1.3jarThe Apache Software License, Version 2.0
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jackson21.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.3jar/LICENSE.txt
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
org.jsonjson20080701jarprovided without support or warranty
org.khronosopengl-apigl1.1-android-2.1_r1jarApache 2.0
xercesxmlParserAPIs2.6.2jar-
xpp3xpp31.1.4cjarIndiana University Extreme! Lab Software License, vesion 1.1.1-Public Domain-Apache Software License, version 1.1
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache Software License, version 1.1: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-

Public Domain: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-

Unknown: google-play-services, xmlParserAPIs

-

Apache License: HttpClient, HttpCore

-

provided without support or warranty: JSON (JavaScript Object Notation)

-

Apache 2.0: Google Android Java ME Library (Khronos), Google Android Library

-

The Apache Software License, Version 2.0: Android Platform Extensions to the Google APIs Client Library for Java., Android Platform Extensions to the Google HTTP Client Library for Java., Codec, Commons Logging, FindBugs-jsr305, Google APIs Client Library for Java, Google HTTP Client Library for Java, Google OAuth Client Library for Java, Guava: Google Core Libraries for Java, Jackson 2 extensions to the Google HTTP Client Library for Java., Jackson-core

-

Indiana University Extreme! Lab Software License, vesion 1.1.1: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jackson-core-2.1.3.jar201.95 kB1108981.5debug
android-4.1.1.4.jar12.35 MB7,2641,698711.5debug
google-play-services-1.jar1.22 MB1,2521,251461.6release
google-api-client-1.20.0-SNAPSHOT.jar184.78 kB133102221.5debug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-android-1.20.0-SNAPSHOT.jar11.77 kB211131.5debug
google-http-client-jackson2-1.20.0-SNAPSHOT.jar6.57 kB13511.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
commons-codec-1.3.jar45.63 kB422551.2debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
json-20080701.jar36.99 kB261711.3debug
opengl-api-gl1.1-android-2.1_r1.jar18.06 kB251321.5debug
xmlParserAPIs-2.6.2.jar121.80 kB238207171.1release
xpp3-1.1.4c.jar117.25 kB7856131.1debug
TotalSizeEntriesClassesPackagesJDK RevDebug
1816.86 MB11,4575,5522611.616
compile: 12compile: 3.00 MBcompile: 2,574compile: 2,310compile: 111-compile: 12
provided: 6provided: 13.86 MBprovided: 8,883provided: 3,242provided: 150-provided: 4
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.fasterxml.jackson.core:jackson-core:jar:2.1.3--Found at http://repo.maven.apache.org/maven2
com.google.android:android:jar:4.1.1.4--Found at http://repo.maven.apache.org/maven2
com.google.android.google-play-services:google-play-services:jar:1---
com.google.api-client:google-api-client:jar:1.20.0-SNAPSHOT---
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-android:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jackson2:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.3--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.json:json:jar:20080701--Found at http://repo.maven.apache.org/maven2
org.khronos:opengl-api:jar:gl1.1-android-2.1_r1--Found at http://repo.maven.apache.org/maven2
xerces:xmlParserAPIs:jar:2.6.2--Found at http://repo.maven.apache.org/maven2
xpp3:xpp3:jar:1.1.4c--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
18 (compile: 12, provided: 6)0012
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-api-client-appengine-dependencies.html b/google-api-client-assembly/dependencies/google-api-client-appengine-dependencies.html deleted file mode 100644 index 25e9b9e6..00000000 --- a/google-api-client-assembly/dependencies/google-api-client-appengine-dependencies.html +++ /dev/null @@ -1,944 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.api-clientgoogle-api-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.api-clientgoogle-api-client-servlet1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-appengine1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client-appengine1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.appengineappengine-api-labs1.7.7jarGoogle App Engine Terms of Service
com.google.appengineappengine-api-stubs1.7.7jarGoogle App Engine Terms of Service
com.google.appengineappengine-testing1.7.7jarGoogle App Engine Terms of Service
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jackson21.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.appengineappengine-api-1.0-sdk1.7.7jarGoogle App Engine Terms of Service
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jdo1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client-servlet1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.3jar/LICENSE.txt
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
javax.jdojdo2-api2.3-ebjarApache 2
javax.servletservlet-api2.5jar-
javax.transactiontransaction-api1.1jar-
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.fasterxml.jackson.corejackson-core2.1.3jarThe Apache Software License, Version 2.0
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Google App Engine Terms of Service: appengine-api-1.0-sdk, appengine-api-labs, appengine-api-stubs, appengine-testing

-

Apache 2: JDO2 API

-

Unknown: servlet-api, transaction-api

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Codec, Commons Logging, FindBugs-jsr305, Google APIs Client Library for Java, Google App Engine extensions to the Google API Client Library for Java., Google App Engine extensions to the Google HTTP Client Library for Java., Google App Engine extensions to the Google OAuth Client Library for Java., Google HTTP Client Library for Java, Google OAuth Client Library for Java, Guava: Google Core Libraries for Java, JDO extensions to the Google HTTP Client Library for Java., Jackson 2 extensions to the Google HTTP Client Library for Java., Jackson-core, Servlet and JDO extensions to the Google API Client Library for Java., Servlet and JDO extensions to the Google OAuth Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jackson-core-2.1.3.jar201.95 kB1108981.5debug
google-api-client-1.20.0-SNAPSHOT.jar184.78 kB133102221.5debug
google-api-client-servlet-1.20.0-SNAPSHOT.jar6.57 kB14411.5debug
appengine-api-1.0-sdk-1.7.7.jar30.66 MB6,5666,044861.6debug
appengine-api-labs-1.7.7.jar10.94 MB1,4481,374101.6debug
appengine-api-stubs-1.7.7.jar12.16 MB3,0982,7851671.6debug
appengine-testing-1.7.7.jar10.32 MB2,2932,265261.6debug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-appengine-1.20.0-SNAPSHOT.jar15.34 kB211121.5debug
google-http-client-jackson2-1.20.0-SNAPSHOT.jar6.57 kB13511.5debug
google-http-client-jdo-1.20.0-SNAPSHOT.jar11.08 kB13511.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
google-oauth-client-appengine-1.20.0-SNAPSHOT.jar7.77 kB17721.5debug
google-oauth-client-servlet-1.20.0-SNAPSHOT.jar21.61 kB241141.5debug
commons-codec-1.3.jar45.63 kB422551.2debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
jdo2-api-2.3-eb.jar188.18 kB22618271.5debug
servlet-api-2.5.jar102.65 kB684221.5debug
transaction-api-1.1.jar14.72 kB241821.3debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
TotalSizeEntriesClassesPackagesJDK RevDebug
2467.65 MB16,63215,2774481.624
compile: 16compile: 1.43 MBcompile: 1,441compile: 1,113compile: 107-compile: 16
test: 7test: 35.55 MBtest: 8,625test: 8,120test: 255-test: 7
provided: 1provided: 30.66 MBprovided: 6,566provided: 6,044provided: 86-provided: 1
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.fasterxml.jackson.core:jackson-core:jar:2.1.3--Found at http://repo.maven.apache.org/maven2
com.google.api-client:google-api-client:jar:1.20.0-SNAPSHOT---
com.google.api-client:google-api-client-servlet:jar:1.20.0-SNAPSHOT---
com.google.appengine:appengine-api-1.0-sdk:jar:1.7.7--Found at http://repo.maven.apache.org/maven2
com.google.appengine:appengine-api-labs:jar:1.7.7--Found at http://repo.maven.apache.org/maven2
com.google.appengine:appengine-api-stubs:jar:1.7.7--Found at http://repo.maven.apache.org/maven2
com.google.appengine:appengine-testing:jar:1.7.7--Found at http://repo.maven.apache.org/maven2
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-appengine:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jackson2:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jdo:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client-appengine:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client-servlet:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.3--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
javax.jdo:jdo2-api:jar:2.3-eb--Found at http://repo.maven.apache.org/maven2
javax.servlet:servlet-api:jar:2.5--Found at http://repo.maven.apache.org/maven2
javax.transaction:transaction-api:jar:1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
24 (compile: 16, test: 7, provided: 1)0015
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-api-client-dependencies.html b/google-api-client-assembly/dependencies/google-api-client-dependencies.html deleted file mode 100644 index 9c3f325e..00000000 --- a/google-api-client-assembly/dependencies/google-api-client-dependencies.html +++ /dev/null @@ -1,690 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jackson21.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.http-clientgoogle-http-client-gson1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-protobuf1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.fasterxml.jackson.corejackson-core2.1.3jarThe Apache Software License, Version 2.0
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.gsongson2.1jarThe Apache Software License, Version 2.0
com.google.protobufprotobuf-java2.4.1jarNew BSD license
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache License: HttpClient, HttpCore

-

New BSD license: Protocol Buffer Java API

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, FindBugs-jsr305, GSON extensions to the Google HTTP Client Library for Java., Google APIs Client Library for Java, Google HTTP Client Library for Java, Google OAuth Client Library for Java, Gson, Guava: Google Core Libraries for Java, Jackson 2 extensions to the Google HTTP Client Library for Java., Jackson-core, Protocol Buffer extensions to the Google HTTP Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jackson-core-2.1.3.jar201.95 kB1108981.5debug
jsr305-1.3.9.jar32.24 kB723531.5debug
gson-2.1.jar175.89 kB15814861.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-gson-1.20.0-SNAPSHOT.jar8.36 kB14611.5debug
google-http-client-jackson2-1.20.0-SNAPSHOT.jar6.57 kB13511.5debug
google-http-client-protobuf-1.20.0-SNAPSHOT.jar5.13 kB14521.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
protobuf-java-2.4.1.jar439.73 kB21420411.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
TotalSizeEntriesClassesPackagesJDK RevDebug
153.82 MB3,2632,8411271.515
compile: 9compile: 2.76 MBcompile: 2,378compile: 2,172compile: 81-compile: 9
test: 5test: 860.89 kBtest: 667test: 593test: 40-test: 5
provided: 1provided: 227.32 kBprovided: 218provided: 76provided: 6-provided: 1
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.fasterxml.jackson.core:jackson-core:jar:2.1.3--Found at http://repo.maven.apache.org/maven2
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.code.gson:gson:jar:2.1--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-gson:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jackson2:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-protobuf:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT---
com.google.protobuf:protobuf-java:jar:2.4.1--Found at http://repo.maven.apache.org/maven2
commons-codec:commons-codec:jar:1.6--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
15 (compile: 9, test: 5, provided: 1)0010
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-api-client-gson-dependencies.html b/google-api-client-assembly/dependencies/google-api-client-gson-dependencies.html deleted file mode 100644 index 88f5df0a..00000000 --- a/google-api-client-assembly/dependencies/google-api-client-gson-dependencies.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.api-clientgoogle-api-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-gson1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.fasterxml.jackson.corejackson-core2.1.3jarThe Apache Software License, Version 2.0
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.code.gsongson2.1jarThe Apache Software License, Version 2.0
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jackson21.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.3jar/LICENSE.txt
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache License: HttpClient, HttpCore

-

The Apache Software License, Version 2.0: Codec, Commons Logging, FindBugs-jsr305, GSON extensions to the Google APIs Client Library for Java, GSON extensions to the Google HTTP Client Library for Java., Google APIs Client Library for Java, Google HTTP Client Library for Java, Google OAuth Client Library for Java, Gson, Guava: Google Core Libraries for Java, Jackson 2 extensions to the Google HTTP Client Library for Java., Jackson-core

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jackson-core-2.1.3.jar201.95 kB1108981.5debug
google-api-client-1.20.0-SNAPSHOT.jar184.78 kB133102221.5debug
jsr305-1.3.9.jar32.24 kB723531.5debug
gson-2.1.jar175.89 kB15814861.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-gson-1.20.0-SNAPSHOT.jar8.36 kB14611.5debug
google-http-client-jackson2-1.20.0-SNAPSHOT.jar6.57 kB13511.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
commons-codec-1.3.jar45.63 kB422551.2debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
TotalSizeEntriesClassesPackagesJDK RevDebug
133.17 MB2,7252,4531151.513
compile: 13compile: 3.17 MBcompile: 2,725compile: 2,453compile: 115-compile: 13
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.fasterxml.jackson.core:jackson-core:jar:2.1.3--Found at http://repo.maven.apache.org/maven2
com.google.api-client:google-api-client:jar:1.20.0-SNAPSHOT---
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.code.gson:gson:jar:2.1--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-gson:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jackson2:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.3--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
13 (compile: 13)008
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-api-client-jackson2-dependencies.html b/google-api-client-assembly/dependencies/google-api-client-jackson2-dependencies.html deleted file mode 100644 index 11ba2dad..00000000 --- a/google-api-client-assembly/dependencies/google-api-client-jackson2-dependencies.html +++ /dev/null @@ -1,528 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.api-clientgoogle-api-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jackson21.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.fasterxml.jackson.corejackson-core2.1.3jarThe Apache Software License, Version 2.0
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.3jar/LICENSE.txt
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache License: HttpClient, HttpCore

-

The Apache Software License, Version 2.0: Codec, Commons Logging, FindBugs-jsr305, Google APIs Client Library for Java, Google HTTP Client Library for Java, Google OAuth Client Library for Java, Guava: Google Core Libraries for Java, Jackson 2 extensions to the Google APIs Client Library for Java, Jackson 2 extensions to the Google HTTP Client Library for Java., Jackson-core

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jackson-core-2.1.3.jar201.95 kB1108981.5debug
google-api-client-1.20.0-SNAPSHOT.jar184.78 kB133102221.5debug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-jackson2-1.20.0-SNAPSHOT.jar6.57 kB13511.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
commons-codec-1.3.jar45.63 kB422551.2debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
TotalSizeEntriesClassesPackagesJDK RevDebug
112.99 MB2,5532,2991081.511
compile: 11compile: 2.99 MBcompile: 2,553compile: 2,299compile: 108-compile: 11
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.fasterxml.jackson.core:jackson-core:jar:2.1.3--Found at http://repo.maven.apache.org/maven2
com.google.api-client:google-api-client:jar:1.20.0-SNAPSHOT---
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jackson2:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.3--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
11 (compile: 11)007
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-api-client-java6-dependencies.html b/google-api-client-assembly/dependencies/google-api-client-java6-dependencies.html deleted file mode 100644 index 66ed05db..00000000 --- a/google-api-client-assembly/dependencies/google-api-client-java6-dependencies.html +++ /dev/null @@ -1,603 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.api-clientgoogle-api-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client-java61.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.fasterxml.jackson.corejackson-core2.1.3jarThe Apache Software License, Version 2.0
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jackson21.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.3jar/LICENSE.txt
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Codec, Commons Logging, FindBugs-jsr305, Google APIs Client Library for Java, Google HTTP Client Library for Java, Google OAuth Client Library for Java, Guava: Google Core Libraries for Java, Jackson 2 extensions to the Google HTTP Client Library for Java., Jackson-core, Java 6 (and higher) Extensions to the Google API Client Library for Java., Java 6 (and higher) extensions to the Google OAuth Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jackson-core-2.1.3.jar201.95 kB1108981.5debug
google-api-client-1.20.0-SNAPSHOT.jar184.78 kB133102221.5debug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-jackson2-1.20.0-SNAPSHOT.jar6.57 kB13511.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
google-oauth-client-java6-1.20.0-SNAPSHOT.jar10.67 kB16611.5debug
commons-codec-1.3.jar45.63 kB422551.2debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
TotalSizeEntriesClassesPackagesJDK RevDebug
133.22 MB2,8362,5351391.513
compile: 12compile: 3.00 MBcompile: 2,569compile: 2,305compile: 109-compile: 12
test: 1test: 231.78 kBtest: 267test: 230test: 30-test: 1
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.fasterxml.jackson.core:jackson-core:jar:2.1.3--Found at http://repo.maven.apache.org/maven2
com.google.api-client:google-api-client:jar:1.20.0-SNAPSHOT---
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jackson2:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client-java6:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.3--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
13 (compile: 12, test: 1)008
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-api-client-protobuf-dependencies.html b/google-api-client-assembly/dependencies/google-api-client-protobuf-dependencies.html deleted file mode 100644 index 531d90c0..00000000 --- a/google-api-client-assembly/dependencies/google-api-client-protobuf-dependencies.html +++ /dev/null @@ -1,633 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.api-clientgoogle-api-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-protobuf1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.fasterxml.jackson.corejackson-core2.1.3jarThe Apache Software License, Version 2.0
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jackson21.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.protobufprotobuf-java2.4.1jarNew BSD license
commons-codeccommons-codec1.3jar/LICENSE.txt
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache License: HttpClient, HttpCore

-

New BSD license: Protocol Buffer Java API

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Codec, Commons Logging, FindBugs-jsr305, Google APIs Client Library for Java, Google HTTP Client Library for Java, Google OAuth Client Library for Java, Guava: Google Core Libraries for Java, Jackson 2 extensions to the Google HTTP Client Library for Java., Jackson-core, Protocol Buffer extensions to the Google APIs Client Library for Java, Protocol Buffer extensions to the Google HTTP Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jackson-core-2.1.3.jar201.95 kB1108981.5debug
google-api-client-1.20.0-SNAPSHOT.jar184.78 kB133102221.5debug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-jackson2-1.20.0-SNAPSHOT.jar6.57 kB13511.5debug
google-http-client-protobuf-1.20.0-SNAPSHOT.jar5.13 kB14521.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
protobuf-java-2.4.1.jar439.73 kB21420411.5debug
commons-codec-1.3.jar45.63 kB422551.2debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
TotalSizeEntriesClassesPackagesJDK RevDebug
143.65 MB3,0482,7381411.514
compile: 13compile: 3.42 MBcompile: 2,781compile: 2,508compile: 111-compile: 13
test: 1test: 231.78 kBtest: 267test: 230test: 30-test: 1
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.fasterxml.jackson.core:jackson-core:jar:2.1.3--Found at http://repo.maven.apache.org/maven2
com.google.api-client:google-api-client:jar:1.20.0-SNAPSHOT---
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jackson2:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-protobuf:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT---
com.google.protobuf:protobuf-java:jar:2.4.1--Found at http://repo.maven.apache.org/maven2
commons-codec:commons-codec:jar:1.3--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
14 (compile: 13, test: 1)009
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-api-client-servlet-dependencies.html b/google-api-client-assembly/dependencies/google-api-client-servlet-dependencies.html deleted file mode 100644 index 1829f4ea..00000000 --- a/google-api-client-assembly/dependencies/google-api-client-servlet-dependencies.html +++ /dev/null @@ -1,717 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.api-clientgoogle-api-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client-servlet1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
javax.jdojdo2-api2.3-ebjarApache 2
javax.servletservlet-api2.5jar-
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.fasterxml.jackson.corejackson-core2.1.3jarThe Apache Software License, Version 2.0
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jackson21.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jdo1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.3jar/LICENSE.txt
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
javax.transactiontransaction-api1.1jar-
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache 2: JDO2 API

-

Unknown: servlet-api, transaction-api

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Codec, Commons Logging, FindBugs-jsr305, Google APIs Client Library for Java, Google HTTP Client Library for Java, Google OAuth Client Library for Java, Guava: Google Core Libraries for Java, JDO extensions to the Google HTTP Client Library for Java., Jackson 2 extensions to the Google HTTP Client Library for Java., Jackson-core, Servlet and JDO extensions to the Google API Client Library for Java., Servlet and JDO extensions to the Google OAuth Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jackson-core-2.1.3.jar201.95 kB1108981.5debug
google-api-client-1.20.0-SNAPSHOT.jar184.78 kB133102221.5debug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-jackson2-1.20.0-SNAPSHOT.jar6.57 kB13511.5debug
google-http-client-jdo-1.20.0-SNAPSHOT.jar11.08 kB13511.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
google-oauth-client-servlet-1.20.0-SNAPSHOT.jar21.61 kB241141.5debug
commons-codec-1.3.jar45.63 kB422551.2debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
jdo2-api-2.3-eb.jar188.18 kB22618271.5debug
servlet-api-2.5.jar102.65 kB684221.5debug
transaction-api-1.1.jar14.72 kB241821.3debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
TotalSizeEntriesClassesPackagesJDK RevDebug
173.54 MB3,1752,7871541.517
compile: 16compile: 3.32 MBcompile: 2,908compile: 2,557compile: 124-compile: 16
test: 1test: 231.78 kBtest: 267test: 230test: 30-test: 1
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.fasterxml.jackson.core:jackson-core:jar:2.1.3--Found at http://repo.maven.apache.org/maven2
com.google.api-client:google-api-client:jar:1.20.0-SNAPSHOT---
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jackson2:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jdo:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client-servlet:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.3--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
javax.jdo:jdo2-api:jar:2.3-eb--Found at http://repo.maven.apache.org/maven2
javax.servlet:servlet-api:jar:2.5--Found at http://repo.maven.apache.org/maven2
javax.transaction:transaction-api:jar:1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
17 (compile: 16, test: 1)0011
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-api-client-xml-dependencies.html b/google-api-client-assembly/dependencies/google-api-client-xml-dependencies.html deleted file mode 100644 index eeb14e33..00000000 --- a/google-api-client-assembly/dependencies/google-api-client-xml-dependencies.html +++ /dev/null @@ -1,635 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.api-clientgoogle-api-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-xml1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.fasterxml.jackson.corejackson-core2.1.3jarThe Apache Software License, Version 2.0
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jackson21.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.3jar/LICENSE.txt
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
xpp3xpp31.1.4cjarIndiana University Extreme! Lab Software License, vesion 1.1.1-Public Domain-Apache Software License, version 1.1
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache Software License, version 1.1: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-

Public Domain: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Codec, Commons Logging, FindBugs-jsr305, Google APIs Client Library for Java, Google HTTP Client Library for Java, Google OAuth Client Library for Java, Guava: Google Core Libraries for Java, Jackson 2 extensions to the Google HTTP Client Library for Java., Jackson-core, XML extensions to the Google APIs Client Library for Java, XML extensions to the Google HTTP Client Library for Java.

-

Indiana University Extreme! Lab Software License, vesion 1.1.1: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jackson-core-2.1.3.jar201.95 kB1108981.5debug
google-api-client-1.20.0-SNAPSHOT.jar184.78 kB133102221.5debug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-jackson2-1.20.0-SNAPSHOT.jar6.57 kB13511.5debug
google-http-client-xml-1.20.0-SNAPSHOT.jar27.41 kB281741.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
commons-codec-1.3.jar45.63 kB422551.2debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
xpp3-1.1.4c.jar117.25 kB7856131.1debug
TotalSizeEntriesClassesPackagesJDK RevDebug
143.35 MB2,9262,6021551.514
compile: 13compile: 3.13 MBcompile: 2,659compile: 2,372compile: 125-compile: 13
test: 1test: 231.78 kBtest: 267test: 230test: 30-test: 1
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.fasterxml.jackson.core:jackson-core:jar:2.1.3--Found at http://repo.maven.apache.org/maven2
com.google.api-client:google-api-client:jar:1.20.0-SNAPSHOT---
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jackson2:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-xml:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.3--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
xpp3:xpp3:jar:1.1.4c--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
14 (compile: 13, test: 1)009
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-http-client-android-dependencies.html b/google-api-client-assembly/dependencies/google-http-client-android-dependencies.html deleted file mode 100644 index a9165219..00000000 --- a/google-api-client-assembly/dependencies/google-http-client-android-dependencies.html +++ /dev/null @@ -1,559 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.androidandroid4.1.1.4jarApache 2.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
org.jsonjson20080701jarprovided without support or warranty
org.khronosopengl-apigl1.1-android-2.1_r1jarApache 2.0
xercesxmlParserAPIs2.6.2jar-
xpp3xpp31.1.4cjarIndiana University Extreme! Lab Software License, vesion 1.1.1-Public Domain-Apache Software License, version 1.1
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache Software License, version 1.1: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-

Public Domain: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-

Unknown: xmlParserAPIs

-

Apache License: HttpClient, HttpCore

-

provided without support or warranty: JSON (JavaScript Object Notation)

-

Apache 2.0: Google Android Java ME Library (Khronos), Google Android Library

-

The Apache Software License, Version 2.0: Android Platform Extensions to the Google HTTP Client Library for Java., Commons Codec, Commons Logging, FindBugs-jsr305, Google HTTP Client Library for Java

-

Indiana University Extreme! Lab Software License, vesion 1.1.1: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
android-4.1.1.4.jar12.35 MB7,2641,698711.5debug
jsr305-1.3.9.jar32.24 kB723531.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
json-20080701.jar36.99 kB261711.3debug
opengl-api-gl1.1-android-2.1_r1.jar18.06 kB251321.5debug
xmlParserAPIs-2.6.2.jar121.80 kB238207171.1release
xpp3-1.1.4c.jar117.25 kB7856131.1debug
TotalSizeEntriesClassesPackagesJDK RevDebug
1113.65 MB8,6512,7261661.510
compile: 6compile: 1.01 MBcompile: 1,020compile: 735compile: 62-compile: 6
provided: 5provided: 12.64 MBprovided: 7,631provided: 1,991provided: 104-provided: 4
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.google.android:android:jar:4.1.1.4--Found at http://repo.maven.apache.org/maven2
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.6--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.json:json:jar:20080701--Found at http://repo.maven.apache.org/maven2
org.khronos:opengl-api:jar:gl1.1-android-2.1_r1--Found at http://repo.maven.apache.org/maven2
xerces:xmlParserAPIs:jar:2.6.2--Found at http://repo.maven.apache.org/maven2
xpp3:xpp3:jar:1.1.4c--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
11 (compile: 6, provided: 5)0010
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-http-client-appengine-dependencies.html b/google-api-client-assembly/dependencies/google-http-client-appengine-dependencies.html deleted file mode 100644 index 6a345073..00000000 --- a/google-api-client-assembly/dependencies/google-http-client-appengine-dependencies.html +++ /dev/null @@ -1,590 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.appengineappengine-api-stubs1.7.7jarGoogle App Engine Terms of Service
com.google.appengineappengine-testing1.7.7jarGoogle App Engine Terms of Service
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-test1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.appengineappengine-api-1.0-sdk1.7.7jarGoogle App Engine Terms of Service
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Google App Engine Terms of Service: appengine-api-1.0-sdk, appengine-api-stubs, appengine-testing

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, FindBugs-jsr305, Google App Engine extensions to the Google HTTP Client Library for Java., Google HTTP Client Library for Java, Guava: Google Core Libraries for Java, Shared classes used for testing of artifacts in the Google HTTP Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
appengine-api-1.0-sdk-1.7.7.jar30.66 MB6,5666,044861.6debug
appengine-api-stubs-1.7.7.jar12.16 MB3,0982,7851671.6debug
appengine-testing-1.7.7.jar10.32 MB2,2932,265261.6debug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-test-1.20.0-SNAPSHOT.jar51.53 kB594921.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
TotalSizeEntriesClassesPackagesJDK RevDebug
1256.13 MB14,69913,4803861.612
compile: 6compile: 1.01 MBcompile: 1,020compile: 735compile: 62-compile: 6
test: 5test: 24.46 MBtest: 7,113test: 6,701test: 238-test: 5
provided: 1provided: 30.66 MBprovided: 6,566provided: 6,044provided: 86-provided: 1
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.google.appengine:appengine-api-1.0-sdk:jar:1.7.7--Found at http://repo.maven.apache.org/maven2
com.google.appengine:appengine-api-stubs:jar:1.7.7--Found at http://repo.maven.apache.org/maven2
com.google.appengine:appengine-testing:jar:1.7.7--Found at http://repo.maven.apache.org/maven2
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-test:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.6--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
12 (compile: 6, test: 5, provided: 1)0010
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-http-client-dependencies.html b/google-api-client-assembly/dependencies/google-http-client-dependencies.html deleted file mode 100644 index 1d3f001d..00000000 --- a/google-api-client-assembly/dependencies/google-http-client-dependencies.html +++ /dev/null @@ -1,604 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
junitjunit4.8.2jarCommon Public License Version 1.0
org.mockitomockito-all1.9.0jarThe MIT License
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.androidandroid1.5_r4jarApache 2.0
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
org.khronosopengl-apigl1.1-android-2.1_r1jarApache 2.0
xercesxmlParserAPIs2.6.2jar-
xpp3xpp31.1.4cjarIndiana University Extreme! Lab Software License, vesion 1.1.1-Public Domain-Apache Software License, version 1.1
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache Software License, version 1.1: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-

Public Domain: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-

Unknown: xmlParserAPIs

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

Apache 2.0: Google Android Java ME Library (Khronos), Google Android Library

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, FindBugs-jsr305, Google HTTP Client Library for Java, Guava: Google Core Libraries for Java

-

The MIT License: Mockito

-

Indiana University Extreme! Lab Software License, vesion 1.1.1: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
android-1.5_r4.jar2.04 MB1,894965411.5debug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
opengl-api-gl1.1-android-2.1_r1.jar18.06 kB251321.5debug
mockito-all-1.9.0.jar1.43 MB1,279654661.5debug
xmlParserAPIs-2.6.2.jar121.80 kB238207171.1release
xpp3-1.1.4c.jar117.25 kB7856131.1debug
TotalSizeEntriesClassesPackagesJDK RevDebug
126.40 MB5,9564,0242251.511
compile: 4compile: 544.56 kBcompile: 561compile: 451compile: 37-compile: 4
test: 2test: 1.65 MBtest: 1,546test: 884test: 96-test: 2
provided: 6provided: 4.22 MBprovided: 3,849provided: 2,689provided: 92-provided: 5
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.google.android:android:jar:1.5_r4--Found at http://repo.maven.apache.org/maven2
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
commons-codec:commons-codec:jar:1.6--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.khronos:opengl-api:jar:gl1.1-android-2.1_r1--Found at http://repo.maven.apache.org/maven2
org.mockito:mockito-all:jar:1.9.0--Found at http://repo.maven.apache.org/maven2
xerces:xmlParserAPIs:jar:2.6.2--Found at http://repo.maven.apache.org/maven2
xpp3:xpp3:jar:1.1.4c--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
12 (compile: 4, test: 2, provided: 6)0012
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-http-client-gson-dependencies.html b/google-api-client-assembly/dependencies/google-http-client-gson-dependencies.html deleted file mode 100644 index fc422077..00000000 --- a/google-api-client-assembly/dependencies/google-http-client-gson-dependencies.html +++ /dev/null @@ -1,515 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.gsongson2.1jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-test1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, FindBugs-jsr305, GSON extensions to the Google HTTP Client Library for Java., Google HTTP Client Library for Java, Gson, Guava: Google Core Libraries for Java, Shared classes used for testing of artifacts in the Google HTTP Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jsr305-1.3.9.jar32.24 kB723531.5debug
gson-2.1.jar175.89 kB15814861.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-test-1.20.0-SNAPSHOT.jar51.53 kB594921.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
TotalSizeEntriesClassesPackagesJDK RevDebug
103.17 MB2,9002,5341131.510
compile: 7compile: 1.18 MBcompile: 1,178compile: 883compile: 68-compile: 7
test: 3test: 1.99 MBtest: 1,722test: 1,651test: 45-test: 3
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.code.gson:gson:jar:2.1--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-test:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.6--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
10 (compile: 7, test: 3)008
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-http-client-jackson-dependencies.html b/google-api-client-assembly/dependencies/google-http-client-jackson-dependencies.html deleted file mode 100644 index c2ba3469..00000000 --- a/google-api-client-assembly/dependencies/google-http-client-jackson-dependencies.html +++ /dev/null @@ -1,515 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
org.codehaus.jacksonjackson-core-asl1.9.11jarThe Apache Software License, Version 2.0
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-test1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, FindBugs-jsr305, Google HTTP Client Library for Java, Guava: Google Core Libraries for Java, Jackson, Jackson extensions to the Google HTTP Client Library for Java., Shared classes used for testing of artifacts in the Google HTTP Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-test-1.20.0-SNAPSHOT.jar51.53 kB594921.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
jackson-core-asl-1.9.11.jar226.69 kB13712181.5debug
TotalSizeEntriesClassesPackagesJDK RevDebug
103.22 MB2,8792,5071151.510
compile: 7compile: 1.23 MBcompile: 1,157compile: 856compile: 70-compile: 7
test: 3test: 1.99 MBtest: 1,722test: 1,651test: 45-test: 3
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-test:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.6--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.codehaus.jackson:jackson-core-asl:jar:1.9.11--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
10 (compile: 7, test: 3)008
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-http-client-jackson2-dependencies.html b/google-api-client-assembly/dependencies/google-http-client-jackson2-dependencies.html deleted file mode 100644 index ab100e55..00000000 --- a/google-api-client-assembly/dependencies/google-http-client-jackson2-dependencies.html +++ /dev/null @@ -1,515 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.fasterxml.jackson.corejackson-core2.1.3jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-test1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, FindBugs-jsr305, Google HTTP Client Library for Java, Guava: Google Core Libraries for Java, Jackson 2 extensions to the Google HTTP Client Library for Java., Jackson-core, Shared classes used for testing of artifacts in the Google HTTP Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jackson-core-2.1.3.jar201.95 kB1108981.5debug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-test-1.20.0-SNAPSHOT.jar51.53 kB594921.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
TotalSizeEntriesClassesPackagesJDK RevDebug
103.19 MB2,8522,4751151.510
compile: 7compile: 1.21 MBcompile: 1,130compile: 824compile: 70-compile: 7
test: 3test: 1.99 MBtest: 1,722test: 1,651test: 45-test: 3
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.fasterxml.jackson.core:jackson-core:jar:2.1.3--Found at http://repo.maven.apache.org/maven2
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-test:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.6--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
10 (compile: 7, test: 3)008
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-http-client-jdo-dependencies.html b/google-api-client-assembly/dependencies/google-http-client-jdo-dependencies.html deleted file mode 100644 index 66772dee..00000000 --- a/google-api-client-assembly/dependencies/google-http-client-jdo-dependencies.html +++ /dev/null @@ -1,682 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
javax.jdojdo2-api2.3-ebjarApache 2
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-test1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
junitjunit4.8.2jarCommon Public License Version 1.0
mysqlmysql-connector-java5.1.18jarThe GNU General Public License, Version 2
org.datanucleusdatanucleus-api-jdo3.2.1jarThe Apache Software License, Version 2.0
org.datanucleusdatanucleus-core3.2.2jarThe Apache Software License, Version 2.0
org.datanucleusdatanucleus-rdbms3.2.1jarThe Apache Software License, Version 2.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
javax.transactiontransaction-api1.1jar-
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache 2: JDO2 API

-

Unknown: transaction-api

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, DataNucleus Core, DataNucleus JDO API plugin, DataNucleus RDBMS, FindBugs-jsr305, Google HTTP Client Library for Java, Guava: Google Core Libraries for Java, JDO extensions to the Google HTTP Client Library for Java., Shared classes used for testing of artifacts in the Google HTTP Client Library for Java.

-

The GNU General Public License, Version 2: MySQL java connector

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-test-1.20.0-SNAPSHOT.jar51.53 kB594921.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
jdo2-api-2.3-eb.jar188.18 kB22618271.5debug
transaction-api-1.1.jar14.72 kB241821.3debug
junit-4.8.2.jar231.78 kB267230301.5debug
mysql-connector-java-5.1.18.jar771.37 kB279245121.6debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
datanucleus-api-jdo-3.2.1.jar329.11 kB18012661.5debug
datanucleus-core-3.2.2.jar1.72 MB943841501.5debug
datanucleus-rdbms-3.2.1.jar1.69 MB768715291.6debug
TotalSizeEntriesClassesPackagesJDK RevDebug
157.68 MB5,1624,5132131.615
compile: 8compile: 1.21 MBcompile: 1,270compile: 935compile: 71-compile: 8
test: 7test: 6.47 MBtest: 3,892test: 3,578test: 142-test: 7
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
DN_M2_Repohttp://www.datanucleus.org/downloads/maven2/Yes-
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotsDN_M2_Repocentral
com.google.code.findbugs:jsr305:jar:1.3.9---Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0---Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT----
com.google.http-client:google-http-client-test:jar:1.20.0-SNAPSHOT----
commons-codec:commons-codec:jar:1.6---Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1---Found at http://repo.maven.apache.org/maven2
javax.jdo:jdo2-api:jar:2.3-eb--Found at http://www.datanucleus.org/downloads/maven2/Found at http://repo.maven.apache.org/maven2
javax.transaction:transaction-api:jar:1.1---Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2---Found at http://repo.maven.apache.org/maven2
mysql:mysql-connector-java:jar:5.1.18---Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1---Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1---Found at http://repo.maven.apache.org/maven2
org.datanucleus:datanucleus-api-jdo:jar:3.2.1---Found at http://repo.maven.apache.org/maven2
org.datanucleus:datanucleus-core:jar:3.2.2---Found at http://repo.maven.apache.org/maven2
org.datanucleus:datanucleus-rdbms:jar:3.2.1---Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotsDN_M2_Repocentral
15 (compile: 8, test: 7)00113
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-http-client-protobuf-dependencies.html b/google-api-client-assembly/dependencies/google-http-client-protobuf-dependencies.html deleted file mode 100644 index 750d64f8..00000000 --- a/google-api-client-assembly/dependencies/google-http-client-protobuf-dependencies.html +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.protobufprotobuf-java2.4.1jarNew BSD license
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache License: HttpClient, HttpCore

-

New BSD license: Protocol Buffer Java API

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, FindBugs-jsr305, Google HTTP Client Library for Java, Protocol Buffer extensions to the Google HTTP Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jsr305-1.3.9.jar32.24 kB723531.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
protobuf-java-2.4.1.jar439.73 kB21420411.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
TotalSizeEntriesClassesPackagesJDK RevDebug
81.67 MB1,5011,169931.58
compile: 7compile: 1.44 MBcompile: 1,234compile: 939compile: 63-compile: 7
test: 1test: 231.78 kBtest: 267test: 230test: 30-test: 1
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.protobuf:protobuf-java:jar:2.4.1--Found at http://repo.maven.apache.org/maven2
commons-codec:commons-codec:jar:1.6--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
8 (compile: 7, test: 1)007
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-http-client-xml-dependencies.html b/google-api-client-assembly/dependencies/google-http-client-xml-dependencies.html deleted file mode 100644 index d821e2ee..00000000 --- a/google-api-client-assembly/dependencies/google-http-client-xml-dependencies.html +++ /dev/null @@ -1,490 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
xpp3xpp31.1.4cjarIndiana University Extreme! Lab Software License, vesion 1.1.1-Public Domain-Apache Software License, version 1.1
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache Software License, version 1.1: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-

Public Domain: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, FindBugs-jsr305, Google HTTP Client Library for Java, Guava: Google Core Libraries for Java, XML extensions to the Google HTTP Client Library for Java.

-

Indiana University Extreme! Lab Software License, vesion 1.1.1: MXP1: Xml Pull Parser 3rd Edition (XPP3)

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
xpp3-1.1.4c.jar117.25 kB7856131.1debug
TotalSizeEntriesClassesPackagesJDK RevDebug
93.06 MB2,7612,3931181.59
compile: 7compile: 1.13 MBcompile: 1,098compile: 791compile: 75-compile: 7
test: 2test: 1.93 MBtest: 1,663test: 1,602test: 43-test: 2
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.6--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
xpp3:xpp3:jar:1.1.4c--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
9 (compile: 7, test: 2)008
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-oauth-client-appengine-dependencies.html b/google-api-client-assembly/dependencies/google-oauth-client-appengine-dependencies.html deleted file mode 100644 index cc861ec6..00000000 --- a/google-api-client-assembly/dependencies/google-oauth-client-appengine-dependencies.html +++ /dev/null @@ -1,773 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.http-clientgoogle-http-client-appengine1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client-servlet1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
javax.servletservlet-api2.5jar-
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.appengineappengine-api-stubs1.7.7jarGoogle App Engine Terms of Service
com.google.appengineappengine-testing1.7.7jarGoogle App Engine Terms of Service
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.appengineappengine-api-1.0-sdk1.7.7jarGoogle App Engine Terms of Service
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jdo1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
javax.jdojdo2-api2.3-ebjarApache 2
javax.transactiontransaction-api1.1jar-
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Google App Engine Terms of Service: appengine-api-1.0-sdk, appengine-api-stubs, appengine-testing

-

Apache 2: JDO2 API

-

Unknown: servlet-api, transaction-api

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, FindBugs-jsr305, Google App Engine extensions to the Google HTTP Client Library for Java., Google App Engine extensions to the Google OAuth Client Library for Java., Google HTTP Client Library for Java, Google OAuth Client Library for Java, Guava: Google Core Libraries for Java, JDO extensions to the Google HTTP Client Library for Java., Servlet and JDO extensions to the Google OAuth Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
appengine-api-1.0-sdk-1.7.7.jar30.66 MB6,5666,044861.6debug
appengine-api-stubs-1.7.7.jar12.16 MB3,0982,7851671.6debug
appengine-testing-1.7.7.jar10.32 MB2,2932,265261.6debug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-appengine-1.20.0-SNAPSHOT.jar15.34 kB211121.5debug
google-http-client-jdo-1.20.0-SNAPSHOT.jar11.08 kB13511.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
google-oauth-client-servlet-1.20.0-SNAPSHOT.jar21.61 kB241141.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
jdo2-api-2.3-eb.jar188.18 kB22618271.5debug
servlet-api-2.5.jar102.65 kB684221.5debug
transaction-api-1.1.jar14.72 kB241821.3debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
TotalSizeEntriesClassesPackagesJDK RevDebug
1856.49 MB15,07313,7474051.618
compile: 12compile: 1.19 MBcompile: 1,235compile: 975compile: 77-compile: 12
test: 4test: 24.41 MBtest: 7,054test: 6,652test: 236-test: 4
provided: 2provided: 30.88 MBprovided: 6,784provided: 6,120provided: 92-provided: 2
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.google.appengine:appengine-api-1.0-sdk:jar:1.7.7--Found at http://repo.maven.apache.org/maven2
com.google.appengine:appengine-api-stubs:jar:1.7.7--Found at http://repo.maven.apache.org/maven2
com.google.appengine:appengine-testing:jar:1.7.7--Found at http://repo.maven.apache.org/maven2
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-appengine:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jdo:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client-servlet:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.6--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
javax.jdo:jdo2-api:jar:2.3-eb--Found at http://repo.maven.apache.org/maven2
javax.servlet:servlet-api:jar:2.5--Found at http://repo.maven.apache.org/maven2
javax.transaction:transaction-api:jar:1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
18 (compile: 12, test: 4, provided: 2)0013
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-oauth-client-dependencies.html b/google-api-client-assembly/dependencies/google-oauth-client-dependencies.html deleted file mode 100644 index fd271434..00000000 --- a/google-api-client-assembly/dependencies/google-oauth-client-dependencies.html +++ /dev/null @@ -1,545 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jackson1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
org.codehaus.jacksonjackson-core-asl1.9.11jarThe Apache Software License, Version 2.0
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, FindBugs-jsr305, Google HTTP Client Library for Java, Google OAuth Client Library for Java, Guava: Google Core Libraries for Java, Jackson, Jackson extensions to the Google HTTP Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-jackson-1.20.0-SNAPSHOT.jar5.90 kB12411.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
jackson-core-asl-1.9.11.jar226.69 kB13712181.5debug
TotalSizeEntriesClassesPackagesJDK RevDebug
103.17 MB2,8322,4621141.510
compile: 5compile: 809.61 kBcompile: 802compile: 659compile: 56-compile: 5
test: 4test: 2.16 MBtest: 1,812test: 1,727test: 52-test: 4
provided: 1provided: 227.32 kBprovided: 218provided: 76provided: 6-provided: 1
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jackson:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.6--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.codehaus.jackson:jackson-core-asl:jar:1.9.11--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
10 (compile: 5, test: 4, provided: 1)008
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-oauth-client-java6-dependencies.html b/google-api-client-assembly/dependencies/google-oauth-client-java6-dependencies.html deleted file mode 100644 index 31e0b7f2..00000000 --- a/google-api-client-assembly/dependencies/google-oauth-client-java6-dependencies.html +++ /dev/null @@ -1,574 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client-jackson1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
junitjunit4.8.2jarCommon Public License Version 1.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
org.codehaus.jacksonjackson-core-asl1.9.11jarThe Apache Software License, Version 2.0
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, FindBugs-jsr305, Google HTTP Client Library for Java, Google OAuth Client Library for Java, Guava: Google Core Libraries for Java, Jackson, Jackson extensions to the Google HTTP Client Library for Java., Java 6 (and higher) extensions to the Google OAuth Client Library for Java.

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-jackson-1.20.0-SNAPSHOT.jar5.90 kB12411.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
junit-4.8.2.jar231.78 kB267230301.5debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
jackson-core-asl-1.9.11.jar226.69 kB13712181.5debug
TotalSizeEntriesClassesPackagesJDK RevDebug
113.23 MB2,8892,5091171.511
compile: 6compile: 869.28 kBcompile: 859compile: 706compile: 59-compile: 6
test: 4test: 2.16 MBtest: 1,812test: 1,727test: 52-test: 4
provided: 1provided: 227.32 kBprovided: 218provided: 76provided: 6-provided: 1
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotscentral
com.google.code.findbugs:jsr305:jar:1.3.9--Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0--Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT---
com.google.http-client:google-http-client-jackson:jar:1.20.0-SNAPSHOT---
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT---
commons-codec:commons-codec:jar:1.6--Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1--Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1--Found at http://repo.maven.apache.org/maven2
org.codehaus.jackson:jackson-core-asl:jar:1.9.11--Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotscentral
11 (compile: 6, test: 4, provided: 1)008
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-oauth-client-jetty-dependencies.html b/google-api-client-assembly/dependencies/google-oauth-client-jetty-dependencies.html deleted file mode 100644 index 0186e687..00000000 --- a/google-api-client-assembly/dependencies/google-oauth-client-jetty-dependencies.html +++ /dev/null @@ -1,601 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.oauth-clientgoogle-oauth-client-java61.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
org.mortbay.jettyjetty6.1.26jarApache Software License - Version 2.0-Eclipse Public License - Version 1.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
org.mortbay.jettyjetty-util6.1.26jarApache Software License - Version 2.0-Eclipse Public License - Version 1.0
org.mortbay.jettyservlet-api2.5-20081211jarApache License Version 2.0
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Eclipse Public License - Version 1.0: Jetty Server, Jetty Utilities

-

Apache License: HttpClient, HttpCore

-

Apache Software License - Version 2.0: Jetty Server, Jetty Utilities

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, FindBugs-jsr305, Google HTTP Client Library for Java, Google OAuth Client Library for Java, Java 6 (and higher) extensions to the Google OAuth Client Library for Java., Jetty extensions to the Google OAuth Client Library for Java.

-

Apache License Version 2.0: Servlet Specification API

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jsr305-1.3.9.jar32.24 kB723531.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
google-oauth-client-java6-1.20.0-SNAPSHOT.jar10.67 kB16611.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
jetty-6.1.26.jar527.26 kB267237141.4debug
jetty-util-6.1.26.jar172.98 kB12010561.4debug
servlet-api-2.5-20081211.jar130.99 kB794221.4debug
TotalSizeEntriesClassesPackagesJDK RevDebug
111.89 MB1,5591,172881.511
compile: 10compile: 1.67 MBcompile: 1,341compile: 1,096compile: 82-compile: 10
provided: 1provided: 227.32 kBprovided: 218provided: 76provided: 6-provided: 1
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
codehaus.orghttp://snapshots.repository.codehaus.org-Yes
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
java.nethttp://download.java.net/maven/2Yes-
m1.java.nethttp://download.java.net/maven/1Yes-
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactcodehaus.orgapache.snapshotssonatype-nexus-snapshotsjava.netm1.java.netcentral
com.google.code.findbugs:jsr305:jar:1.3.9-----Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT------
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT------
com.google.oauth-client:google-oauth-client-java6:jar:1.20.0-SNAPSHOT------
commons-codec:commons-codec:jar:1.6-----Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1-----Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1-----Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1-----Found at http://repo.maven.apache.org/maven2
org.mortbay.jetty:jetty:jar:6.1.26-----Found at http://repo.maven.apache.org/maven2
org.mortbay.jetty:jetty-util:jar:6.1.26-----Found at http://repo.maven.apache.org/maven2
org.mortbay.jetty:servlet-api:jar:2.5-20081211-----Found at http://repo.maven.apache.org/maven2
Totalcodehaus.orgapache.snapshotssonatype-nexus-snapshotsjava.netm1.java.netcentral
11 (compile: 10, provided: 1)000008
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/google-oauth-client-servlet-dependencies.html b/google-api-client-assembly/dependencies/google-oauth-client-servlet-dependencies.html deleted file mode 100644 index 858e11c4..00000000 --- a/google-api-client-assembly/dependencies/google-oauth-client-servlet-dependencies.html +++ /dev/null @@ -1,759 +0,0 @@ - - - - - - Project Dependencies - - - - - - - - - -
- -
-
-
- -
-

Project Dependencies

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.http-clientgoogle-http-client-jdo1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
com.google.oauth-clientgoogle-oauth-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
javax.jdojdo2-api2.3-ebjarApache 2
javax.servletservlet-api2.5jar-
-
-

test

-

The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.guavaguava-jdk513.0jarThe Apache Software License, Version 2.0
junitjunit4.8.2jarCommon Public License Version 1.0
mysqlmysql-connector-java5.1.18jarThe GNU General Public License, Version 2
org.datanucleusdatanucleus-api-jdo3.2.1jarThe Apache Software License, Version 2.0
org.datanucleusdatanucleus-core3.2.2jarThe Apache Software License, Version 2.0
org.datanucleusdatanucleus-rdbms3.2.1jarThe Apache Software License, Version 2.0
-
-

Project Transitive Dependencies

-

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

-
-

compile

-

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
com.google.code.findbugsjsr3051.3.9jarThe Apache Software License, Version 2.0
com.google.http-clientgoogle-http-client1.20.0-SNAPSHOTjarThe Apache Software License, Version 2.0
commons-loggingcommons-logging1.1.1jarThe Apache Software License, Version 2.0
javax.transactiontransaction-api1.1jar-
org.apache.httpcomponentshttpclient4.0.1jar../LICENSE.txt
org.apache.httpcomponentshttpcore4.0.1jarApache License
-
-

provided

-

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

- - - - - - - - - - - - -
GroupIdArtifactIdVersionTypeLicense
commons-codeccommons-codec1.6jarThe Apache Software License, Version 2.0
-
-

Project Dependency Graph

- -
-

Dependency Tree

-
-
-

Licenses

-

Apache 2: JDO2 API

-

Unknown: servlet-api, transaction-api

-

Apache License: HttpClient, HttpCore

-

Common Public License Version 1.0: JUnit

-

The Apache Software License, Version 2.0: Commons Codec, Commons Logging, DataNucleus Core, DataNucleus JDO API plugin, DataNucleus RDBMS, FindBugs-jsr305, Google HTTP Client Library for Java, Google OAuth Client Library for Java, Guava: Google Core Libraries for Java, JDO extensions to the Google HTTP Client Library for Java., Servlet and JDO extensions to the Google OAuth Client Library for Java.

-

The GNU General Public License, Version 2: MySQL java connector

-
-

Dependency File Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilenameSizeEntriesClassesPackagesJDK RevDebug
jsr305-1.3.9.jar32.24 kB723531.5debug
guava-jdk5-13.0.jar1.71 MB1,3961,372131.5debug
google-http-client-1.20.0-SNAPSHOT.jar265.06 kB241208191.5debug
google-http-client-jdo-1.20.0-SNAPSHOT.jar11.08 kB13511.5debug
google-oauth-client-1.20.0-SNAPSHOT.jar59.66 kB574731.5debug
commons-codec-1.6.jar227.32 kB2187661.5debug
commons-logging-1.1.1.jar59.26 kB422821.1debug
jdo2-api-2.3-eb.jar188.18 kB22618271.5debug
servlet-api-2.5.jar102.65 kB684221.5debug
transaction-api-1.1.jar14.72 kB241821.3debug
junit-4.8.2.jar231.78 kB267230301.5debug
mysql-connector-java-5.1.18.jar771.37 kB279245121.6debug
httpclient-4.0.1.jar284.22 kB266230221.5debug
httpcore-4.0.1.jar168.84 kB181158101.3debug
datanucleus-api-jdo-3.2.1.jar329.11 kB18012661.5debug
datanucleus-core-3.2.2.jar1.72 MB943841501.5debug
datanucleus-rdbms-3.2.1.jar1.69 MB768715291.6debug
TotalSizeEntriesClassesPackagesJDK RevDebug
177.80 MB5,2414,5582171.617
compile: 10compile: 1.16 MBcompile: 1,190compile: 953compile: 71-compile: 10
test: 6test: 6.42 MBtest: 3,833test: 3,529test: 140-test: 6
provided: 1provided: 227.32 kBprovided: 218provided: 76provided: 6-provided: 1
-
-

Dependency Repository Locations

- - - - - - - - - - - - - - - - - - - - - - - - - -
Repo IDURLReleaseSnapshot
apache.snapshotshttp://people.apache.org/repo/m2-snapshot-repository-Yes
sonatype-nexus-snapshotshttps://oss.sonatype.org/content/repositories/snapshots-Yes
DN_M2_Repohttp://www.datanucleus.org/downloads/maven2/Yes-
centralhttp://repo.maven.apache.org/maven2Yes-
-

Repository locations for each of the Dependencies.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Artifactapache.snapshotssonatype-nexus-snapshotsDN_M2_Repocentral
com.google.code.findbugs:jsr305:jar:1.3.9---Found at http://repo.maven.apache.org/maven2
com.google.guava:guava-jdk5:jar:13.0---Found at http://repo.maven.apache.org/maven2
com.google.http-client:google-http-client:jar:1.20.0-SNAPSHOT----
com.google.http-client:google-http-client-jdo:jar:1.20.0-SNAPSHOT----
com.google.oauth-client:google-oauth-client:jar:1.20.0-SNAPSHOT----
commons-codec:commons-codec:jar:1.6---Found at http://repo.maven.apache.org/maven2
commons-logging:commons-logging:jar:1.1.1---Found at http://repo.maven.apache.org/maven2
javax.jdo:jdo2-api:jar:2.3-eb--Found at http://www.datanucleus.org/downloads/maven2/Found at http://repo.maven.apache.org/maven2
javax.servlet:servlet-api:jar:2.5---Found at http://repo.maven.apache.org/maven2
javax.transaction:transaction-api:jar:1.1---Found at http://repo.maven.apache.org/maven2
junit:junit:jar:4.8.2---Found at http://repo.maven.apache.org/maven2
mysql:mysql-connector-java:jar:5.1.18---Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpclient:jar:4.0.1---Found at http://repo.maven.apache.org/maven2
org.apache.httpcomponents:httpcore:jar:4.0.1---Found at http://repo.maven.apache.org/maven2
org.datanucleus:datanucleus-api-jdo:jar:3.2.1---Found at http://repo.maven.apache.org/maven2
org.datanucleus:datanucleus-core:jar:3.2.2---Found at http://repo.maven.apache.org/maven2
org.datanucleus:datanucleus-rdbms:jar:3.2.1---Found at http://repo.maven.apache.org/maven2
Totalapache.snapshotssonatype-nexus-snapshotsDN_M2_Repocentral
17 (compile: 10, test: 6, provided: 1)00114
-
-
-
-
-
- - - diff --git a/google-api-client-assembly/dependencies/images/close.gif b/google-api-client-assembly/dependencies/images/close.gif deleted file mode 100644 index 1c26bbc5..00000000 Binary files a/google-api-client-assembly/dependencies/images/close.gif and /dev/null differ diff --git a/google-api-client-assembly/dependencies/images/collapsed.gif b/google-api-client-assembly/dependencies/images/collapsed.gif deleted file mode 100644 index 6e710840..00000000 Binary files a/google-api-client-assembly/dependencies/images/collapsed.gif and /dev/null differ diff --git a/google-api-client-assembly/dependencies/images/expanded.gif b/google-api-client-assembly/dependencies/images/expanded.gif deleted file mode 100644 index 0fef3d89..00000000 Binary files a/google-api-client-assembly/dependencies/images/expanded.gif and /dev/null differ diff --git a/google-api-client-assembly/dependencies/images/external.png b/google-api-client-assembly/dependencies/images/external.png deleted file mode 100644 index 3f999fc8..00000000 Binary files a/google-api-client-assembly/dependencies/images/external.png and /dev/null differ diff --git a/google-api-client-assembly/dependencies/images/icon_error_sml.gif b/google-api-client-assembly/dependencies/images/icon_error_sml.gif deleted file mode 100644 index 61132ef2..00000000 Binary files a/google-api-client-assembly/dependencies/images/icon_error_sml.gif and /dev/null differ diff --git a/google-api-client-assembly/dependencies/images/icon_info_sml.gif b/google-api-client-assembly/dependencies/images/icon_info_sml.gif deleted file mode 100644 index c6cb9ad7..00000000 Binary files a/google-api-client-assembly/dependencies/images/icon_info_sml.gif and /dev/null differ diff --git a/google-api-client-assembly/dependencies/images/icon_success_sml.gif b/google-api-client-assembly/dependencies/images/icon_success_sml.gif deleted file mode 100644 index 52e85a43..00000000 Binary files a/google-api-client-assembly/dependencies/images/icon_success_sml.gif and /dev/null differ diff --git a/google-api-client-assembly/dependencies/images/icon_warning_sml.gif b/google-api-client-assembly/dependencies/images/icon_warning_sml.gif deleted file mode 100644 index 873bbb52..00000000 Binary files a/google-api-client-assembly/dependencies/images/icon_warning_sml.gif and /dev/null differ diff --git a/google-api-client-assembly/dependencies/images/logos/build-by-maven-black.png b/google-api-client-assembly/dependencies/images/logos/build-by-maven-black.png deleted file mode 100644 index 919fd0f6..00000000 Binary files a/google-api-client-assembly/dependencies/images/logos/build-by-maven-black.png and /dev/null differ diff --git a/google-api-client-assembly/dependencies/images/logos/build-by-maven-white.png b/google-api-client-assembly/dependencies/images/logos/build-by-maven-white.png deleted file mode 100644 index 7d44c9c2..00000000 Binary files a/google-api-client-assembly/dependencies/images/logos/build-by-maven-white.png and /dev/null differ diff --git a/google-api-client-assembly/dependencies/images/logos/maven-feather.png b/google-api-client-assembly/dependencies/images/logos/maven-feather.png deleted file mode 100644 index b5ada836..00000000 Binary files a/google-api-client-assembly/dependencies/images/logos/maven-feather.png and /dev/null differ diff --git a/google-api-client-assembly/dependencies/images/newwindow.png b/google-api-client-assembly/dependencies/images/newwindow.png deleted file mode 100644 index 6287f72b..00000000 Binary files a/google-api-client-assembly/dependencies/images/newwindow.png and /dev/null differ diff --git a/google-api-client-assembly/dependencies/xpp3_LICENSE.txt b/google-api-client-assembly/dependencies/xpp3_LICENSE.txt deleted file mode 100644 index d84c14b3..00000000 --- a/google-api-client-assembly/dependencies/xpp3_LICENSE.txt +++ /dev/null @@ -1,46 +0,0 @@ -Indiana University Extreme! Lab Software License - -Version 1.1.1 - -Copyright (c) 2002 Extreme! Lab, Indiana University. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the distribution. - -3. The end-user documentation included with the redistribution, if any, - must include the following acknowledgment: - - "This product includes software developed by the Indiana University - Extreme! Lab (http://www.extreme.indiana.edu/)." - -Alternately, this acknowledgment may appear in the software itself, -if and wherever such third-party acknowledgments normally appear. - -4. The names "Indiana Univeristy" and "Indiana Univeristy Extreme! Lab" -must not be used to endorse or promote products derived from this -software without prior written permission. For written permission, -please contact http://www.extreme.indiana.edu/. - -5. Products derived from this software may not use "Indiana Univeristy" -name nor may "Indiana Univeristy" appear in their name, without prior -written permission of the Indiana University. - -THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/google-api-client-assembly/pom.xml b/google-api-client-assembly/pom.xml deleted file mode 100644 index 7e0325de..00000000 --- a/google-api-client-assembly/pom.xml +++ /dev/null @@ -1,116 +0,0 @@ - - 4.0.0 - - com.google.api-client - google-api-client-parent - 1.20.0-SNAPSHOT - ../pom.xml - - com.google.api-client - google-api-client-assembly - pom - Assembly for the Google APIs Client Library for Java - - - - com.google.http-client - google-http-client-assembly - pom - - - com.google.oauth-client - google-oauth-client-assembly - pom - - - com.google.api-client - google-api-client - - - com.google.api-client - google-api-client-appengine - - - com.google.api-client - google-api-client-servlet - - - com.google.api-client - google-api-client-android - - - com.google.api-client - google-api-client-gson - - - com.google.api-client - google-api-client-jackson2 - - - com.google.api-client - google-api-client-java6 - - - com.google.api-client - google-api-client-protobuf - - - com.google.api-client - google-api-client-xml - - - - - - - maven-dependency-plugin - - - dependencies - prepare-package - - copy-dependencies - - - false - ${project.build.directory}/libs - android,opengl-api,google-collections,xmlParserAPIs,servlet-api,commons-codec,json,google-play-services - - - - src-dependencies - prepare-package - - copy-dependencies - - - sources - false - ${project.build.directory}/libs-sources - android,opengl-api,google-collections,xmlParserAPIs,servlet-api,commons-codec,json,google-play-services - - - - - - maven-assembly-plugin - - - make-assembly - package - - single - - - - assembly.xml - - google-api-java-client - - - - - - - diff --git a/google-api-client-assembly/proguard-google-api-client.txt b/google-api-client-assembly/proguard-google-api-client.txt deleted file mode 100644 index 68ec92b8..00000000 --- a/google-api-client-assembly/proguard-google-api-client.txt +++ /dev/null @@ -1,23 +0,0 @@ -# ProGuard Configuration file -# -# See http://proguard.sourceforge.net/index.html#manual/usage.html - -# Needed to keep generic types and @Key annotations accessed via reflection - --keepattributes Signature,RuntimeVisibleAnnotations,AnnotationDefault - --keepclassmembers class * { - @com.google.api.client.util.Key ; -} - -# Needed by google-http-client-android when linking against an older platform version - --dontwarn com.google.api.client.extensions.android.** - -# Needed by google-api-client-android when linking against an older platform version - --dontwarn com.google.api.client.googleapis.extensions.android.** - -# Needed by google-play-services when linking against an older platform version - --dontwarn com.google.android.gms.** diff --git a/google-api-client-assembly/readme.html b/google-api-client-assembly/readme.html deleted file mode 100644 index cc4ee4e9..00000000 --- a/google-api-client-assembly/readme.html +++ /dev/null @@ -1,210 +0,0 @@ - -${project.name} ${project.version} - -

${project.name} ${project.version}

- -

Overview

-

- High-level details about this library can be found at http://code.google.com/p/google-api-java-client -

- - -

Dependencies and Licenses

- The license can be found - here. -
Dependent jars can be found in the - libs folder and the corresponding source jars can be found - in the - libs-sources folder. -
-
The dependency structure and licenses for the different libraries can - be found here: - - -

Maven Usage

- For information on how to add these libraries to your Maven project please see - http://code.google.com/p/google-api-java-client/wiki/Setup#Maven. - -

Eclipse

- A .classpath file snippet that can be included in your project's .classpath - has been provided - here. Please only use the classpathentry's you - actually need (see below for details). - -

ProGuard

-

- A ProGuard configuration file proguard-google-api-client.txt - is included for common settings for using the library. On Android projects, - you may want to add a reference to - proguard-google-api-client.txt - in the - project.properties - file under the - proguard.config - property. -

-

- Please read Setup - ProGuard for more details. -

- -

Dependencies for all Platforms

- The following are the jars from the - libs folder needed for applications on all platform: -
    -
  • google-api-client-${project.version}.jar
  • -
  • google-oauth-client-${project.oauth.version}.jar
  • -
  • google-http-client-${project.http.version}.jar
  • -
  • jsr305-${project.jsr305.version}.jar
  • -
  • google-api-client-protobuf-${project.api.version}.jar (when using - protobuf-java) -
      -
    • google-http-client-protobuf-${project.http.version}.jar
    • -
    • protobuf-java-${project.protobuf-java.version}.jar
    • -
    -
  • -
  • google-api-client-gson-${project.api.version}.jar (when using - GSON) -
      -
    • google-http-client-gson-${project.http.version}.jar
    • -
    • gson-${project.gson.version}.jar
    • -
    -
  • -
  • google-api-client-jackson2-${project.api.version}.jar (when using - Jackson 2) -
      -
    • google-http-client-jackson2-${project.http.version}.jar
    • -
    • jackson-core-${project.jackson-core2.version}.jar
    • -
    -
  • -
  • google-http-client-jackson-${project.http.version}.jar (when using - Jackson 1) -
      -
    • jackson-core-asl-${project.jackson-core-asl.version}.jar
    • -
    -
  • -
  • google-api-client-xml-${project.version}.jar (when using XML) -
      -
    • google-http-client-xml-${project.version}.jar
    • -
    • xpp3-${project.xpp3.version}.jar (when NOT on Android)
    • -
    -
  • -
- -

Android Dependencies

- The following are the jars from the - libs folder required for Android applications: -
    -
  • google-api-client-android-${project.version}.jar (for SDK >= 2.1)
  • -
  • google-http-client-android-${project.http.version}.jar
  • -
- The - libs folder also contains properties files that specify the - location of source jars for Android projects in Eclipse. -
Please see the - Android - wiki for the Android Developer's Guide. - -

Google App Engine Dependencies

- The following are the jars from the - libs folder required for Google App Engine applications or - a newer compatible version: -
    -
  • google-api-client-appengine-${project.version}.jar
  • -
  • google-api-client-servlet-${project.version}.jar
  • -
  • google-oauth-client-appengine-${project.oauth.version}.jar
  • -
  • google-oauth-client-servlet-${project.oauth.version}.jar
  • -
  • google-http-client-appengine-${project.http.version}.jar
  • -
  • jdo2-api-${project.jdo2-api.version}.jar
  • -
  • transaction-api-${project.transaction-api.version}.jar
  • -
- Please see the - GoogleAppEngine - wiki for the Google App Engine Developer's Guide. - -

Servlet Dependencies

- The following are the jars from the - libs folder required for Servlet applications or a newer - compatible version: -
    -
  • google-api-client-servlet-${project.version}.jar
  • -
  • google-oauth-client-servlet-${project.oauth.version}.jar
  • -
  • commons-logging-${project.commons-logging.version}.jar
  • -
  • httpclient-${project.httpclient.version}.jar
  • -
  • httpcore-${project.httpcore.version}.jar
  • -
  • jdo2-api-${project.jdo2-api.version}.jar
  • -
  • transaction-api-${project.transaction-api.version}.jar
  • -
- -

General Purpose Java 5 Environment Dependencies

- The following are the jars from the - libs folder required for general purpose Java 5 - applications or a newer compatible version: -
    -
  • google-api-client-java6-${project.version}.jar
  • -
  • google-oauth-client-java6-${project.oauth.version}.jar (for JDK >= - 6) -
      -
    • google-oauth-client-jetty-${project.oauth.version}.jar (for - Jetty 6) -
        -
      • jetty-${project.jetty.version}.jar
      • -
      • jetty-util-${project.jetty.version}.jar
      • -
      -
    • -
    -
  • -
  • google-oauth-client-java7-${project.version}.jar (for JDK >= 7)
  • -
  • commons-logging-${project.commons-logging.version}.jar
  • -
  • httpclient-${project.httpclient.version}.jar
  • -
  • httpcore-${project.httpcore.version}.jar
  • -
- - - diff --git a/google-api-client-gson/.classpath b/google-api-client-gson/.classpath deleted file mode 100644 index 68a2c33f..00000000 --- a/google-api-client-gson/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/google-api-client-gson/.project b/google-api-client-gson/.project deleted file mode 100644 index 3c36793f..00000000 --- a/google-api-client-gson/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - google-api-client-gson - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/google-api-client-gson/.settings/org.eclipse.jdt.core.prefs b/google-api-client-gson/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 56c60d70..00000000 --- a/google-api-client-gson/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,418 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_member=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=24 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter.count_dependent=1040|-1|1040 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16|4|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16|5|48 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants.count_dependent=0|-1|0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_field_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_for_statement=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class=0 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16|4|49 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=0 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=true -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=false -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=100 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph=true -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.force_if_else_statement_brace=true -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comment_prefix=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=100 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=3 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false -org.eclipse.jdt.core.formatter.sort_local_variable_annotations=false -org.eclipse.jdt.core.formatter.sort_member_annotations=false -org.eclipse.jdt.core.formatter.sort_package_annotations=false -org.eclipse.jdt.core.formatter.sort_parameter_annotations=false -org.eclipse.jdt.core.formatter.sort_type_annotations=false -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_comment_inline_tags=false -org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation=false -org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments=false diff --git a/google-api-client-gson/.settings/org.eclipse.jdt.ui.prefs b/google-api-client-gson/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 08ebc976..00000000 --- a/google-api-client-gson/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,119 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=false -cleanup.add_serial_version_id=true -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_parentheses_in_expressions=true -cleanup.use_this_for_non_static_field_access=true -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=true -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup_profile=_google-api-java-client -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_google-api-java-client 100 -formatter_settings_version=12 -org.eclipse.jdt.ui.exception.name=exception -org.eclipse.jdt.ui.gettersetter.use.is=false -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=com.google;;java;javax; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=999 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=999 -org.eclipse.jdt.ui.text.custom_code_templates= -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=false -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=false -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/google-api-client-gson/pom.xml b/google-api-client-gson/pom.xml deleted file mode 100644 index de437c10..00000000 --- a/google-api-client-gson/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - 4.0.0 - - com.google.api-client - google-api-client-parent - 1.20.0-SNAPSHOT - ../pom.xml - - google-api-client-gson - GSON extensions to the Google APIs Client Library for Java - - - - maven-javadoc-plugin - - - http://download.oracle.com/javase/1.5.0/docs/api/ - http://javadoc.google-http-java-client.googlecode.com/hg/${project.http.version} - - ${project.name} ${project.version} - ${project.artifactId} ${project.version} - - - - maven-jar-plugin - - - - true - - - - - - jar - compile - - jar - - - - - - maven-source-plugin - - - source-jar - compile - - jar - - - - - - - - - com.google.api-client - google-api-client - - - com.google.http-client - google-http-client-gson - - - diff --git a/google-api-client-gson/src/main/java/com/google/api/client/googleapis/notifications/json/gson/GsonNotificationCallback.java b/google-api-client-gson/src/main/java/com/google/api/client/googleapis/notifications/json/gson/GsonNotificationCallback.java deleted file mode 100644 index 7df0ed25..00000000 --- a/google-api-client-gson/src/main/java/com/google/api/client/googleapis/notifications/json/gson/GsonNotificationCallback.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.notifications.json.gson; - -import com.google.api.client.googleapis.notifications.TypedNotificationCallback; -import com.google.api.client.googleapis.notifications.json.JsonNotificationCallback; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.gson.GsonFactory; -import com.google.api.client.util.Beta; - -/** - * {@link Beta}
- * A {@link TypedNotificationCallback} which uses an JSON content encoding with - * {@link GsonFactory#getDefaultInstance()}. - * - *

- * Must NOT be implemented in form of an anonymous class as this will break serialization. - *

- * - *

- * Implementation should be thread-safe. - *

- * - * Example usage: - * - *
-  static class MyNotificationCallback
-      extends GsonNotificationCallback{@literal <}ListResponse{@literal >} {
-
-    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 Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
-      return ListResponse.class;
-    }
-  }
- * 
- * - * @param Type of the data contained within a notification - * @author Yaniv Inbar - * @since 1.16 - */ -@Beta -public abstract class GsonNotificationCallback extends JsonNotificationCallback { - - private static final long serialVersionUID = 1L; - - @Override - protected JsonFactory getJsonFactory() { - return GsonFactory.getDefaultInstance(); - } -} diff --git a/google-api-client-gson/src/main/java/com/google/api/client/googleapis/notifications/json/gson/package-info.java b/google-api-client-gson/src/main/java/com/google/api/client/googleapis/notifications/json/gson/package-info.java deleted file mode 100644 index 7587ca56..00000000 --- a/google-api-client-gson/src/main/java/com/google/api/client/googleapis/notifications/json/gson/package-info.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Notification channel handling based on the GSON JSON library. - * - * @author Yaniv Inbar - * @since 1.16 - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.notifications.json.gson; - diff --git a/google-api-client-jackson2/.classpath b/google-api-client-jackson2/.classpath deleted file mode 100644 index 68a2c33f..00000000 --- a/google-api-client-jackson2/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/google-api-client-jackson2/.project b/google-api-client-jackson2/.project deleted file mode 100644 index 09c18e90..00000000 --- a/google-api-client-jackson2/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - google-api-client-jackson2 - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/google-api-client-jackson2/.settings/org.eclipse.jdt.core.prefs b/google-api-client-jackson2/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 56c60d70..00000000 --- a/google-api-client-jackson2/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,418 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_member=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=24 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter.count_dependent=1040|-1|1040 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16|4|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16|5|48 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants.count_dependent=0|-1|0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_field_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_for_statement=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class=0 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16|4|49 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=0 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=true -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=false -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=100 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph=true -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.force_if_else_statement_brace=true -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comment_prefix=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=100 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=3 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false -org.eclipse.jdt.core.formatter.sort_local_variable_annotations=false -org.eclipse.jdt.core.formatter.sort_member_annotations=false -org.eclipse.jdt.core.formatter.sort_package_annotations=false -org.eclipse.jdt.core.formatter.sort_parameter_annotations=false -org.eclipse.jdt.core.formatter.sort_type_annotations=false -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_comment_inline_tags=false -org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation=false -org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments=false diff --git a/google-api-client-jackson2/.settings/org.eclipse.jdt.ui.prefs b/google-api-client-jackson2/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 08ebc976..00000000 --- a/google-api-client-jackson2/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,119 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=false -cleanup.add_serial_version_id=true -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_parentheses_in_expressions=true -cleanup.use_this_for_non_static_field_access=true -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=true -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup_profile=_google-api-java-client -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_google-api-java-client 100 -formatter_settings_version=12 -org.eclipse.jdt.ui.exception.name=exception -org.eclipse.jdt.ui.gettersetter.use.is=false -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=com.google;;java;javax; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=999 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=999 -org.eclipse.jdt.ui.text.custom_code_templates= -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=false -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=false -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/google-api-client-jackson2/pom.xml b/google-api-client-jackson2/pom.xml deleted file mode 100644 index f87122ff..00000000 --- a/google-api-client-jackson2/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - 4.0.0 - - com.google.api-client - google-api-client-parent - 1.20.0-SNAPSHOT - ../pom.xml - - google-api-client-jackson2 - Jackson 2 extensions to the Google APIs Client Library for Java - - - - maven-javadoc-plugin - - - http://download.oracle.com/javase/1.5.0/docs/api/ - http://javadoc.google-http-java-client.googlecode.com/hg/${project.http.version} - - ${project.name} ${project.version} - ${project.artifactId} ${project.version} - - - - maven-jar-plugin - - - - true - - - - - - jar - compile - - jar - - - - - - maven-source-plugin - - - source-jar - compile - - jar - - - - - - - - - com.google.api-client - google-api-client - - - com.google.http-client - google-http-client-jackson2 - - - diff --git a/google-api-client-jackson2/src/main/java/com/google/api/client/googleapis/notifications/json/jackson2/JacksonNotificationCallback.java b/google-api-client-jackson2/src/main/java/com/google/api/client/googleapis/notifications/json/jackson2/JacksonNotificationCallback.java deleted file mode 100644 index 564df173..00000000 --- a/google-api-client-jackson2/src/main/java/com/google/api/client/googleapis/notifications/json/jackson2/JacksonNotificationCallback.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.notifications.json.jackson2; - -import com.google.api.client.googleapis.notifications.TypedNotificationCallback; -import com.google.api.client.googleapis.notifications.json.JsonNotificationCallback; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.util.Beta; - -/** - * {@link Beta}
- * A {@link TypedNotificationCallback} which uses an JSON content encoding with - * {@link JacksonFactory#getDefaultInstance()}. - * - *

- * Must NOT be implemented in form of an anonymous class as this will break serialization. - *

- * - *

- * Implementation should be thread-safe. - *

- * - * Example usage: - * - *
-  static class MyNotificationCallback
-      extends GsonNotificationCallback{@literal <}ListResponse{@literal >} {
-
-    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 Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
-      return ListResponse.class;
-    }
-  }
- * 
- * - * @param Type of the data contained within a notification - * @author Yaniv Inbar - * @since 1.16 - */ -@Beta -public abstract class JacksonNotificationCallback extends JsonNotificationCallback { - - private static final long serialVersionUID = 1L; - - @Override - protected JsonFactory getJsonFactory() { - return JacksonFactory.getDefaultInstance(); - } -} diff --git a/google-api-client-jackson2/src/main/java/com/google/api/client/googleapis/notifications/json/jackson2/package-info.java b/google-api-client-jackson2/src/main/java/com/google/api/client/googleapis/notifications/json/jackson2/package-info.java deleted file mode 100644 index 866f26b9..00000000 --- a/google-api-client-jackson2/src/main/java/com/google/api/client/googleapis/notifications/json/jackson2/package-info.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Notification channel handling based on the Jackson 2 JSON library. - * - * @author Yaniv Inbar - * @since 1.16 - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.notifications.json.jackson2; - diff --git a/google-api-client-java6/.classpath b/google-api-client-java6/.classpath deleted file mode 100644 index 68a2c33f..00000000 --- a/google-api-client-java6/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/google-api-client-java6/.project b/google-api-client-java6/.project deleted file mode 100644 index 910f35b5..00000000 --- a/google-api-client-java6/.project +++ /dev/null @@ -1,17 +0,0 @@ - - google-api-client-java6 - - - - - - org.eclipse.m2e.core.maven2Builder - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.jdt.core.javanature - - diff --git a/google-api-client-java6/.settings/org.eclipse.jdt.core.prefs b/google-api-client-java6/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 2bb99ad7..00000000 --- a/google-api-client-java6/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,380 +0,0 @@ -#Thu Nov 17 08:38:45 EST 2011 -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_member=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=24 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16|4|80 -org.eclipse.jdt.core.formatter.alignment_for_assignment=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16|5|48 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_field_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_for_statement=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class=0 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16|4|49 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16|4|48 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=0 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=true -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=false -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=100 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph=true -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.force_if_else_statement_brace=true -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=100 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=3 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false -org.eclipse.jdt.core.formatter.sort_local_variable_annotations=false -org.eclipse.jdt.core.formatter.sort_member_annotations=false -org.eclipse.jdt.core.formatter.sort_package_annotations=false -org.eclipse.jdt.core.formatter.sort_parameter_annotations=false -org.eclipse.jdt.core.formatter.sort_type_annotations=false -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_comment_inline_tags=false -org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation=false -org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments=false diff --git a/google-api-client-java6/.settings/org.eclipse.jdt.ui.prefs b/google-api-client-java6/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index fea3eb89..00000000 --- a/google-api-client-java6/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,119 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=true -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_parentheses_in_expressions=true -cleanup.use_this_for_non_static_field_access=true -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=true -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup_profile=_google-api-java-client -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_google-api-java-client 100 -formatter_settings_version=12 -org.eclipse.jdt.ui.exception.name=exception -org.eclipse.jdt.ui.gettersetter.use.is=false -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=com.google;;java;javax; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=999 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=999 -org.eclipse.jdt.ui.text.custom_code_templates= -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=true -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=false -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/google-api-client-java6/pom.xml b/google-api-client-java6/pom.xml deleted file mode 100644 index 20ddccad..00000000 --- a/google-api-client-java6/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - 4.0.0 - - com.google.api-client - google-api-client-parent - 1.20.0-SNAPSHOT - ../pom.xml - - google-api-client-java6 - Java 6 (and higher) Extensions to the Google API Client Library for Java. - - - - maven-javadoc-plugin - - - http://download.oracle.com/javase/6/docs/api/ - http://javadoc.google-http-java-client.googlecode.com/hg/${project.http.version} - - ${project.name} ${project.version} - ${project.artifactId} ${project.version} - - - - maven-jar-plugin - - - - true - - - - - - jar - compile - - jar - - - - - - maven-source-plugin - - - source-jar - compile - - jar - - - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - org.codehaus.mojo.signature - java16 - 1.0 - - - - - - - - com.google.api-client - google-api-client - - - com.google.oauth-client - google-oauth-client-java6 - - - junit - junit - test - - - diff --git a/google-api-client-java6/src/main/java/com/google/api/client/googleapis/extensions/java6/auth/oauth2/GooglePromptReceiver.java b/google-api-client-java6/src/main/java/com/google/api/client/googleapis/extensions/java6/auth/oauth2/GooglePromptReceiver.java deleted file mode 100644 index b21785ad..00000000 --- a/google-api-client-java6/src/main/java/com/google/api/client/googleapis/extensions/java6/auth/oauth2/GooglePromptReceiver.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.java6.auth.oauth2; - -import com.google.api.client.extensions.java6.auth.oauth2.AbstractPromptReceiver; -import com.google.api.client.googleapis.auth.oauth2.GoogleOAuthConstants; - -import java.io.IOException; - -/** - * Google OAuth 2.0 abstract verification code receiver that prompts user to paste the code copied - * from the browser. - * - *

- * Implementation is thread-safe. - *

- * - * @since 1.11 - * @author Yaniv Inbar - */ -public class GooglePromptReceiver extends AbstractPromptReceiver { - - @Override - public String getRedirectUri() throws IOException { - return GoogleOAuthConstants.OOB_REDIRECT_URI; - } -} diff --git a/google-api-client-java6/src/main/java/com/google/api/client/googleapis/extensions/java6/auth/oauth2/package-info.java b/google-api-client-java6/src/main/java/com/google/api/client/googleapis/extensions/java6/auth/oauth2/package-info.java deleted file mode 100644 index 8a57bb90..00000000 --- a/google-api-client-java6/src/main/java/com/google/api/client/googleapis/extensions/java6/auth/oauth2/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Google OAuth 2.0 utilities that help simplify the authorization flow on Java 6. - * - * @since 1.11 - * @author Yaniv Inbar - */ -package com.google.api.client.googleapis.extensions.java6.auth.oauth2; - diff --git a/google-api-client-protobuf/.classpath b/google-api-client-protobuf/.classpath deleted file mode 100644 index 47154502..00000000 --- a/google-api-client-protobuf/.classpath +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/google-api-client-protobuf/.project b/google-api-client-protobuf/.project deleted file mode 100644 index 311c9440..00000000 --- a/google-api-client-protobuf/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - google-api-client-protobuf - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/google-api-client-protobuf/.settings/org.eclipse.jdt.core.prefs b/google-api-client-protobuf/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 56c60d70..00000000 --- a/google-api-client-protobuf/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,418 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_member=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=24 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter.count_dependent=1040|-1|1040 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16|4|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16|5|48 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants.count_dependent=0|-1|0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_field_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_for_statement=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class=0 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16|4|49 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=0 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=true -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=false -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=100 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph=true -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.force_if_else_statement_brace=true -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comment_prefix=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=100 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=3 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false -org.eclipse.jdt.core.formatter.sort_local_variable_annotations=false -org.eclipse.jdt.core.formatter.sort_member_annotations=false -org.eclipse.jdt.core.formatter.sort_package_annotations=false -org.eclipse.jdt.core.formatter.sort_parameter_annotations=false -org.eclipse.jdt.core.formatter.sort_type_annotations=false -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_comment_inline_tags=false -org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation=false -org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments=false diff --git a/google-api-client-protobuf/.settings/org.eclipse.jdt.ui.prefs b/google-api-client-protobuf/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 08ebc976..00000000 --- a/google-api-client-protobuf/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,119 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=false -cleanup.add_serial_version_id=true -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_parentheses_in_expressions=true -cleanup.use_this_for_non_static_field_access=true -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=true -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup_profile=_google-api-java-client -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_google-api-java-client 100 -formatter_settings_version=12 -org.eclipse.jdt.ui.exception.name=exception -org.eclipse.jdt.ui.gettersetter.use.is=false -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=com.google;;java;javax; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=999 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=999 -org.eclipse.jdt.ui.text.custom_code_templates= -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=false -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=false -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/google-api-client-protobuf/pom.xml b/google-api-client-protobuf/pom.xml deleted file mode 100644 index 3e0fcbd4..00000000 --- a/google-api-client-protobuf/pom.xml +++ /dev/null @@ -1,161 +0,0 @@ - - 4.0.0 - - com.google.api-client - google-api-client-parent - 1.20.0-SNAPSHOT - ../pom.xml - - google-api-client-protobuf - Protocol Buffer extensions to the Google APIs Client Library for Java - - - - maven-javadoc-plugin - - - http://download.oracle.com/javase/1.5.0/docs/api/ - http://javadoc.google-http-java-client.googlecode.com/hg/${project.http.version} - - ${project.name} ${project.version} - ${project.artifactId} ${project.version} - - - - maven-jar-plugin - - - - true - - - - - - jar - compile - - jar - - - - - - maven-source-plugin - - - source-jar - compile - - jar - - - - - - maven-antrun-plugin - - - generate-sources - generate-sources - - - - - - - - - - - run - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.5 - - - add-test-source - generate-test-sources - - add-test-source - - - - target/generated-test-sources - - - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.apache.maven.plugins - - - maven-antrun-plugin - - [1.6,) - - run - - - - - - - - - org.codehaus.mojo - - build-helper-maven-plugin - - [1.5,) - - add-test-source - - - - - - - - - - - - - - - - com.google.http-client - google-http-client-protobuf - - - com.google.api-client - google-api-client - - - junit - junit - test - - - diff --git a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/AbstractGoogleProtoClient.java b/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/AbstractGoogleProtoClient.java deleted file mode 100644 index 04fc6c07..00000000 --- a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/AbstractGoogleProtoClient.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services.protobuf; - -import com.google.api.client.googleapis.services.AbstractGoogleClient; -import com.google.api.client.googleapis.services.GoogleClientRequestInitializer; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.protobuf.ProtoObjectParser; -import com.google.api.client.util.Beta; - -/** - * {@link Beta}
- * Thread-safe Google protocol buffer client. - * - * @since 1.16 - * @author Yaniv Inbar - */ -@Beta -public abstract class AbstractGoogleProtoClient extends AbstractGoogleClient { - - /** - * @param builder builder - */ - protected AbstractGoogleProtoClient(Builder builder) { - super(builder); - } - - @Override - public ProtoObjectParser getObjectParser() { - return (ProtoObjectParser) super.getObjectParser(); - } - - /** - * {@link Beta}
- * Builder for {@link AbstractGoogleProtoClient}. - * - *

- * Implementation is not thread-safe. - *

- * @since 1.16 - */ - @Beta - public abstract static class Builder extends AbstractGoogleClient.Builder { - - /** - * @param transport HTTP transport - * @param rootUrl root URL of the service - * @param servicePath service path - * @param httpRequestInitializer HTTP request initializer or {@code null} for none - */ - protected Builder(HttpTransport transport, String rootUrl, String servicePath, - HttpRequestInitializer httpRequestInitializer) { - super(transport, rootUrl, servicePath, new ProtoObjectParser(), httpRequestInitializer); - } - - @Override - public final ProtoObjectParser getObjectParser() { - return (ProtoObjectParser) super.getObjectParser(); - } - - @Override - public abstract AbstractGoogleProtoClient build(); - - @Override - public Builder setRootUrl(String rootUrl) { - return (Builder) super.setRootUrl(rootUrl); - } - - @Override - public Builder setServicePath(String servicePath) { - return (Builder) super.setServicePath(servicePath); - } - - @Override - public Builder setGoogleClientRequestInitializer( - GoogleClientRequestInitializer googleClientRequestInitializer) { - return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer); - } - - @Override - public Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer) { - return (Builder) super.setHttpRequestInitializer(httpRequestInitializer); - } - - @Override - public Builder setApplicationName(String applicationName) { - return (Builder) super.setApplicationName(applicationName); - } - - @Override - public Builder setSuppressPatternChecks(boolean suppressPatternChecks) { - return (Builder) super.setSuppressPatternChecks(suppressPatternChecks); - } - - @Override - public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) { - return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks); - } - - @Override - public Builder setSuppressAllChecks(boolean suppressAllChecks) { - return (Builder) super.setSuppressAllChecks(suppressAllChecks); - } - } -} diff --git a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/AbstractGoogleProtoClientRequest.java b/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/AbstractGoogleProtoClientRequest.java deleted file mode 100644 index 943457d9..00000000 --- a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/AbstractGoogleProtoClientRequest.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services.protobuf; - -import com.google.api.client.googleapis.batch.BatchCallback; -import com.google.api.client.googleapis.batch.BatchRequest; -import com.google.api.client.googleapis.services.AbstractGoogleClientRequest; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.UriTemplate; -import com.google.api.client.http.protobuf.ProtoHttpContent; -import com.google.api.client.util.Beta; -import com.google.protobuf.MessageLite; - -import java.io.IOException; - -/** - * {@link Beta}
- * Google protocol buffer request for a {@link AbstractGoogleProtoClient}. - * - *

- * Implementation is not thread-safe. - *

- * - * @param type of the response - * @since 1.16 - * @author Yaniv Inbar - */ -@Beta -public abstract class AbstractGoogleProtoClientRequest extends AbstractGoogleClientRequest { - - /** Message to serialize or {@code null} for none. */ - private final MessageLite message; - - /** - * @param abstractGoogleProtoClient Google protocol buffer client - * @param requestMethod HTTP Method - * @param uriTemplate URI template for the path relative to the base URL. If it starts with a "/" - * the base path from the base URL will be stripped out. The URI template can also be a - * full URL. URI template expansion is done using - * {@link UriTemplate#expand(String, String, Object, boolean)} - * @param message message to serialize or {@code null} for none - * @param responseClass response class to parse into - */ - protected AbstractGoogleProtoClientRequest(AbstractGoogleProtoClient abstractGoogleProtoClient, - String requestMethod, String uriTemplate, MessageLite message, Class responseClass) { - super(abstractGoogleProtoClient, requestMethod, uriTemplate, message == null - ? null : new ProtoHttpContent(message), responseClass); - this.message = message; - } - - @Override - public AbstractGoogleProtoClient getAbstractGoogleClient() { - return (AbstractGoogleProtoClient) super.getAbstractGoogleClient(); - } - - @Override - public AbstractGoogleProtoClientRequest setDisableGZipContent(boolean disableGZipContent) { - return (AbstractGoogleProtoClientRequest) super.setDisableGZipContent(disableGZipContent); - } - - @Override - public AbstractGoogleProtoClientRequest setRequestHeaders(HttpHeaders headers) { - return (AbstractGoogleProtoClientRequest) super.setRequestHeaders(headers); - } - - /** - * Queues the request into the specified batch request container. - * - *

- * Batched requests are then executed when {@link BatchRequest#execute()} is called. - *

- *

- * Example usage: - *

- * - *
-   *
-    request.queue(batchRequest, new BatchCallback{@literal <}SomeResponseType, Void{@literal >}() {
-
-      public void onSuccess(SomeResponseType content, HttpHeaders responseHeaders) {
-        log("Success");
-      }
-
-      public void onFailure(Void unused, HttpHeaders responseHeaders) {
-        log(e.getMessage());
-      }
-    });
-   * 
- * - * - * @param batchRequest batch request container - * @param callback batch callback - */ - public final void queue(BatchRequest batchRequest, BatchCallback callback) - throws IOException { - super.queue(batchRequest, Void.class, callback); - } - - /** Returns the message to serialize or {@code null} for none. */ - public Object getMessage() { - return message; - } - - @Override - public AbstractGoogleProtoClientRequest set(String fieldName, Object value) { - return (AbstractGoogleProtoClientRequest) super.set(fieldName, value); - } -} 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 deleted file mode 100644 index d8a18ccb..00000000 --- a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/CommonGoogleProtoClientRequestInitializer.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services.protobuf; - -import com.google.api.client.googleapis.services.AbstractGoogleClientRequest; -import com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer; -import com.google.api.client.util.Beta; - -import java.io.IOException; - -/** - * {@link Beta}
- * Google protocol buffer client request initializer implementation for setting properties like key - * and userIp. - * - *

- * The simplest usage is to use it to set the key parameter: - *

- * - *
-  public static final GoogleClientRequestInitializer KEY_INITIALIZER =
-      new CommonGoogleProtoClientRequestInitializer(KEY);
- * 
- * - *

- * There is also a constructor to set both the key and userIp parameters: - *

- * - *
-  public static final GoogleClientRequestInitializer INITIALIZER =
-      new CommonGoogleProtoClientRequestInitializer(KEY, USER_IP);
- * 
- * - *

- * If you want to implement custom logic, extend it like this: - *

- * - *
-  public static class MyRequestInitializer extends CommonGoogleProtoClientRequestInitializer {
-
-    {@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: - *

- * - *
-  public static class MyKeyRequestInitializer extends CommonGoogleProtoClientRequestInitializer {
-
-    public MyKeyRequestInitializer() {
-      super(KEY, USER_IP);
-    }
-
-    {@literal @}Override
-    public void initializeProtoRequest(
-        AbstractGoogleProtoClientRequest{@literal <}?{@literal >} request) throws IOException {
-      // custom logic
-    }
-  }
- * 
- * - *

- * Subclasses should be thread-safe. - *

- * - * @since 1.16 - * @author Yaniv Inbar - */ -@Beta -public class CommonGoogleProtoClientRequestInitializer - extends CommonGoogleClientRequestInitializer { - - public CommonGoogleProtoClientRequestInitializer() { - super(); - } - - /** - * @param key API key or {@code null} to leave it unchanged - */ - public CommonGoogleProtoClientRequestInitializer(String key) { - super(key); - } - - /** - * @param key API key or {@code null} to leave it unchanged - * @param userIp user IP or {@code null} to leave it unchanged - */ - public CommonGoogleProtoClientRequestInitializer(String key, String userIp) { - super(key, userIp); - } - - @Override - public final void initialize(AbstractGoogleClientRequest request) throws IOException { - super.initialize(request); - initializeProtoRequest((AbstractGoogleProtoClientRequest) request); - } - - /** - * Initializes a Google protocol buffer client request. - * - *

- * Default implementation does nothing. Called from - * {@link #initialize(AbstractGoogleClientRequest)}. - *

- * - * @throws IOException I/O exception - */ - protected void initializeProtoRequest(AbstractGoogleProtoClientRequest request) - throws IOException { - } -} diff --git a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/package-info.java b/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/package-info.java deleted file mode 100644 index 2ee462c9..00000000 --- a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/services/protobuf/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Contains the basis for the generated service-specific libraries based on the Protobuf format. - * - * @since 1.16 - * @author Yaniv Inbar - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.services.protobuf; - diff --git a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/testing/services/protobuf/MockGoogleProtoClient.java b/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/testing/services/protobuf/MockGoogleProtoClient.java deleted file mode 100644 index a1c63628..00000000 --- a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/testing/services/protobuf/MockGoogleProtoClient.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.testing.services.protobuf; - -import com.google.api.client.googleapis.services.GoogleClientRequestInitializer; -import com.google.api.client.googleapis.services.protobuf.AbstractGoogleProtoClient; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.util.Beta; - -/** - * {@link Beta}
- * Thread-safe mock Google protocol buffer client. - * - * @since 1.16 - * @author Yaniv Inbar - */ -@Beta -public class MockGoogleProtoClient extends AbstractGoogleProtoClient { - - /** - * @param builder builder - */ - protected MockGoogleProtoClient(Builder builder) { - super(builder); - } - - /** - * @param transport HTTP transport - * @param rootUrl root URL of the service - * @param servicePath service path - * @param httpRequestInitializer HTTP request initializer or {@code null} for none - */ - public MockGoogleProtoClient(HttpTransport transport, String rootUrl, String servicePath, - HttpRequestInitializer httpRequestInitializer) { - this(new Builder(transport, rootUrl, servicePath, httpRequestInitializer)); - } - - /** - * {@link Beta}
- * Builder for {@link MockGoogleProtoClient}. - * - *

- * Implementation is not thread-safe. - *

- */ - @Beta - public static class Builder extends AbstractGoogleProtoClient.Builder { - - /** - * @param transport HTTP transport - * @param rootUrl root URL of the service - * @param servicePath service path - * @param httpRequestInitializer HTTP request initializer or {@code null} for none - */ - public Builder(HttpTransport transport, String rootUrl, String servicePath, - HttpRequestInitializer httpRequestInitializer) { - super(transport, rootUrl, servicePath, httpRequestInitializer); - } - - @Override - public MockGoogleProtoClient build() { - return new MockGoogleProtoClient(this); - } - - @Override - public Builder setRootUrl(String rootUrl) { - return (Builder) super.setRootUrl(rootUrl); - } - - @Override - public Builder setServicePath(String servicePath) { - return (Builder) super.setServicePath(servicePath); - } - - @Override - public Builder setGoogleClientRequestInitializer( - GoogleClientRequestInitializer googleClientRequestInitializer) { - return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer); - } - - @Override - public Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer) { - return (Builder) super.setHttpRequestInitializer(httpRequestInitializer); - } - - @Override - public Builder setApplicationName(String applicationName) { - return (Builder) super.setApplicationName(applicationName); - } - - @Override - public Builder setSuppressPatternChecks(boolean suppressPatternChecks) { - return (Builder) super.setSuppressPatternChecks(suppressPatternChecks); - } - - @Override - public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) { - return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks); - } - - @Override - public Builder setSuppressAllChecks(boolean suppressAllChecks) { - return (Builder) super.setSuppressAllChecks(suppressAllChecks); - } - } -} diff --git a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/testing/services/protobuf/MockGoogleProtoClientRequest.java b/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/testing/services/protobuf/MockGoogleProtoClientRequest.java deleted file mode 100644 index fe89918a..00000000 --- a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/testing/services/protobuf/MockGoogleProtoClientRequest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.testing.services.protobuf; - -import com.google.api.client.googleapis.services.protobuf.AbstractGoogleProtoClient; -import com.google.api.client.googleapis.services.protobuf.AbstractGoogleProtoClientRequest; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.UriTemplate; -import com.google.api.client.util.Beta; -import com.google.protobuf.MessageLite; - -/** - * {@link Beta}
- * Thread-safe mock Google protocol buffer request. - * - * @param type of the response - * @since 1.16 - * @author Yaniv Inbar - */ -@Beta -public class MockGoogleProtoClientRequest extends AbstractGoogleProtoClientRequest { - - /** - * @param client Google client - * @param method HTTP Method - * @param uriTemplate URI template for the path relative to the base URL. If it starts with a "/" - * the base path from the base URL will be stripped out. The URI template can also be a - * full URL. URI template expansion is done using - * {@link UriTemplate#expand(String, String, Object, boolean)} - * @param message message to serialize or {@code null} for none - * @param responseClass response class to parse into - */ - public MockGoogleProtoClientRequest(AbstractGoogleProtoClient client, String method, - String uriTemplate, MessageLite message, Class responseClass) { - super(client, method, uriTemplate, message, responseClass); - } - - @Override - public MockGoogleProtoClient getAbstractGoogleClient() { - return (MockGoogleProtoClient) super.getAbstractGoogleClient(); - } - - @Override - public MockGoogleProtoClientRequest setDisableGZipContent(boolean disableGZipContent) { - return (MockGoogleProtoClientRequest) super.setDisableGZipContent(disableGZipContent); - } - - @Override - public MockGoogleProtoClientRequest setRequestHeaders(HttpHeaders headers) { - return (MockGoogleProtoClientRequest) super.setRequestHeaders(headers); - } -} diff --git a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/testing/services/protobuf/package-info.java b/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/testing/services/protobuf/package-info.java deleted file mode 100644 index 619fe213..00000000 --- a/google-api-client-protobuf/src/main/java/com/google/api/client/googleapis/testing/services/protobuf/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Test utilities for the {@code com.google.api.client.googleapis.protobuf} package. - * - * @since 1.16 - * @author Yaniv Inbar - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.testing.services.protobuf; - diff --git a/google-api-client-protobuf/src/test/java/com/google/api/client/googleapis/services/protobuf/CommonGoogleProtoClientRequestInitializerTest.java b/google-api-client-protobuf/src/test/java/com/google/api/client/googleapis/services/protobuf/CommonGoogleProtoClientRequestInitializerTest.java deleted file mode 100644 index 48364377..00000000 --- a/google-api-client-protobuf/src/test/java/com/google/api/client/googleapis/services/protobuf/CommonGoogleProtoClientRequestInitializerTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services.protobuf; - -import com.google.api.client.googleapis.testing.services.protobuf.MockGoogleProtoClient; -import com.google.api.client.testing.http.HttpTesting; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.util.Key; -import com.google.protobuf.MessageLite; - -import junit.framework.TestCase; - -/** - * Tests {@link CommonGoogleProtoClientRequestInitializer}. - * - * @author Yaniv Inbar - */ -public class CommonGoogleProtoClientRequestInitializerTest extends TestCase { - - public static class MyRequest extends AbstractGoogleProtoClientRequest { - @Key - String key; - - protected MyRequest(MockGoogleProtoClient client, String method, String uriTemplate, - MessageLite message, Class responseClass) { - super(client, method, uriTemplate, message, responseClass); - } - } - - public void testInitialize() throws Exception { - CommonGoogleProtoClientRequestInitializer key = - new CommonGoogleProtoClientRequestInitializer("foo"); - MockGoogleProtoClient client = - new MockGoogleProtoClient.Builder(new MockHttpTransport(), HttpTesting.SIMPLE_URL, "test/", - null).setApplicationName("Test Application").build(); - MyRequest request = new MyRequest(client, "GET", "", null, String.class); - assertNull(request.key); - key.initialize(request); - assertEquals("foo", request.key); - } -} diff --git a/google-api-client-protobuf/src/test/java/com/google/api/client/googleapis/services/protobuf/simple_proto.proto b/google-api-client-protobuf/src/test/java/com/google/api/client/googleapis/services/protobuf/simple_proto.proto deleted file mode 100644 index aa4ca98c..00000000 --- a/google-api-client-protobuf/src/test/java/com/google/api/client/googleapis/services/protobuf/simple_proto.proto +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -syntax = "proto2"; -option optimize_for = LITE_RUNTIME; -option java_package = "com.google.api.client.googleapis.services.protobuf"; - -message TestMessage { - required TestStatus status = 1; - required string name = 2; - required int64 value = 3; -} - -enum TestStatus { - SUCCESS = 1; - FAILURE = 2; -} \ No newline at end of file diff --git a/google-api-client-servlet/.classpath b/google-api-client-servlet/.classpath deleted file mode 100644 index 68a2c33f..00000000 --- a/google-api-client-servlet/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/google-api-client-servlet/.project b/google-api-client-servlet/.project deleted file mode 100644 index 26abebf9..00000000 --- a/google-api-client-servlet/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - google-api-client-servlet - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/google-api-client-servlet/.settings/org.eclipse.jdt.core.prefs b/google-api-client-servlet/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 511d2482..00000000 --- a/google-api-client-servlet/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,380 +0,0 @@ -#Thu Nov 17 08:38:45 EST 2011 -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_member=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=24 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16|4|80 -org.eclipse.jdt.core.formatter.alignment_for_assignment=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16|5|48 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_field_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_for_statement=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class=0 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16|4|49 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16|4|48 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=0 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=true -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=false -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=100 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph=true -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.force_if_else_statement_brace=true -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=100 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=3 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false -org.eclipse.jdt.core.formatter.sort_local_variable_annotations=false -org.eclipse.jdt.core.formatter.sort_member_annotations=false -org.eclipse.jdt.core.formatter.sort_package_annotations=false -org.eclipse.jdt.core.formatter.sort_parameter_annotations=false -org.eclipse.jdt.core.formatter.sort_type_annotations=false -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_comment_inline_tags=false -org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation=false -org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments=false diff --git a/google-api-client-servlet/.settings/org.eclipse.jdt.ui.prefs b/google-api-client-servlet/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index f8d746d3..00000000 --- a/google-api-client-servlet/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,118 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_serial_version_id=true -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_parentheses_in_expressions=true -cleanup.use_this_for_non_static_field_access=true -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=true -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup_profile=_google-api-java-client -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_google-api-java-client 100 -formatter_settings_version=12 -org.eclipse.jdt.ui.exception.name=exception -org.eclipse.jdt.ui.gettersetter.use.is=false -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=com.google;;java;javax; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=999 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=999 -org.eclipse.jdt.ui.text.custom_code_templates= -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=false -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=false -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/google-api-client-servlet/pom.xml b/google-api-client-servlet/pom.xml deleted file mode 100644 index c0636396..00000000 --- a/google-api-client-servlet/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - 4.0.0 - - com.google.api-client - google-api-client-parent - 1.20.0-SNAPSHOT - ../pom.xml - - google-api-client-servlet - Servlet and JDO extensions to the Google API Client Library for Java. - - - - maven-javadoc-plugin - - - http://download.oracle.com/javase/1.5.0/docs/api/ - http://javadoc.google-http-java-client.googlecode.com/hg/${project.http.version} - http://javadoc.google-oauth-java-client.googlecode.com/hg/${project.oauth.version} - - ${project.name} ${project.version} - ${project.artifactId} ${project.version} - - - - maven-jar-plugin - - - - true - - - - - - jar - compile - - jar - - - - - - maven-source-plugin - - - source-jar - compile - - jar - - - - - - org.datanucleus - maven-datanucleus-plugin - 2.2.1 - - true - - - - process-classes - - enhance - - - - - - - - - com.google.oauth-client - google-oauth-client-servlet - - - com.google.api-client - google-api-client - - - junit - junit - test - - - javax.servlet - servlet-api - - - javax.jdo - jdo2-api - - - diff --git a/google-api-client-servlet/src/main/java/com/google/api/client/googleapis/extensions/servlet/notifications/NotificationServlet.java b/google-api-client-servlet/src/main/java/com/google/api/client/googleapis/extensions/servlet/notifications/NotificationServlet.java deleted file mode 100644 index 85645d77..00000000 --- a/google-api-client-servlet/src/main/java/com/google/api/client/googleapis/extensions/servlet/notifications/NotificationServlet.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.servlet.notifications; - -import com.google.api.client.googleapis.notifications.StoredChannel; -import com.google.api.client.util.Beta; -import com.google.api.client.util.store.DataStore; -import com.google.api.client.util.store.DataStoreFactory; -import com.google.api.client.util.store.MemoryDataStoreFactory; - -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * {@link Beta}
- * Thread-safe Webhook Servlet to receive notifications. - * - *

- * In order to use this servlet you should create a class inheriting from - * {@link NotificationServlet} and register the servlet in your web.xml. - *

- * - *

- * It is a simple wrapper around {@link WebhookUtils#processWebhookNotification}, so if you you may - * alternatively call that method instead from your {@link HttpServlet#doPost} with no loss of - * functionality. - *

- * - * Example usage: - * - *
-  public class MyNotificationServlet extends NotificationServlet {
-
-    private static final long serialVersionUID = 1L;
-
-    public MyNotificationServlet() throws IOException {
-      super(new SomeDataStoreFactory());
-    }
-  }
- * 
- * - * Sample web.xml setup: - * - *
-  {@literal <}servlet{@literal >}
-      {@literal <}servlet-name{@literal >}MyNotificationServlet{@literal <}/servlet-name{@literal >}
-      {@literal <}servlet-class{@literal >}com.mypackage.MyNotificationServlet{@literal <}/servlet-class{@literal >}
-  {@literal <}/servlet{@literal >}
-  {@literal <}servlet-mapping{@literal >}
-      {@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 - * for a production application. But it is a convenient choice when testing locally, in which case - * you don't need to override it, and can simply reference it directly in your web.xml file. For - * example: - *

- * - *
-  {@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 >}
-  {@literal <}/servlet{@literal >}
-  {@literal <}servlet-mapping{@literal >}
-      {@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 - */ -@Beta -public class NotificationServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - /** Notification channel data store. */ - private final transient DataStore channelDataStore; - - /** - * Constructor to be used for testing and demo purposes that uses - * {@link MemoryDataStoreFactory#getDefaultInstance()} which means it will NOT persist the - * notification channels when the servlet process dies, so it is a bad choice for a production - * application. - */ - public NotificationServlet() throws IOException { - this(MemoryDataStoreFactory.getDefaultInstance()); - } - - /** - * Constructor which uses {@link StoredChannel#getDefaultDataStore(DataStoreFactory)} on the given - * data store factory, which is the normal use case. - * - * @param dataStoreFactory data store factory - */ - protected NotificationServlet(DataStoreFactory dataStoreFactory) throws IOException { - this(StoredChannel.getDefaultDataStore(dataStoreFactory)); - } - - /** - * Constructor that allows a specific notification data store to be specified. - * - * @param channelDataStore notification channel data store - */ - protected NotificationServlet(DataStore channelDataStore) { - this.channelDataStore = channelDataStore; - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - WebhookUtils.processWebhookNotification(req, resp, channelDataStore); - } -} diff --git a/google-api-client-servlet/src/main/java/com/google/api/client/googleapis/extensions/servlet/notifications/WebhookHeaders.java b/google-api-client-servlet/src/main/java/com/google/api/client/googleapis/extensions/servlet/notifications/WebhookHeaders.java deleted file mode 100644 index 66310ac8..00000000 --- a/google-api-client-servlet/src/main/java/com/google/api/client/googleapis/extensions/servlet/notifications/WebhookHeaders.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.servlet.notifications; - -import com.google.api.client.googleapis.notifications.ResourceStates; -import com.google.api.client.util.Beta; - -/** - * {@link Beta}
- * Headers for Webhook notifications. - * - * @author Yaniv Inbar - * @since 1.16 - */ -@Beta -public final class WebhookHeaders { - - /** Name of header for the message number (a monotonically increasing value starting with 1). */ - public static final String MESSAGE_NUMBER = "X-Goog-Message-Number"; - - /** Name of header for the {@link ResourceStates resource state}. */ - public static final String RESOURCE_STATE = "X-Goog-Resource-State"; - - /** - * Name of header for the opaque ID for the watched resource that is stable across API versions. - */ - public static final String RESOURCE_ID = "X-Goog-Resource-ID"; - - /** - * Name of header for the opaque ID (in the form of a canonicalized URI) for the watched resource - * that is sensitive to the API version. - */ - public static final String RESOURCE_URI = "X-Goog-Resource-URI"; - - /** - * Name of header for the notification channel UUID provided by the client in the watch request. - */ - public static final String CHANNEL_ID = "X-Goog-Channel-ID"; - - /** Name of header for the notification channel expiration time. */ - public static final String CHANNEL_EXPIRATION = "X-Goog-Channel-Expiration"; - - /** - * Name of header for the notification channel token (an opaque string) provided by the client in - * the watch request. - */ - public static final String CHANNEL_TOKEN = "X-Goog-Channel-Token"; - - /** Name of header for the type of change performed on the resource. */ - public static final String CHANGED = "X-Goog-Changed"; - - private WebhookHeaders() { - } -} diff --git a/google-api-client-servlet/src/main/java/com/google/api/client/googleapis/extensions/servlet/notifications/WebhookUtils.java b/google-api-client-servlet/src/main/java/com/google/api/client/googleapis/extensions/servlet/notifications/WebhookUtils.java deleted file mode 100644 index 33f25987..00000000 --- a/google-api-client-servlet/src/main/java/com/google/api/client/googleapis/extensions/servlet/notifications/WebhookUtils.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.extensions.servlet.notifications; - -import com.google.api.client.googleapis.notifications.StoredChannel; -import com.google.api.client.googleapis.notifications.UnparsedNotification; -import com.google.api.client.googleapis.notifications.UnparsedNotificationCallback; -import com.google.api.client.util.Beta; -import com.google.api.client.util.LoggingInputStream; -import com.google.api.client.util.Preconditions; -import com.google.api.client.util.StringUtils; -import com.google.api.client.util.store.DataStore; -import com.google.api.client.util.store.DataStoreFactory; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Enumeration; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * {@link Beta}
- * Utilities for Webhook notifications. - * - * @author Yaniv Inbar - * @since 1.16 - */ -@Beta -public final class WebhookUtils { - - static final Logger LOGGER = Logger.getLogger(WebhookUtils.class.getName()); - - /** Webhook notification channel type to use in the watch request. */ - public static final String TYPE = "web_hook"; - - /** - * Utility method to process the webhook notification from {@link HttpServlet#doPost} by finding - * the notification channel in the given data store factory. - * - *

- * It is a wrapper around - * {@link #processWebhookNotification(HttpServletRequest, HttpServletResponse, DataStore)} that - * uses the data store from {@link StoredChannel#getDefaultDataStore(DataStoreFactory)}. - *

- * - * @param req an {@link HttpServletRequest} object that contains the request the client has made - * of the servlet - * @param resp an {@link HttpServletResponse} object that contains the response the servlet sends - * to the client - * @param dataStoreFactory data store factory - * @exception IOException if an input or output error is detected when the servlet handles the - * request - * @exception ServletException if the request for the POST could not be handled - */ - public static void processWebhookNotification( - HttpServletRequest req, HttpServletResponse resp, DataStoreFactory dataStoreFactory) - throws ServletException, IOException { - processWebhookNotification(req, resp, StoredChannel.getDefaultDataStore(dataStoreFactory)); - } - - /** - * Utility method to process the webhook notification from {@link HttpServlet#doPost}. - * - *

- * The {@link HttpServletRequest#getInputStream()} is closed in a finally block inside this - * method. If it is not detected to be a webhook notification, an - * {@link HttpServletResponse#SC_BAD_REQUEST} error will be displayed. If the notification channel - * is found in the given notification channel data store, it will call - * {@link UnparsedNotificationCallback#onNotification} for the registered notification callback - * method. - *

- * - * @param req an {@link HttpServletRequest} object that contains the request the client has made - * of the servlet - * @param resp an {@link HttpServletResponse} object that contains the response the servlet sends - * to the client - * @param channelDataStore notification channel data store - * @exception IOException if an input or output error is detected when the servlet handles the - * request - * @exception ServletException if the request for the POST could not be handled - */ - public static void processWebhookNotification( - HttpServletRequest req, HttpServletResponse resp, DataStore channelDataStore) - throws ServletException, IOException { - Preconditions.checkArgument("POST".equals(req.getMethod())); - InputStream contentStream = req.getInputStream(); - try { - // log headers - if (LOGGER.isLoggable(Level.CONFIG)) { - StringBuilder builder = new StringBuilder(); - Enumeration e = req.getHeaderNames(); - if (e != null) { - while (e.hasMoreElements()) { - Object nameObj = e.nextElement(); - if (nameObj instanceof String) { - String name = (String) nameObj; - Enumeration ev = req.getHeaders(name); - if (ev != null) { - while (ev.hasMoreElements()) { - builder.append(name) - .append(": ").append(ev.nextElement()).append(StringUtils.LINE_SEPARATOR); - } - } - } - } - } - LOGGER.config(builder.toString()); - contentStream = new LoggingInputStream(contentStream, LOGGER, Level.CONFIG, 0x4000); - // TODO(yanivi): allow to override logging content limit - } - // parse the relevant headers, and create a notification - Long messageNumber; - try { - messageNumber = Long.valueOf(req.getHeader(WebhookHeaders.MESSAGE_NUMBER)); - } catch (NumberFormatException e) { - messageNumber = null; - } - String resourceState = req.getHeader(WebhookHeaders.RESOURCE_STATE); - String resourceId = req.getHeader(WebhookHeaders.RESOURCE_ID); - String resourceUri = req.getHeader(WebhookHeaders.RESOURCE_URI); - String channelId = req.getHeader(WebhookHeaders.CHANNEL_ID); - String channelExpiration = req.getHeader(WebhookHeaders.CHANNEL_EXPIRATION); - String channelToken = req.getHeader(WebhookHeaders.CHANNEL_TOKEN); - String changed = req.getHeader(WebhookHeaders.CHANGED); - if (messageNumber == null || resourceState == null || resourceId == null - || resourceUri == null || channelId == null) { - resp.sendError(HttpServletResponse.SC_BAD_REQUEST, - "Notification did not contain all required information."); - return; - } - UnparsedNotification notification = new UnparsedNotification(messageNumber, resourceState, - resourceId, resourceUri, channelId).setChannelExpiration(channelExpiration) - .setChannelToken(channelToken) - .setChanged(changed) - .setContentType(req.getContentType()) - .setContentStream(contentStream); - // check if we know about the channel, hand over the notification to the notification callback - StoredChannel storedChannel = channelDataStore.get(notification.getChannelId()); - if (storedChannel != null) { - storedChannel.getNotificationCallback().onNotification(storedChannel, notification); - } - } finally { - contentStream.close(); - } - } - - private WebhookUtils() { - } -} diff --git a/google-api-client-servlet/src/main/java/com/google/api/client/googleapis/extensions/servlet/notifications/package-info.java b/google-api-client-servlet/src/main/java/com/google/api/client/googleapis/extensions/servlet/notifications/package-info.java deleted file mode 100644 index b67c30c9..00000000 --- a/google-api-client-servlet/src/main/java/com/google/api/client/googleapis/extensions/servlet/notifications/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Support for subscribing to topics and receiving notifications on servlet-based platforms. - * - * @author Yaniv Inbar - * @since 1.16 - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.extensions.servlet.notifications; - diff --git a/google-api-client-xml/.classpath b/google-api-client-xml/.classpath deleted file mode 100644 index 2c81b208..00000000 --- a/google-api-client-xml/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/google-api-client-xml/.project b/google-api-client-xml/.project deleted file mode 100644 index 58c600c2..00000000 --- a/google-api-client-xml/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - google-api-client-xml - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/google-api-client-xml/.settings/org.eclipse.jdt.core.prefs b/google-api-client-xml/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 56c60d70..00000000 --- a/google-api-client-xml/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,418 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_member=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=24 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter.count_dependent=1040|-1|1040 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16|4|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16|5|48 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants.count_dependent=0|-1|0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_field_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_for_statement=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class=0 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16|4|49 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=0 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=true -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=false -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=100 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph=true -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.force_if_else_statement_brace=true -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comment_prefix=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=100 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=3 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false -org.eclipse.jdt.core.formatter.sort_local_variable_annotations=false -org.eclipse.jdt.core.formatter.sort_member_annotations=false -org.eclipse.jdt.core.formatter.sort_package_annotations=false -org.eclipse.jdt.core.formatter.sort_parameter_annotations=false -org.eclipse.jdt.core.formatter.sort_type_annotations=false -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_comment_inline_tags=false -org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation=false -org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments=false diff --git a/google-api-client-xml/.settings/org.eclipse.jdt.ui.prefs b/google-api-client-xml/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 08ebc976..00000000 --- a/google-api-client-xml/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,119 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=false -cleanup.add_serial_version_id=true -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_parentheses_in_expressions=true -cleanup.use_this_for_non_static_field_access=true -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=true -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup_profile=_google-api-java-client -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_google-api-java-client 100 -formatter_settings_version=12 -org.eclipse.jdt.ui.exception.name=exception -org.eclipse.jdt.ui.gettersetter.use.is=false -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=com.google;;java;javax; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=999 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=999 -org.eclipse.jdt.ui.text.custom_code_templates= -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=false -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=false -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/google-api-client-xml/pom.xml b/google-api-client-xml/pom.xml deleted file mode 100644 index 809d2a57..00000000 --- a/google-api-client-xml/pom.xml +++ /dev/null @@ -1,73 +0,0 @@ - - 4.0.0 - - com.google.api-client - google-api-client-parent - 1.20.0-SNAPSHOT - ../pom.xml - - google-api-client-xml - XML extensions to the Google APIs Client Library for Java - - - - maven-javadoc-plugin - - - http://download.oracle.com/javase/1.5.0/docs/api/ - http://javadoc.google-http-java-client.googlecode.com/hg/${project.http.version} - - ${project.name} ${project.version} - ${project.artifactId} ${project.version} - - - - maven-jar-plugin - - - - true - - - - - - jar - compile - - jar - - - - - - maven-source-plugin - - - source-jar - compile - - jar - - - - - - - - - com.google.api-client - google-api-client - - - com.google.http-client - google-http-client-xml - - - junit - junit - test - - - diff --git a/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/AtomPatchContent.java b/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/AtomPatchContent.java deleted file mode 100644 index 6755d3fb..00000000 --- a/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/AtomPatchContent.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.xml.atom; - -import com.google.api.client.http.HttpMediaType; -import com.google.api.client.http.xml.atom.AtomContent; -import com.google.api.client.util.Beta; -import com.google.api.client.xml.Xml; -import com.google.api.client.xml.XmlNamespaceDictionary; - -/** - * {@link Beta}
- * Serializes Atom XML PATCH HTTP content based on the data key/value mapping object for an Atom - * entry. - * - *

- * Default value for {@link #getType()} is {@link Xml#MEDIA_TYPE}. - *

- * - *

- * Sample usage: - *

- * - *
- *
-  static void setContent(
-      HttpRequest request, XmlNamespaceDictionary namespaceDictionary, Object patchEntry) {
-    request.setContent(new AtomPatchContent(namespaceDictionary, patchEntry));
-  }
- * 
- * 
- * - *

- * Implementation is not thread-safe. - *

- * - * @since 1.0 - * @author Yaniv Inbar - */ -@Beta -public final class AtomPatchContent extends AtomContent { - - /** - * @param namespaceDictionary XML namespace dictionary - * @param patchEntry key/value pair data for the Atom PATCH entry - * @since 1.5 - */ - public AtomPatchContent(XmlNamespaceDictionary namespaceDictionary, Object patchEntry) { - super(namespaceDictionary, patchEntry, true); - setMediaType(new HttpMediaType(Xml.MEDIA_TYPE)); - } - - @Override - public AtomPatchContent setMediaType(HttpMediaType mediaType) { - super.setMediaType(mediaType); - return this; - } -} 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 deleted file mode 100644 index 0d43c856..00000000 --- a/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/AtomPatchRelativeToOriginalContent.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.xml.atom; - -import com.google.api.client.http.HttpMediaType; -import com.google.api.client.http.xml.AbstractXmlHttpContent; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Preconditions; -import com.google.api.client.xml.XmlNamespaceDictionary; -import com.google.api.client.xml.atom.Atom; - -import org.xmlpull.v1.XmlSerializer; - -import java.io.IOException; -import java.util.Map; - -/** - * {@link Beta}
- * Serializes an optimal Atom XML PATCH HTTP content based on the data key/value mapping object for - * an Atom entry, by comparing the original value to the patched value. - * - *

- * Sample usage: - *

- * - *
- * 
-  static void setContent(HttpRequest request, XmlNamespaceDictionary namespaceDictionary,
-      Object originalEntry, Object patchedEntry) {
-    request.setContent(
-        new AtomPatchRelativeToOriginalContent(namespaceDictionary, originalEntry, patchedEntry));
-  }
- * 
- * 
- * - * @since 1.0 - * @author Yaniv Inbar - */ -@Beta -public final class AtomPatchRelativeToOriginalContent extends AbstractXmlHttpContent { - - /** Key/value pair data for the updated/patched Atom entry. */ - private final Object patchedEntry; - - /** Key/value pair data for the original unmodified Atom entry. */ - private final Object originalEntry; - - /** - * @param namespaceDictionary XML namespace dictionary - * @since 1.5 - */ - public AtomPatchRelativeToOriginalContent( - XmlNamespaceDictionary namespaceDictionary, Object originalEntry, Object patchedEntry) { - super(namespaceDictionary); - this.originalEntry = Preconditions.checkNotNull(originalEntry); - this.patchedEntry = Preconditions.checkNotNull(patchedEntry); - } - - @Override - protected void writeTo(XmlSerializer serializer) throws IOException { - Map patch = GoogleAtom.computePatch(patchedEntry, originalEntry); - getNamespaceDictionary().serialize(serializer, Atom.ATOM_NAMESPACE, "entry", patch); - } - - @Override - public AtomPatchRelativeToOriginalContent setMediaType(HttpMediaType mediaType) { - super.setMediaType(mediaType); - return this; - } - - /** - * Returns the data key name/value pairs for the updated/patched Atom entry. - * - * @since 1.5 - */ - public final Object getPatchedEntry() { - return patchedEntry; - } - - /** - * Returns the data key name/value pairs for the original unmodified Atom entry. - * - * @since 1.5 - */ - public final Object getOriginalEntry() { - return originalEntry; - } -} diff --git a/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/GoogleAtom.java b/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/GoogleAtom.java deleted file mode 100644 index e3d435ad..00000000 --- a/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/GoogleAtom.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.xml.atom; - -import com.google.api.client.util.ArrayMap; -import com.google.api.client.util.Beta; -import com.google.api.client.util.ClassInfo; -import com.google.api.client.util.Data; -import com.google.api.client.util.FieldInfo; -import com.google.api.client.util.GenericData; -import com.google.api.client.util.Types; - -import java.util.Collection; -import java.util.Map; -import java.util.TreeSet; - -/** - * {@link Beta}
- * Utilities for working with the Atom XML of Google Data APIs. - * - * @since 1.0 - * @author Yaniv Inbar - */ -@Beta -public class GoogleAtom { - - /** - * GData namespace. - * - * @since 1.0 - */ - public static final String GD_NAMESPACE = "http://schemas.google.com/g/2005"; - - /** - * Content type used on an error formatted in XML. - * - * @since 1.5 - */ - public static final String ERROR_CONTENT_TYPE = "application/vnd.google.gdata.error+xml"; - - // TODO(yanivi): require XmlNamespaceDictory and include xmlns declarations since there is no - // guarantee that there is a match between Google's mapping and the one used by client - - /** - * Returns the fields mask to use for the given data class of key/value pairs. It cannot be a - * {@link Map}, {@link GenericData} or a {@link Collection}. - * - * @param dataClass data class of key/value pairs - */ - public static String getFieldsFor(Class dataClass) { - StringBuilder fieldsBuf = new StringBuilder(); - appendFieldsFor(fieldsBuf, dataClass, new int[1]); - return fieldsBuf.toString(); - } - - /** - * Returns the fields mask to use for the given data class of key/value pairs for the feed class - * and for the entry class. This should only be used if the feed class does not contain the entry - * class as a field. The data classes cannot be a {@link Map}, {@link GenericData} or a - * {@link Collection}. - * - * @param feedClass feed data class - * @param entryClass entry data class - */ - public static String getFeedFields(Class feedClass, Class entryClass) { - StringBuilder fieldsBuf = new StringBuilder(); - appendFeedFields(fieldsBuf, feedClass, entryClass); - return fieldsBuf.toString(); - } - - private static void appendFieldsFor( - StringBuilder fieldsBuf, Class dataClass, int[] numFields) { - if (Map.class.isAssignableFrom(dataClass) || Collection.class.isAssignableFrom(dataClass)) { - throw new IllegalArgumentException( - "cannot specify field mask for a Map or Collection class: " + dataClass); - } - ClassInfo classInfo = ClassInfo.of(dataClass); - for (String name : new TreeSet(classInfo.getNames())) { - FieldInfo fieldInfo = classInfo.getFieldInfo(name); - if (fieldInfo.isFinal()) { - continue; - } - if (++numFields[0] != 1) { - fieldsBuf.append(','); - } - fieldsBuf.append(name); - // TODO(yanivi): handle Java arrays? - Class fieldClass = fieldInfo.getType(); - if (Collection.class.isAssignableFrom(fieldClass)) { - // TODO(yanivi): handle Java collection of Java collection or Java map? - fieldClass = (Class) Types.getIterableParameter(fieldInfo.getField().getGenericType()); - } - // TODO(yanivi): implement support for map when server implements support for *:* - if (fieldClass != null) { - if (fieldInfo.isPrimitive()) { - if (name.charAt(0) != '@' && !name.equals("text()")) { - // TODO(yanivi): wait for bug fix from server to support text() -- already fixed??? - // buf.append("/text()"); - } - } else if (!Collection.class.isAssignableFrom(fieldClass) - && !Map.class.isAssignableFrom(fieldClass)) { - int[] subNumFields = new int[1]; - int openParenIndex = fieldsBuf.length(); - fieldsBuf.append('('); - // TODO(yanivi): abort if found cycle to avoid infinite loop - appendFieldsFor(fieldsBuf, fieldClass, subNumFields); - updateFieldsBasedOnNumFields(fieldsBuf, openParenIndex, subNumFields[0]); - } - } - } - } - - private static void appendFeedFields( - StringBuilder fieldsBuf, Class feedClass, Class entryClass) { - int[] numFields = new int[1]; - appendFieldsFor(fieldsBuf, feedClass, numFields); - if (numFields[0] != 0) { - fieldsBuf.append(","); - } - fieldsBuf.append("entry("); - int openParenIndex = fieldsBuf.length() - 1; - numFields[0] = 0; - appendFieldsFor(fieldsBuf, entryClass, numFields); - updateFieldsBasedOnNumFields(fieldsBuf, openParenIndex, numFields[0]); - } - - private static void updateFieldsBasedOnNumFields( - StringBuilder fieldsBuf, int openParenIndex, int numFields) { - switch (numFields) { - case 0: - fieldsBuf.deleteCharAt(openParenIndex); - break; - case 1: - fieldsBuf.setCharAt(openParenIndex, '/'); - break; - default: - fieldsBuf.append(')'); - } - } - - /** - * Compute the patch object of key/value pairs from the given original and patched objects, adding - * a {@code @gd:fields} key for the fields mask. - * - * @param patched patched object - * @param original original object - * @return patch object of key/value pairs - */ - public static Map computePatch(Object patched, Object original) { - FieldsMask fieldsMask = new FieldsMask(); - ArrayMap result = computePatchInternal(fieldsMask, patched, original); - if (fieldsMask.numDifferences != 0) { - result.put("@gd:fields", fieldsMask.buf.toString()); - } - return result; - } - - private static ArrayMap computePatchInternal( - FieldsMask fieldsMask, Object patchedObject, Object originalObject) { - ArrayMap result = ArrayMap.create(); - Map patchedMap = Data.mapOf(patchedObject); - Map originalMap = Data.mapOf(originalObject); - TreeSet fieldNames = new TreeSet(); - fieldNames.addAll(patchedMap.keySet()); - fieldNames.addAll(originalMap.keySet()); - for (String name : fieldNames) { - Object originalValue = originalMap.get(name); - Object patchedValue = patchedMap.get(name); - if (originalValue == patchedValue) { - continue; - } - Class type = originalValue == null ? patchedValue.getClass() : originalValue.getClass(); - if (Data.isPrimitive(type)) { - if (originalValue != null && originalValue.equals(patchedValue)) { - continue; - } - fieldsMask.append(name); - // TODO(yanivi): wait for bug fix from server - // if (!name.equals("text()") && name.charAt(0) != '@') { - // fieldsMask.buf.append("/text()"); - // } - if (patchedValue != null) { - result.add(name, patchedValue); - } - } else if (Collection.class.isAssignableFrom(type)) { - if (originalValue != null && patchedValue != null) { - @SuppressWarnings("unchecked") - Collection originalCollection = (Collection) originalValue; - @SuppressWarnings("unchecked") - Collection patchedCollection = (Collection) patchedValue; - int size = originalCollection.size(); - if (size == patchedCollection.size()) { - int i; - for (i = 0; i < size; i++) { - FieldsMask subFieldsMask = new FieldsMask(); - computePatchInternal(subFieldsMask, patchedValue, originalValue); - if (subFieldsMask.numDifferences != 0) { - break; - } - } - if (i == size) { - continue; - } - } - } - // TODO(yanivi): implement - throw new UnsupportedOperationException( - "not yet implemented: support for patching collections"); - } else { - if (originalValue == null) { // TODO(yanivi): test - fieldsMask.append(name); - result.add(name, Data.mapOf(patchedValue)); - } else if (patchedValue == null) { // TODO(yanivi): test - fieldsMask.append(name); - } else { - FieldsMask subFieldsMask = new FieldsMask(); - ArrayMap patch = - computePatchInternal(subFieldsMask, patchedValue, originalValue); - int numDifferences = subFieldsMask.numDifferences; - if (numDifferences != 0) { - fieldsMask.append(name, subFieldsMask); - result.add(name, patch); - } - } - } - } - return result; - } - - static class FieldsMask { - int numDifferences; - StringBuilder buf = new StringBuilder(); - - void append(String name) { - StringBuilder buf = this.buf; - if (++numDifferences != 1) { - buf.append(','); - } - buf.append(name); - } - - void append(String name, FieldsMask subFields) { - append(name); - StringBuilder buf = this.buf; - boolean isSingle = subFields.numDifferences == 1; - if (isSingle) { - buf.append('/'); - } else { - buf.append('('); - } - buf.append(subFields.buf); - if (!isSingle) { - buf.append(')'); - } - } - } - - private GoogleAtom() { - } -} diff --git a/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/MultiKindFeedParser.java b/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/MultiKindFeedParser.java deleted file mode 100644 index 76218d33..00000000 --- a/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/MultiKindFeedParser.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.xml.atom; - -import com.google.api.client.http.HttpResponse; -import com.google.api.client.util.Beta; -import com.google.api.client.util.ClassInfo; -import com.google.api.client.util.FieldInfo; -import com.google.api.client.util.Types; -import com.google.api.client.xml.Xml; -import com.google.api.client.xml.XmlNamespaceDictionary; -import com.google.api.client.xml.atom.AbstractAtomFeedParser; -import com.google.api.client.xml.atom.Atom; - -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Field; -import java.util.HashMap; - -/** - * {@link Beta}
- * GData Atom feed pull parser when the entry class can be computed from the kind. - * - * @param feed type - * - * @since 1.0 - * @author Yaniv Inbar - */ -@Beta -public final class MultiKindFeedParser extends AbstractAtomFeedParser { - - private final HashMap> kindToEntryClassMap = new HashMap>(); - - /** - * @param namespaceDictionary XML namespace dictionary - * @param parser XML pull parser to use - * @param inputStream input stream to read - * @param feedClass feed class to parse - */ - MultiKindFeedParser(XmlNamespaceDictionary namespaceDictionary, XmlPullParser parser, - InputStream inputStream, Class feedClass) { - super(namespaceDictionary, parser, inputStream, feedClass); - } - - /** Sets the entry classes to use when parsing. */ - public void setEntryClasses(Class... entryClasses) { - int numEntries = entryClasses.length; - HashMap> kindToEntryClassMap = this.kindToEntryClassMap; - for (int i = 0; i < numEntries; i++) { - Class entryClass = entryClasses[i]; - ClassInfo typeInfo = ClassInfo.of(entryClass); - Field field = typeInfo.getField("@gd:kind"); - if (field == null) { - throw new IllegalArgumentException("missing @gd:kind field for " + entryClass.getName()); - } - Object entry = Types.newInstance(entryClass); - String kind = (String) FieldInfo.getFieldValue(field, entry); - if (kind == null) { - throw new IllegalArgumentException( - "missing value for @gd:kind field in " + entryClass.getName()); - } - kindToEntryClassMap.put(kind, entryClass); - } - } - - @Override - protected Object parseEntryInternal() throws IOException, XmlPullParserException { - XmlPullParser parser = getParser(); - String kind = parser.getAttributeValue(GoogleAtom.GD_NAMESPACE, "kind"); - Class entryClass = this.kindToEntryClassMap.get(kind); - if (entryClass == null) { - throw new IllegalArgumentException("unrecognized kind: " + kind); - } - Object result = Types.newInstance(entryClass); - Xml.parseElement(parser, result, getNamespaceDictionary(), null); - return result; - } - - /** - * Parses the given HTTP response using the given feed class and entry classes. - * - * @param feed type - * @param entry type - * @param response HTTP response - * @param namespaceDictionary XML namespace dictionary - * @param feedClass feed class - * @param entryClasses entry class - * @return Atom multi-kind feed pull parser - * @throws IOException I/O exception - * @throws XmlPullParserException XML pull parser exception - */ - public static MultiKindFeedParser create(HttpResponse response, - XmlNamespaceDictionary namespaceDictionary, Class feedClass, Class... entryClasses) - throws IOException, XmlPullParserException { - InputStream content = response.getContent(); - try { - Atom.checkContentType(response.getContentType()); - XmlPullParser parser = Xml.createParser(); - parser.setInput(content, null); - MultiKindFeedParser result = - new MultiKindFeedParser(namespaceDictionary, parser, content, feedClass); - result.setEntryClasses(entryClasses); - return result; - } finally { - content.close(); - } - } -} 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 deleted file mode 100644 index 2690aa39..00000000 --- a/google-api-client-xml/src/main/java/com/google/api/client/googleapis/xml/atom/package-info.java +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Utilities for Google's Atom XML implementation (see detailed package specification). - * - *

Package Specification

- * - *

- * User-defined Partial XML data models allow you to defined Plain Old Java Objects (POJO's) to - * define how the library should parse/serialize XML. 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. - *

- * - *

- * The optional value parameter of this @{@link com.google.api.client.util.Key} annotation specifies - * the XPath name to use to represent the field. For example, an XML attribute a has an - * XPath name of @a, an XML element <a> has an XPath name of - *a - * , and an XML text content has an XPath name of text(). These are named based - * on their usage with the partial - * response/update syntax for Google API's. If the @{@link com.google.api.client.util.Key} - * annotation is missing, the default is to use the Atom XML namespace and the Java field's name as - * the local XML name. By default, the field name is used as the JSON key. Any unrecognized XML is - * normally simply ignored and not stored. If the ability to store unknown keys is important, use - * {@link com.google.api.client.xml.GenericXml}. - *

- * - *

- * Let's take a look at a typical partial Atom XML album feed from the Picasa Web Albums Data API: - *

- * - *

-<?xml version='1.0' encoding='utf-8'?>
-<feed xmlns='http://www.w3.org/2005/Atom'
-    xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/'
-    xmlns:gphoto='http://schemas.google.com/photos/2007'>
-  <link rel='http://schemas.google.com/g/2005#post'
-    type='application/atom+xml'
-    href='http://picasaweb.google.com/data/feed/api/user/liz' />
-  <author>
-    <name>Liz</name>
-  </author>
-  <openSearch:totalResults>1</openSearch:totalResults>
-  <entry gd:etag='"RXY8fjVSLyp7ImA9WxVVGE8KQAE."'>
-    <category scheme='http://schemas.google.com/g/2005#kind'
-      term='http://schemas.google.com/photos/2007#album' />
-    <title>lolcats</title>
-    <summary>Hilarious Felines</summary>
-    <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): - *

- * - *

-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;
-    }
-  }
-
-  public class Category {
-
-    @Key("@scheme")
-    public String scheme;
-
-    @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 class AlbumEntry {
-
-    @Key
-    public String summary;
-
-    @Key
-    public String title;
-
-    @Key("gphoto:access")
-    public String access;
-
-    public Category category = newKind("album");
-
-    private String getEditLink() {
-      return Link.find(links, "edit");
-    }
-  }
-
-  public class Author {
-
-    @Key
-    public String name;
-  }
-
-  public class AlbumFeed {
-
-    @Key
-    public Author author;
-
-    @Key("openSearch:totalResults")
-    public int totalResults;
-
-    @Key("entry")
-    public List<AlbumEntry> photos;
-
-    @Key("link")
-    public List<Link> links;
-
-    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: - *

- * - *

-public class PicasaUrl extends GoogleUrl {
-
-  @Key("max-results")
-  public Integer maxResults;
-
-  @Key
-  public String kinds;
-
-  public PicasaUrl(String url) {
-    super(url);
-  }
-
-  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: - *

- * - *

-  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;
-  }
-
- * - *

- * 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);
-  }
-
- * - *

- * 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: - *

- * - *

-    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;
-    }
-
- * - *

- * 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);
-  }
-
-  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);
-  }
-
- * - *

- * To delete an album, we use the transport to execute a DELETE request to the Picasa Web Albums - * API: - *

- * - *

-  public void executeDelete(HttpTransport transport) throws IOException {
-    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 - * it's a lot easier. - *

- * - *

- * NOTE: If you prefer to use your favorite XML parsing library instead (there are many of them), - * 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 - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.xml.atom; - diff --git a/google-api-client-xml/src/test/java/com/google/api/client/googleapis/xml/atom/GoogleAtomTest.java b/google-api-client-xml/src/test/java/com/google/api/client/googleapis/xml/atom/GoogleAtomTest.java deleted file mode 100644 index a4aa90b3..00000000 --- a/google-api-client-xml/src/test/java/com/google/api/client/googleapis/xml/atom/GoogleAtomTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.xml.atom; - -import com.google.api.client.util.Key; -import com.google.api.client.xml.GenericXml; - -import junit.framework.TestCase; - -/** - * Tests {@link GoogleAtom}. - * - * @author Yaniv Inbar - */ -public class GoogleAtomTest extends TestCase { - - public GoogleAtomTest() { - super(); - } - - public GoogleAtomTest(String name) { - super(name); - } - - class A { - @Key - int x; - - @Key - B b; - - @Key - C c; - @Key - G g; - } - - class B { - @Key - int y; - } - - class C { - @Key - int z; - @Key - GenericXml generic; - @Key - B b; - } - - class G extends GenericXml { - @Key - int something; - } - - public void testGetFieldsFor() { - assertEquals("", GoogleAtom.getFieldsFor(Object.class)); - assertEquals("b/y,c(b/y,generic,z),g,x", GoogleAtom.getFieldsFor(A.class)); - } -} diff --git a/google-api-client/.classpath b/google-api-client/.classpath deleted file mode 100644 index 5e220716..00000000 --- a/google-api-client/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/google-api-client/.project b/google-api-client/.project deleted file mode 100644 index e787a93b..00000000 --- a/google-api-client/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - google-api-client - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/google-api-client/.settings/org.eclipse.jdt.core.prefs b/google-api-client/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 56c60d70..00000000 --- a/google-api-client/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,418 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_member=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=24 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter.count_dependent=1040|-1|1040 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type.count_dependent=1585|-1|1585 -org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type_declaration=569 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16|4|80 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16|5|48 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants.count_dependent=0|-1|0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_field_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_for_statement=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments=16 -org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class=0 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16|5|80 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16|4|49 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16|4|48 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration.count_dependent=16|-1|16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=0 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=true -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=false -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=100 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph=true -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.force_if_else_statement_brace=true -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comment_prefix=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=100 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=3 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false -org.eclipse.jdt.core.formatter.sort_local_variable_annotations=false -org.eclipse.jdt.core.formatter.sort_member_annotations=false -org.eclipse.jdt.core.formatter.sort_package_annotations=false -org.eclipse.jdt.core.formatter.sort_parameter_annotations=false -org.eclipse.jdt.core.formatter.sort_type_annotations=false -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_comment_inline_tags=false -org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation=true -org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation=false -org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments=false diff --git a/google-api-client/.settings/org.eclipse.jdt.ui.prefs b/google-api-client/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 08ebc976..00000000 --- a/google-api-client/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,119 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=false -cleanup.add_serial_version_id=true -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_parentheses_in_expressions=true -cleanup.use_this_for_non_static_field_access=true -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=true -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup_profile=_google-api-java-client -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_google-api-java-client 100 -formatter_settings_version=12 -org.eclipse.jdt.ui.exception.name=exception -org.eclipse.jdt.ui.gettersetter.use.is=false -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=com.google;;java;javax; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=999 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=999 -org.eclipse.jdt.ui.text.custom_code_templates= -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=false -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=false -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/google-api-client/pom.xml b/google-api-client/pom.xml deleted file mode 100644 index 6a682d0f..00000000 --- a/google-api-client/pom.xml +++ /dev/null @@ -1,136 +0,0 @@ - - 4.0.0 - - com.google.api-client - google-api-client-parent - 1.20.0-SNAPSHOT - ../pom.xml - - google-api-client - Google APIs Client Library for Java - - - - maven-javadoc-plugin - - - http://download.oracle.com/javase/1.5.0/docs/api/ - http://code.google.com/appengine/docs/java/javadoc - http://javadoc.google-http-java-client.googlecode.com/hg/${project.http.version} - http://javadoc.google-oauth-java-client.googlecode.com/hg/${project.oauth.version} - - ${project.name} ${project.version} - ${project.artifactId} ${project.version} - - - - maven-jar-plugin - - - - true - - - - - - jar - compile - - jar - - - - - - maven-source-plugin - - - source-jar - compile - - jar - - - - - - maven-antrun-plugin - - - generate-sources - generate-sources - - - - - - - - - - - - run - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.5 - - - add-test-source - generate-test-sources - - add-test-source - - - - target/generated-test-sources - - - - - - - - - - com.google.oauth-client - google-oauth-client - - - com.google.http-client - google-http-client-jackson2 - - - com.google.http-client - google-http-client-gson - test - - - com.google.http-client - google-http-client-protobuf - test - - - junit - junit - test - - - commons-codec - commons-codec - provided - 1.6 - - - com.google.guava - guava-jdk5 - - - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/GoogleUtils.java b/google-api-client/src/main/java/com/google/api/client/googleapis/GoogleUtils.java deleted file mode 100644 index 26e02f00..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/GoogleUtils.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis; - -import com.google.api.client.util.SecurityUtils; - -import java.io.IOException; -import java.io.InputStream; -import java.security.GeneralSecurityException; -import java.security.KeyStore; - -/** - * Utility class for the Google API Client Library. - * - * @since 1.12 - * @author rmistry@google.com (Ravi Mistry) - */ -public final class GoogleUtils { - - // NOTE: Integer instead of int so compiler thinks it isn't a constant, so it won't inline it - /** - * Major part of the current release version. - * - * @since 1.14 - */ - public static final Integer MAJOR_VERSION = 1; - - /** - * Minor part of the current release version. - * - * @since 1.14 - */ - public static final Integer MINOR_VERSION = 20; - - /** - * Bug fix part of the current release version. - * - * @since 1.14 - */ - public static final Integer BUGFIX_VERSION = 0; - - /** Current release version. */ - // NOTE: toString() so compiler thinks it isn't a constant, so it won't inline it - public static final String VERSION = (MAJOR_VERSION + "." + MINOR_VERSION + "." + BUGFIX_VERSION - + "-SNAPSHOT").toString(); - - /** Cached value for {@link #getCertificateTrustStore()}. */ - static KeyStore certTrustStore; - - /** - * Returns the key store for trusted root certificates to use for Google APIs. - * - *

- * Value is cached, so subsequent access is fast. - *

- * - * @since 1.14 - */ - public static synchronized KeyStore getCertificateTrustStore() - throws IOException, GeneralSecurityException { - if (certTrustStore == null) { - certTrustStore = SecurityUtils.getJavaKeyStore(); - InputStream keyStoreStream = GoogleUtils.class.getResourceAsStream("google.jks"); - SecurityUtils.loadKeyStore(certTrustStore, keyStoreStream, "notasecret"); - } - return certTrustStore; - } - - private GoogleUtils() { - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/MethodOverride.java b/google-api-client/src/main/java/com/google/api/client/googleapis/MethodOverride.java deleted file mode 100644 index c1309393..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/MethodOverride.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis; - -import com.google.api.client.http.EmptyContent; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpMethods; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.UrlEncodedContent; - -import java.io.IOException; - -/** - * Thread-safe HTTP request execute interceptor for Google API's that wraps HTTP requests inside of - * a POST request and uses {@link #HEADER} header to specify the actual HTTP method. - * - *

- * Use this for example for an HTTP transport that doesn't support PATCH like - * {@code NetHttpTransport} or {@code UrlFetchTransport}. By default, only the methods not supported - * by the transport will be overridden. When running behind a firewall that does not support certain - * verbs like PATCH, use the {@link MethodOverride.Builder#setOverrideAllMethods(boolean)} - * constructor instead to specify to override all methods. POST is never overridden. - *

- * - *

- * This class also allows GET requests with a long URL (> 2048 chars) to be instead sent using - * method override as a POST request. - *

- * - *

- * Sample usage, taking advantage that this class implements {@link HttpRequestInitializer}: - *

- * - *
-  public static HttpRequestFactory createRequestFactory(HttpTransport transport) {
-    return transport.createRequestFactory(new MethodOverride());
-  }
- * 
- * - *

- * If you have a custom request initializer, take a look at the sample usage for - * {@link HttpExecuteInterceptor}, which this class also implements. - *

- * - * @since 1.4 - * @author Yaniv Inbar - */ -public final class MethodOverride implements HttpExecuteInterceptor, HttpRequestInitializer { - - /** - * Name of the method override header. - * - * @since 1.13 - */ - public static final String HEADER = "X-HTTP-Method-Override"; - - /** Maximum supported URL length. */ - static final int MAX_URL_LENGTH = 2048; - - /** - * Whether to allow all methods (except GET and POST) to be overridden regardless of whether the - * transport supports them. - */ - private final boolean overrideAllMethods; - - /** Only overrides HTTP methods that the HTTP transport does not support. */ - public MethodOverride() { - this(false); - } - - MethodOverride(boolean overrideAllMethods) { - this.overrideAllMethods = overrideAllMethods; - } - - public void initialize(HttpRequest request) { - request.setInterceptor(this); - } - - public void intercept(HttpRequest request) throws IOException { - if (overrideThisMethod(request)) { - String requestMethod = request.getRequestMethod(); - request.setRequestMethod(HttpMethods.POST); - request.getHeaders().set(HEADER, requestMethod); - if (requestMethod.equals(HttpMethods.GET)) { - // take the URI query part and put it into the HTTP body - request.setContent(new UrlEncodedContent(request.getUrl().clone())); - // remove query parameters from URI - request.getUrl().clear(); - } else if (request.getContent() == null) { - // Google servers will fail to process a POST unless the Content-Length header is specified - request.setContent(new EmptyContent()); - } - } - } - - private boolean overrideThisMethod(HttpRequest request) throws IOException { - String requestMethod = request.getRequestMethod(); - if (requestMethod.equals(HttpMethods.POST)) { - return false; - } - if (requestMethod.equals(HttpMethods.GET) - ? request.getUrl().build().length() > MAX_URL_LENGTH : overrideAllMethods) { - return true; - } - return !request.getTransport().supportsMethod(requestMethod); - } - - /** - * Builder for {@link MethodOverride}. - * - * @since 1.12 - * @author Yaniv Inbar - */ - public static final class Builder { - - /** - * Whether to allow all methods (except GET and POST) to be overridden regardless of whether the - * transport supports them. - */ - private boolean overrideAllMethods; - - /** Builds the {@link MethodOverride}. */ - public MethodOverride build() { - return new MethodOverride(overrideAllMethods); - } - - /** - * Returns whether to allow all methods (except GET and POST) to be overridden regardless of - * whether the transport supports them. - */ - public boolean getOverrideAllMethods() { - return overrideAllMethods; - } - - /** - * Sets whether to allow all methods (except GET and POST) to be overridden regardless of - * whether the transport supports them. - * - *

- * Default is {@code false}. - *

- */ - public Builder setOverrideAllMethods(boolean overrideAllMethods) { - this.overrideAllMethods = overrideAllMethods; - return this; - } - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/apache/GoogleApacheHttpTransport.java b/google-api-client/src/main/java/com/google/api/client/googleapis/apache/GoogleApacheHttpTransport.java deleted file mode 100644 index fbb3e64a..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/apache/GoogleApacheHttpTransport.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.apache; - -import com.google.api.client.googleapis.GoogleUtils; -import com.google.api.client.http.apache.ApacheHttpTransport; - -import java.io.IOException; -import java.security.GeneralSecurityException; -import java.security.KeyStore; - -/** - * Utilities for Google APIs based on {@link ApacheHttpTransport}. - * - * @since 1.14 - * @author Yaniv Inbar - */ -public final class GoogleApacheHttpTransport { - - /** - * Returns a new instance of {@link ApacheHttpTransport} that uses - * {@link GoogleUtils#getCertificateTrustStore()} for the trusted certificates using - * {@link com.google.api.client.http.apache.ApacheHttpTransport.Builder#trustCertificates(KeyStore)}. - */ - public static ApacheHttpTransport newTrustedTransport() throws GeneralSecurityException, - IOException { - return new ApacheHttpTransport.Builder().trustCertificates( - GoogleUtils.getCertificateTrustStore()).build(); - } - - private GoogleApacheHttpTransport() { - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/apache/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/apache/package-info.java deleted file mode 100644 index 5bc40683..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/apache/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Google API's support based on the Apache HTTP Client. - * - * @since 1.14 - * @author Yaniv Inbar - */ - -package com.google.api.client.googleapis.apache; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/clientlogin/AuthKeyValueParser.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/clientlogin/AuthKeyValueParser.java deleted file mode 100644 index 4dacf441..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/clientlogin/AuthKeyValueParser.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.clientlogin; - -import com.google.api.client.http.HttpResponse; -import com.google.api.client.util.Beta; -import com.google.api.client.util.ClassInfo; -import com.google.api.client.util.FieldInfo; -import com.google.api.client.util.GenericData; -import com.google.api.client.util.ObjectParser; -import com.google.api.client.util.Types; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.lang.reflect.Field; -import java.lang.reflect.Type; -import java.nio.charset.Charset; -import java.util.Map; - -/** - * {@link Beta}
- * HTTP parser for Google response to an Authorization request. - * - * @since 1.10 - * @author Yaniv Inbar - */ -@Beta -final class AuthKeyValueParser implements ObjectParser { - - /** Singleton instance. */ - public static final AuthKeyValueParser INSTANCE = new AuthKeyValueParser(); - - public String getContentType() { - return "text/plain"; - } - - public T parse(HttpResponse response, Class dataClass) throws IOException { - response.setContentLoggingLimit(0); - InputStream content = response.getContent(); - try { - return parse(content, dataClass); - } finally { - content.close(); - } - } - - public T parse(InputStream content, Class dataClass) throws IOException { - ClassInfo classInfo = ClassInfo.of(dataClass); - T newInstance = Types.newInstance(dataClass); - BufferedReader reader = new BufferedReader(new InputStreamReader(content)); - while (true) { - String line = reader.readLine(); - if (line == null) { - break; - } - int equals = line.indexOf('='); - String key = line.substring(0, equals); - String value = line.substring(equals + 1); - // get the field from the type information - Field field = classInfo.getField(key); - if (field != null) { - Class fieldClass = field.getType(); - Object fieldValue; - if (fieldClass == boolean.class || fieldClass == Boolean.class) { - fieldValue = Boolean.valueOf(value); - } else { - fieldValue = value; - } - FieldInfo.setFieldValue(field, newInstance, fieldValue); - } else if (GenericData.class.isAssignableFrom(dataClass)) { - GenericData data = (GenericData) newInstance; - data.set(key, value); - } else if (Map.class.isAssignableFrom(dataClass)) { - @SuppressWarnings("unchecked") - Map map = (Map) newInstance; - map.put(key, value); - } - } - - return newInstance; - } - - private AuthKeyValueParser() { - } - - public T parseAndClose(InputStream in, Charset charset, Class dataClass) - throws IOException { - Reader reader = new InputStreamReader(in, charset); - return parseAndClose(reader, dataClass); - } - - public Object parseAndClose(InputStream in, Charset charset, Type dataType) { - throw new UnsupportedOperationException( - "Type-based parsing is not yet supported -- use Class instead"); - } - - public T parseAndClose(Reader reader, Class dataClass) throws IOException { - try { - ClassInfo classInfo = ClassInfo.of(dataClass); - T newInstance = Types.newInstance(dataClass); - BufferedReader breader = new BufferedReader(reader); - while (true) { - String line = breader.readLine(); - if (line == null) { - break; - } - int equals = line.indexOf('='); - String key = line.substring(0, equals); - String value = line.substring(equals + 1); - // get the field from the type information - Field field = classInfo.getField(key); - if (field != null) { - Class fieldClass = field.getType(); - Object fieldValue; - if (fieldClass == boolean.class || fieldClass == Boolean.class) { - fieldValue = Boolean.valueOf(value); - } else { - fieldValue = value; - } - FieldInfo.setFieldValue(field, newInstance, fieldValue); - } else if (GenericData.class.isAssignableFrom(dataClass)) { - GenericData data = (GenericData) newInstance; - data.set(key, value); - } else if (Map.class.isAssignableFrom(dataClass)) { - @SuppressWarnings("unchecked") - Map map = (Map) newInstance; - map.put(key, value); - } - } - - return newInstance; - } finally { - reader.close(); - } - } - - public Object parseAndClose(Reader reader, Type dataType) { - throw new UnsupportedOperationException( - "Type-based parsing is not yet supported -- use Class instead"); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/clientlogin/ClientLogin.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/clientlogin/ClientLogin.java deleted file mode 100644 index 8e335ed4..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/clientlogin/ClientLogin.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.clientlogin; - -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpResponseException; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.UrlEncodedContent; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Key; -import com.google.api.client.util.StringUtils; -import com.google.api.client.util.Strings; - -import java.io.IOException; - -/** - * {@link Beta}
- * Client Login authentication method as described in ClientLogin for - * Installed Applications. - * - * @since 1.0 - * @author Yaniv Inbar - */ -@Beta -public final class ClientLogin { - - /** - * HTTP transport required for executing request in {@link #authenticate()}. - * - * @since 1.3 - */ - public HttpTransport transport; - - /** - * URL for the Client Login authorization server. - * - *

- * By default this is {@code "https://www.google.com"}, but it may be overridden for testing - * purposes. - *

- * - * @since 1.3 - */ - public GenericUrl serverUrl = new GenericUrl("https://www.google.com"); - - /** - * Short string identifying your application for logging purposes of the form: - * "companyName-applicationName-versionID". - */ - @Key("source") - public String applicationName; - - /** - * Name of the Google service you're requesting authorization for, for example {@code "cl"} for - * Google Calendar. - */ - @Key("service") - public String authTokenType; - - /** User's full email address. */ - @Key("Email") - public String username; - - /** User's password. */ - @Key("Passwd") - public String password; - - /** - * Type of account to request authorization for. Possible values are: - * - *
    - *
  • GOOGLE (get authorization for a Google account only)
  • - *
  • HOSTED (get authorization for a hosted account only)
  • - *
  • HOSTED_OR_GOOGLE (get authorization first for a hosted account; if attempt fails, get - * authorization for a Google account)
  • - *
- * - * Use HOSTED_OR_GOOGLE if you're not sure which type of account you want authorization for. If - * the user information matches both a hosted and a Google account, only the hosted account is - * authorized. - * - * @since 1.1 - */ - @Key - public String accountType; - - /** (optional) Token representing the specific CAPTCHA challenge. */ - @Key("logintoken") - public String captchaToken; - - /** (optional) String entered by the user as an answer to a CAPTCHA challenge. */ - @Key("logincaptcha") - public String captchaAnswer; - - /** - * Key/value data to parse a success response. - * - *

- * Sample usage, taking advantage that this class implements {@link HttpRequestInitializer}: - *

- * - *
-    public static HttpRequestFactory createRequestFactory(
-        HttpTransport transport, Response response) {
-      return transport.createRequestFactory(response);
-    }
-   * 
- * - *

- * If you have a custom request initializer, take a look at the sample usage for - * {@link HttpExecuteInterceptor}, which this class also implements. - *

- */ - public static final class Response implements HttpExecuteInterceptor, HttpRequestInitializer { - - /** Authentication token. */ - @Key("Auth") - public String auth; - - /** Returns the authorization header value to use based on the authentication token. */ - public String getAuthorizationHeaderValue() { - return ClientLogin.getAuthorizationHeaderValue(auth); - } - - public void initialize(HttpRequest request) { - request.setInterceptor(this); - } - - public void intercept(HttpRequest request) { - request.getHeaders().setAuthorization(getAuthorizationHeaderValue()); - } - } - - /** Key/value data to parse an error response. */ - public static final class ErrorInfo { - - @Key("Error") - public String error; - - @Key("Url") - public String url; - - @Key("CaptchaToken") - public String captchaToken; - - @Key("CaptchaUrl") - public String captchaUrl; - } - - /** - * Authenticates based on the provided field values. - * - * @throws ClientLoginResponseException if the authentication response has an error code, such as - * for a CAPTCHA challenge. - */ - public Response authenticate() throws IOException { - GenericUrl url = serverUrl.clone(); - url.appendRawPath("/accounts/ClientLogin"); - HttpRequest request = - transport.createRequestFactory().buildPostRequest(url, new UrlEncodedContent(this)); - request.setParser(AuthKeyValueParser.INSTANCE); - request.setContentLoggingLimit(0); - request.setThrowExceptionOnExecuteError(false); - HttpResponse response = request.execute(); - // check for an HTTP success response (2xx) - if (response.isSuccessStatusCode()) { - return response.parseAs(Response.class); - } - HttpResponseException.Builder builder = new HttpResponseException.Builder( - response.getStatusCode(), response.getStatusMessage(), response.getHeaders()); - // On error, throw a ClientLoginResponseException with the parsed error details - ErrorInfo details = response.parseAs(ErrorInfo.class); - String detailString = details.toString(); - StringBuilder message = HttpResponseException.computeMessageBuffer(response); - if (!Strings.isNullOrEmpty(detailString)) { - message.append(StringUtils.LINE_SEPARATOR).append(detailString); - builder.setContent(detailString); - } - builder.setMessage(message.toString()); - throw new ClientLoginResponseException(builder, details); - } - - /** - * Returns Google Login {@code "Authorization"} header value based on the given authentication - * token. - * - * @since 1.13 - */ - public static String getAuthorizationHeaderValue(String authToken) { - return "GoogleLogin auth=" + authToken; - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/clientlogin/ClientLoginResponseException.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/clientlogin/ClientLoginResponseException.java deleted file mode 100644 index b6d74f54..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/clientlogin/ClientLoginResponseException.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.clientlogin; - -import com.google.api.client.googleapis.auth.clientlogin.ClientLogin.ErrorInfo; -import com.google.api.client.http.HttpResponseException; -import com.google.api.client.util.Beta; - -/** - * {@link Beta}
- * Exception thrown when an error status code is detected in an HTTP response to a Google - * ClientLogin request in {@link ClientLogin} . - * - *

- * To get the structured details, use {@link #getDetails()}. - *

- * - * @since 1.7 - * @author Yaniv Inbar - */ -@Beta -public class ClientLoginResponseException extends HttpResponseException { - - private static final long serialVersionUID = 4974317674023010928L; - - /** Error details or {@code null} for none. */ - private final transient ErrorInfo details; - - /** - * @param builder builder - * @param details error details or {@code null} for none - */ - ClientLoginResponseException(Builder builder, ErrorInfo details) { - super(builder); - this.details = details; - } - - /** Return the error details or {@code null} for none. */ - public final ErrorInfo getDetails() { - return details; - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/clientlogin/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/clientlogin/package-info.java deleted file mode 100644 index 2ff371f3..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/clientlogin/package-info.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Google's legacy ClientLogin authentication method as described in ClientLogin for - * Installed Applications. - * - * @since 1.0 - * @author Yaniv Inbar - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.auth.clientlogin; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/DefaultCredentialProvider.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/DefaultCredentialProvider.java deleted file mode 100644 index 9e9850bc..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/DefaultCredentialProvider.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Copyright (c) 2014 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.oauth2.TokenResponse; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpStatusCodes; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonObjectParser; -import com.google.api.client.util.Beta; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.security.AccessControlException; -import java.util.Locale; - -/** - * {@link Beta}
- * Provides a default credential available from the host or from an environment variable. - * - *

An instance represents the per-process state used to get and cache the credential and - * allows overriding the state and environment for testing purposes. - */ -@Beta -class DefaultCredentialProvider { - - static final String CREDENTIAL_ENV_VAR = "GOOGLE_APPLICATION_CREDENTIALS"; - - static final String WELL_KNOWN_CREDENTIALS_FILE = "application_default_credentials.json"; - - static final String CLOUDSDK_CONFIG_DIRECTORY = "gcloud"; - - static final String HELP_PERMALINK = - "https://developers.google.com/accounts/docs/application-default-credentials"; - - static final String APP_ENGINE_CREDENTIAL_CLASS = - "com.google.api.client.googleapis.extensions.appengine.auth.oauth2" - + ".AppIdentityCredential$AppEngineCredentialWrapper"; - - // These variables should only be accessed inside a synchronized block - private GoogleCredential cachedCredential = null; - private boolean checkedAppEngine = false; - private boolean checkedComputeEngine = false; - - DefaultCredentialProvider() {} - - /** - * {@link Beta}
- * Returns the Application Default Credentials. - * - *

Returns the Application Default Credentials which are credentials that identify and - * authorize the whole application. This is the built-in service account if running on Google - * Compute Engine or the credentials file from the path in the environment variable - * GOOGLE_APPLICATION_CREDENTIALS.

- * - * @param transport the transport for Http calls. - * @param jsonFactory the factory for Json parsing and formatting. - * @return the credential instance. - * @throws IOException if the credential cannot be created in the current environment. - */ - final GoogleCredential getDefaultCredential(HttpTransport transport, JsonFactory jsonFactory) - throws IOException { - synchronized (this) { - if (cachedCredential == null) { - cachedCredential = getDefaultCredentialUnsynchronized(transport, jsonFactory); - } - if (cachedCredential != null) { - return cachedCredential; - } - } - - throw new IOException(String.format( - "The Application Default Credentials are not available. They are available if running" - + " in Google Compute Engine. Otherwise, the environment variable %s must be defined" - + " pointing to a file defining the credentials. See %s for more information.", - CREDENTIAL_ENV_VAR, - HELP_PERMALINK)); - } - - private final GoogleCredential getDefaultCredentialUnsynchronized( - HttpTransport transport, JsonFactory jsonFactory) throws IOException { - - // First try the environment variable - GoogleCredential credential = null; - String credentialsPath = getEnv(CREDENTIAL_ENV_VAR); - if (credentialsPath != null && credentialsPath.length() > 0) { - InputStream credentialsStream = null; - try { - File credentialsFile = new File(credentialsPath); - if (!credentialsFile.exists() || credentialsFile.isDirectory()) { - // Path will get in the message from the catch block below - throw new IOException("File does not exist."); - } - credentialsStream = new FileInputStream(credentialsFile); - credential = GoogleCredential.fromStream(credentialsStream, transport, jsonFactory); - } catch (IOException e) { - // Although it is also the cause, the message of the caught exception can have very - // important information for diagnosing errors, so include its message in the - // outer exception message also - throw OAuth2Utils.exceptionWithCause(new IOException(String.format( - "Error reading credential file from environment variable %s, value '%s': %s", - CREDENTIAL_ENV_VAR, credentialsPath, e.getMessage())), e); - } catch (AccessControlException expected) { - // Exception querying file system is expected on App-Engine - } finally { - if (credentialsStream != null) { - credentialsStream.close(); - } - } - } - - // Then try the well-known file - if (credential == null) { - File wellKnownFileLocation = getWellKnownCredentialsFile(); - try { - if (fileExists(wellKnownFileLocation)) { - InputStream credentialsStream = null; - try { - credentialsStream = new FileInputStream(wellKnownFileLocation); - credential = GoogleCredential.fromStream(credentialsStream, transport, jsonFactory); - } catch (IOException e) { - throw new IOException(String.format( - "Error reading credential file from location %s: %s", - wellKnownFileLocation, e.getMessage())); - } finally { - if (credentialsStream != null) { - credentialsStream.close(); - } - } - } - } catch (AccessControlException expected) { - // Exception querying file system is expected on App-Engine - } - } - - // Then try App Engine - if (credential == null) { - credential = tryGetAppEngineCredential(transport, jsonFactory); - } - - // Then try Compute Engine - if (credential == null) { - credential = tryGetComputeCredential(transport, jsonFactory); - } - return credential; - } - - private final File getWellKnownCredentialsFile() { - File cloudConfigPath = null; - String os = getProperty("os.name", "").toLowerCase(Locale.US); - if (os.indexOf("windows") >= 0) { - File appDataPath = new File(getEnv("APPDATA")); - cloudConfigPath = new File(appDataPath, CLOUDSDK_CONFIG_DIRECTORY); - } else { - File configPath = new File(getProperty("user.home", ""), ".config"); - cloudConfigPath = new File(configPath, CLOUDSDK_CONFIG_DIRECTORY); - } - File credentialFilePath = new File(cloudConfigPath, WELL_KNOWN_CREDENTIALS_FILE); - return credentialFilePath; - } - - /** - * Override in test code to isolate from environment. - */ - String getEnv(String name) { - return System.getenv(name); - } - - /** - * Override in test code to isolate from environment. - */ - boolean fileExists(File file) { - return file.exists() && !file.isDirectory(); - } - - /** - * Override in test code to isolate from environment. - */ - String getProperty(String property, String def) { - return System.getProperty(property, def); - } - - /** - * Override in test code to isolate from environment. - */ - Class forName(String className) throws ClassNotFoundException { - return Class.forName(className); - } - - private boolean runningOnAppEngine() { - Class systemPropertyClass = null; - try { - systemPropertyClass = forName("com.google.appengine.api.utils.SystemProperty"); - } catch (ClassNotFoundException expected) { - // SystemProperty will always be present on App Engine. - return false; - } - Exception cause = null; - Field environmentField; - try { - environmentField = systemPropertyClass.getField("environment"); - Object environmentValue = environmentField.get(null); - Class environmentType = environmentField.getType(); - Method valueMethod = environmentType.getMethod("value"); - Object environmentValueValue = valueMethod.invoke(environmentValue); - return (environmentValueValue != null); - } catch (NoSuchFieldException exception) { - cause = exception; - } catch (SecurityException exception) { - cause = exception; - } catch (IllegalArgumentException exception) { - cause = exception; - } catch (IllegalAccessException exception) { - cause = exception; - } catch (NoSuchMethodException exception) { - cause = exception; - } catch (InvocationTargetException exception) { - cause = exception; - } - throw OAuth2Utils.exceptionWithCause(new RuntimeException(String.format( - "Unexpcted error trying to determine if runnning on Google App Engine: %s", - cause.getMessage())), cause); - } - - private final GoogleCredential tryGetAppEngineCredential( - HttpTransport transport, JsonFactory jsonFactory) throws IOException { - // Checking for App Engine requires a class load, so check only once - if (checkedAppEngine) { - return null; - } - boolean onAppEngine = runningOnAppEngine(); - checkedAppEngine = true; - if (!onAppEngine) { - return null; - } - Exception innerException = null; - try { - Class credentialClass = forName(APP_ENGINE_CREDENTIAL_CLASS); - Constructor constructor = credentialClass - .getConstructor(HttpTransport.class, JsonFactory.class); - return (GoogleCredential) constructor.newInstance(transport, jsonFactory); - } catch (ClassNotFoundException e) { - innerException = e; - } catch (NoSuchMethodException e) { - innerException = e; - } catch (InstantiationException e) { - innerException = e; - } catch (IllegalAccessException e) { - innerException = e; - } catch (InvocationTargetException e) { - innerException = e; - } - throw OAuth2Utils.exceptionWithCause(new IOException(String.format( - "Application Default Credentials failed to create the Google App Engine service account" - + " credentials class %s. Check that the component 'google-api-client-appengine' is" - + " deployed.", - APP_ENGINE_CREDENTIAL_CLASS)), innerException); - } - - private final GoogleCredential tryGetComputeCredential( - HttpTransport transport, JsonFactory jsonFactory) { - // Checking compute engine requires a round-trip, so check only once - if (checkedComputeEngine) { - return null; - } - boolean runningOnComputeEngine = OAuth2Utils.runningOnComputeEngine(transport); - checkedComputeEngine = true; - if (runningOnComputeEngine) { - return new ComputeGoogleCredential(transport, jsonFactory); - } - return null; - } - - private static class ComputeGoogleCredential extends GoogleCredential { - - /** Metadata Service Account token server encoded URL. */ - private static final String TOKEN_SERVER_ENCODED_URL = - "http://metadata/computeMetadata/v1/instance/service-accounts/default/token"; - - ComputeGoogleCredential(HttpTransport transport, JsonFactory jsonFactory) { - super(new GoogleCredential.Builder() - .setTransport(transport) - .setJsonFactory(jsonFactory) - .setTokenServerEncodedUrl(TOKEN_SERVER_ENCODED_URL)); - } - - @Override - protected TokenResponse executeRefreshToken() throws IOException { - GenericUrl tokenUrl = new GenericUrl(getTokenServerEncodedUrl()); - HttpRequest request = getTransport().createRequestFactory().buildGetRequest(tokenUrl); - JsonObjectParser parser = new JsonObjectParser(getJsonFactory()); - request.setParser(parser); - request.getHeaders().set("X-Google-Metadata-Request", true); - request.setThrowExceptionOnExecuteError(false); - HttpResponse response = request.execute(); - int statusCode = response.getStatusCode(); - if (statusCode == HttpStatusCodes.STATUS_CODE_OK) { - InputStream content = response.getContent(); - if (content == null) { - // Throw explicitly rather than allow a later null reference as default mock - // transports return success codes with empty contents. - throw new IOException("Empty content from metadata token server request."); - } - return parser.parseAndClose(content, response.getContentCharset(), TokenResponse.class); - } - if (statusCode == HttpStatusCodes.STATUS_CODE_NOT_FOUND) { - throw new IOException(String.format("Error code %s trying to get security access token from" - + " Compute Engine metadata for the default service account. This may be because" - + " the virtual machine instance does not have permission scopes specified.", - statusCode)); - } - throw new IOException(String.format("Unexpected Error code %s trying to get security access" - + " token from Compute Engine metadata for the default service account: %s", statusCode, - response.parseAsString())); - } - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow.java deleted file mode 100644 index 3ce4cb70..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow.java +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.oauth2.AuthorizationCodeFlow; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.ClientParametersAuthentication; -import com.google.api.client.auth.oauth2.Credential.AccessMethod; -import com.google.api.client.auth.oauth2.CredentialRefreshListener; -import com.google.api.client.auth.oauth2.CredentialStore; -import com.google.api.client.auth.oauth2.StoredCredential; -import com.google.api.client.auth.oauth2.TokenResponse; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Clock; -import com.google.api.client.util.Preconditions; -import com.google.api.client.util.store.DataStore; -import com.google.api.client.util.store.DataStoreFactory; - -import java.io.IOException; -import java.util.Collection; - -/** - * Thread-safe Google OAuth 2.0 authorization code flow that manages and persists end-user - * credentials. - * - *

- * This is designed to simplify the flow in which an end-user authorizes the application to access - * their protected data, and then the application has access to their data based on an access token - * and a refresh token to refresh that access token when it expires. - *

- * - *

- * The first step is to call {@link #loadCredential(String)} based on the known user ID to check if - * the end-user's credentials are already known. If not, call {@link #newAuthorizationUrl()} and - * direct the end-user's browser to an authorization page. The web browser will then redirect to the - * redirect URL with a {@code "code"} query parameter which can then be used to request an access - * token using {@link #newTokenRequest(String)}. Finally, use - * {@link #createAndStoreCredential(TokenResponse, String)} to store and obtain a credential for - * accessing protected resources. - *

- * - *

- * The default for the {@code approval_prompt} and {@code access_type} parameters is {@code null}. - * For web applications that means {@code "approval_prompt=auto&access_type=online"} and for - * installed applications that means {@code "approval_prompt=force&access_type=offline"}. To - * override the default, you need to explicitly call {@link Builder#setApprovalPrompt(String)} and - * {@link Builder#setAccessType(String)}. - *

- * - * @author Yaniv Inbar - * @since 1.7 - */ -@SuppressWarnings("deprecation") -public class GoogleAuthorizationCodeFlow extends AuthorizationCodeFlow { - - /** - * Prompt for consent behavior ({@code "auto"} to request auto-approval or {@code "force"} to - * force the approval UI to show) or {@code null} for the default behavior. - */ - private final String approvalPrompt; - - /** - * Access type ({@code "online"} to request online access or {@code "offline"} to request offline - * access) or {@code null} for the default behavior. - */ - private final String accessType; - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - * @param clientId client identifier - * @param clientSecret client secret - * @param scopes collection of scopes to be joined by a space separator - * - * @since 1.15 - */ - public GoogleAuthorizationCodeFlow(HttpTransport transport, JsonFactory jsonFactory, - String clientId, String clientSecret, Collection scopes) { - this(new Builder(transport, jsonFactory, clientId, clientSecret, scopes)); - } - - /** - * @param builder Google authorization code flow builder - * - * @since 1.14 - */ - protected GoogleAuthorizationCodeFlow(Builder builder) { - super(builder); - accessType = builder.accessType; - approvalPrompt = builder.approvalPrompt; - } - - @Override - public GoogleAuthorizationCodeTokenRequest newTokenRequest(String authorizationCode) { - // don't need to specify clientId & clientSecret because specifying clientAuthentication - // don't want to specify redirectUri to give control of it to user of this class - return new GoogleAuthorizationCodeTokenRequest(getTransport(), getJsonFactory(), - getTokenServerEncodedUrl(), "", "", authorizationCode, "").setClientAuthentication( - getClientAuthentication()) - .setRequestInitializer(getRequestInitializer()).setScopes(getScopes()); - } - - @Override - public GoogleAuthorizationCodeRequestUrl newAuthorizationUrl() { - // don't want to specify redirectUri to give control of it to user of this class - return new GoogleAuthorizationCodeRequestUrl( - getAuthorizationServerEncodedUrl(), getClientId(), "", getScopes()).setAccessType( - accessType).setApprovalPrompt(approvalPrompt); - } - - /** - * Returns the approval prompt behavior ({@code "auto"} to request auto-approval or - * {@code "force"} to force the approval UI to show) or {@code null} for the default behavior of - * {@code "auto"}. - */ - public final String getApprovalPrompt() { - return approvalPrompt; - } - - /** - * Returns the access type ({@code "online"} to request online access or {@code "offline"} to - * request offline access) or {@code null} for the default behavior of {@code "online"}. - */ - public final String getAccessType() { - return accessType; - } - - /** - * Google authorization code flow builder. - * - *

- * Implementation is not thread-safe. - *

- */ - public static class Builder extends AuthorizationCodeFlow.Builder { - - /** - * Prompt for consent behavior ({@code "auto"} to request auto-approval or {@code "force"} to - * force the approval UI to show) or {@code null} for the default behavior. - */ - String approvalPrompt; - - /** - * Access type ({@code "online"} to request online access or {@code "offline"} to request - * offline access) or {@code null} for the default behavior. - */ - String accessType; - - /** - * - * @param transport HTTP transport - * @param jsonFactory JSON factory - * @param clientId client identifier - * @param clientSecret client secret - * @param scopes collection of scopes to be joined by a space separator (or a single value - * containing multiple space-separated scopes) - * - * @since 1.15 - */ - public Builder(HttpTransport transport, JsonFactory jsonFactory, String clientId, - String clientSecret, Collection scopes) { - super(BearerToken.authorizationHeaderAccessMethod(), transport, jsonFactory, new GenericUrl( - GoogleOAuthConstants.TOKEN_SERVER_URL), new ClientParametersAuthentication( - clientId, clientSecret), clientId, GoogleOAuthConstants.AUTHORIZATION_SERVER_URL); - setScopes(scopes); - } - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - * @param clientSecrets Google client secrets - * @param scopes collection of scopes to be joined by a space separator - * - * @since 1.15 - */ - public Builder(HttpTransport transport, JsonFactory jsonFactory, - GoogleClientSecrets clientSecrets, Collection scopes) { - super(BearerToken.authorizationHeaderAccessMethod(), transport, jsonFactory, new GenericUrl( - GoogleOAuthConstants.TOKEN_SERVER_URL), new ClientParametersAuthentication( - clientSecrets.getDetails().getClientId(), clientSecrets.getDetails().getClientSecret()), - clientSecrets.getDetails().getClientId(), GoogleOAuthConstants.AUTHORIZATION_SERVER_URL); - setScopes(scopes); - } - - @Override - public GoogleAuthorizationCodeFlow build() { - return new GoogleAuthorizationCodeFlow(this); - } - - @Override - public Builder setDataStoreFactory(DataStoreFactory dataStore) throws IOException { - return (Builder) super.setDataStoreFactory(dataStore); - } - - @Override - public Builder setCredentialDataStore(DataStore typedDataStore) { - return (Builder) super.setCredentialDataStore(typedDataStore); - } - - @Override - public Builder setCredentialCreatedListener( - CredentialCreatedListener credentialCreatedListener) { - return (Builder) super.setCredentialCreatedListener(credentialCreatedListener); - } - - @Beta - @Override - @Deprecated - public Builder setCredentialStore(CredentialStore credentialStore) { - return (Builder) super.setCredentialStore(credentialStore); - } - - @Override - public Builder setRequestInitializer(HttpRequestInitializer requestInitializer) { - return (Builder) super.setRequestInitializer(requestInitializer); - } - - @Override - public Builder setScopes(Collection scopes) { - Preconditions.checkState(!scopes.isEmpty()); - return (Builder) super.setScopes(scopes); - } - - /** - * @since 1.11 - */ - @Override - public Builder setMethod(AccessMethod method) { - return (Builder) super.setMethod(method); - } - - /** - * @since 1.11 - */ - @Override - public Builder setTransport(HttpTransport transport) { - return (Builder) super.setTransport(transport); - } - - /** - * @since 1.11 - */ - @Override - public Builder setJsonFactory(JsonFactory jsonFactory) { - return (Builder) super.setJsonFactory(jsonFactory); - } - - /** - * @since 1.11 - */ - @Override - public Builder setTokenServerUrl(GenericUrl tokenServerUrl) { - return (Builder) super.setTokenServerUrl(tokenServerUrl); - } - - /** - * @since 1.11 - */ - @Override - public Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication) { - return (Builder) super.setClientAuthentication(clientAuthentication); - } - - /** - * @since 1.11 - */ - @Override - public Builder setClientId(String clientId) { - return (Builder) super.setClientId(clientId); - } - - /** - * @since 1.11 - */ - @Override - public Builder setAuthorizationServerEncodedUrl(String authorizationServerEncodedUrl) { - return (Builder) super.setAuthorizationServerEncodedUrl(authorizationServerEncodedUrl); - } - - /** - * @since 1.11 - */ - @Override - public Builder setClock(Clock clock) { - return (Builder) super.setClock(clock); - } - - @Override - public Builder addRefreshListener(CredentialRefreshListener refreshListener) { - return (Builder) super.addRefreshListener(refreshListener); - } - - @Override - public Builder setRefreshListeners(Collection refreshListeners) { - return (Builder) super.setRefreshListeners(refreshListeners); - } - - /** - * Sets the approval prompt behavior ({@code "auto"} to request auto-approval or {@code "force"} - * to force the approval UI to show) or {@code null} for the default behavior ({@code "auto"} - * for web applications and {@code "force"} for installed applications). - * - *

- * By default this has the value {@code null}. - *

- * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setApprovalPrompt(String approvalPrompt) { - this.approvalPrompt = approvalPrompt; - return this; - } - - /** - * Returns the approval prompt behavior ({@code "auto"} to request auto-approval or - * {@code "force"} to force the approval UI to show) or {@code null} for the default behavior of - * {@code "auto"}. - */ - public final String getApprovalPrompt() { - return approvalPrompt; - } - - /** - * Sets the access type ({@code "online"} to request online access or {@code "offline"} to - * request offline access) or {@code null} for the default behavior ({@code "online"} for web - * applications and {@code "offline"} for installed applications). - * - *

- * By default this has the value {@code null}. - *

- * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setAccessType(String accessType) { - this.accessType = accessType; - return this; - } - - /** - * Returns the access type ({@code "online"} to request online access or {@code "offline"} to - * request offline access) or {@code null} for the default behavior of {@code "online"}. - */ - public final String getAccessType() { - return accessType; - } - } -} 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 deleted file mode 100644 index 386c3d7d..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeRequestUrl.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.oauth2.AuthorizationCodeRequestUrl; -import com.google.api.client.auth.oauth2.AuthorizationCodeResponseUrl; -import com.google.api.client.util.Key; -import com.google.api.client.util.Preconditions; - -import java.util.Collection; - -/** - * Google-specific implementation of the OAuth 2.0 URL builder for an authorization web page to - * allow the end user to authorize the application to access their protected resources and that - * returns an authorization code, as specified in Using OAuth 2.0 for Web Server - * Applications. - * - *

- * The default for {@link #getResponseTypes()} is {@code "code"}. Use - * {@link AuthorizationCodeResponseUrl} to parse the redirect response after the end user - * grants/denies the request. Using the authorization code in this response, use - * {@link GoogleAuthorizationCodeTokenRequest} to request the access token. - *

- * - *

- * Sample usage for a web application: - *

- * - *
-  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);
-  }
- * 
- * - *

- * Implementation is not thread-safe. - *

- * - * @since 1.7 - * @author Yaniv Inbar - */ -public class GoogleAuthorizationCodeRequestUrl extends AuthorizationCodeRequestUrl { - - /** - * Prompt for consent behavior ({@code "auto"} to request auto-approval or {@code "force"} to - * force the approval UI to show) or {@code null} for the default behavior. - */ - @Key("approval_prompt") - private String approvalPrompt; - - /** - * Access type ({@code "online"} to request online access or {@code "offline"} to request offline - * access) or {@code null} for the default behavior. - */ - @Key("access_type") - private String accessType; - - /** - * @param clientId client identifier - * @param redirectUri URI that the authorization server directs the resource owner's user-agent - * back to the client after a successful authorization grant - * @param scopes scopes (see {@link #setScopes(Collection)}) - * - * @since 1.15 - */ - public GoogleAuthorizationCodeRequestUrl( - String clientId, String redirectUri, Collection scopes) { - this(GoogleOAuthConstants.AUTHORIZATION_SERVER_URL, clientId, redirectUri, scopes); - } - - /** - * @param authorizationServerEncodedUrl authorization server encoded URL - * @param clientId client identifier - * @param redirectUri URI that the authorization server directs the resource owner's user-agent - * back to the client after a successful authorization grant - * @param scopes scopes (see {@link #setScopes(Collection)}) - * - * @since 1.15 - */ - public GoogleAuthorizationCodeRequestUrl(String authorizationServerEncodedUrl, String clientId, - String redirectUri, Collection scopes) { - super(authorizationServerEncodedUrl, clientId); - setRedirectUri(redirectUri); - setScopes(scopes); - } - - /** - * @param clientSecrets OAuth 2.0 client secrets JSON model as specified in - * client_secrets.json file format - * @param redirectUri URI that the authorization server directs the resource owner's user-agent - * back to the client after a successful authorization grant - * @param scopes scopes (see {@link #setScopes(Collection)}) - * - * @since 1.15 - */ - public GoogleAuthorizationCodeRequestUrl( - GoogleClientSecrets clientSecrets, String redirectUri, Collection scopes) { - this(clientSecrets.getDetails().getClientId(), redirectUri, scopes); - } - - /** - * Returns the approval prompt behavior ({@code "auto"} to request auto-approval or - * {@code "force"} to force the approval UI to show) or {@code null} for the default behavior of - * {@code "auto"}. - */ - public final String getApprovalPrompt() { - return approvalPrompt; - } - - /** - * Sets the approval prompt behavior ({@code "auto"} to request auto-approval or {@code "force"} - * to force the approval UI to show) or {@code null} for the default behavior of {@code "auto"}. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public GoogleAuthorizationCodeRequestUrl setApprovalPrompt(String approvalPrompt) { - this.approvalPrompt = approvalPrompt; - return this; - } - - /** - * Returns the access type ({@code "online"} to request online access or {@code "offline"} to - * request offline access) or {@code null} for the default behavior of {@code "online"}. - */ - public final String getAccessType() { - return accessType; - } - - /** - * Sets the access type ({@code "online"} to request online access or {@code "offline"} to request - * offline access) or {@code null} for the default behavior of {@code "online"}. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public GoogleAuthorizationCodeRequestUrl setAccessType(String accessType) { - this.accessType = accessType; - return this; - } - - @Override - public GoogleAuthorizationCodeRequestUrl setResponseTypes(Collection responseTypes) { - return (GoogleAuthorizationCodeRequestUrl) super.setResponseTypes(responseTypes); - } - - @Override - public GoogleAuthorizationCodeRequestUrl setRedirectUri(String redirectUri) { - Preconditions.checkNotNull(redirectUri); - return (GoogleAuthorizationCodeRequestUrl) super.setRedirectUri(redirectUri); - } - - @Override - public GoogleAuthorizationCodeRequestUrl setScopes(Collection scopes) { - Preconditions.checkArgument(scopes.iterator().hasNext()); - return (GoogleAuthorizationCodeRequestUrl) super.setScopes(scopes); - } - - @Override - public GoogleAuthorizationCodeRequestUrl setClientId(String clientId) { - return (GoogleAuthorizationCodeRequestUrl) super.setClientId(clientId); - } - - @Override - public GoogleAuthorizationCodeRequestUrl setState(String state) { - return (GoogleAuthorizationCodeRequestUrl) super.setState(state); - } - - @Override - public GoogleAuthorizationCodeRequestUrl set(String fieldName, Object value) { - return (GoogleAuthorizationCodeRequestUrl) super.set(fieldName, value); - } - - @Override - public GoogleAuthorizationCodeRequestUrl clone() { - return (GoogleAuthorizationCodeRequestUrl) super.clone(); - } -} 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 deleted file mode 100644 index b3d7d77a..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeTokenRequest.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.oauth2.AuthorizationCodeTokenRequest; -import com.google.api.client.auth.oauth2.ClientParametersAuthentication; -import com.google.api.client.auth.oauth2.TokenResponse; -import com.google.api.client.auth.oauth2.TokenResponseException; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.util.Preconditions; - -import java.io.IOException; -import java.util.Collection; - -/** - * 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). - * - *

- * 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 TokenResponseException}. - *

- * - *

- * Sample usage: - *

- * - *
-  static void requestAccessToken() throws IOException {
-    try {
-      GoogleTokenResponse response =
-          new GoogleAuthorizationCodeTokenRequest(new NetHttpTransport(), new JacksonFactory(),
-              "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());
-      }
-    }
-  }
- * 
- * - *

- * Implementation is not thread-safe. - *

- * - * @since 1.7 - * @author Yaniv Inbar - */ -public class GoogleAuthorizationCodeTokenRequest extends AuthorizationCodeTokenRequest { - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - * @param clientId client identifier issued to the client during the registration process - * @param clientSecret client secret - * @param code authorization code generated by the authorization server - * @param redirectUri redirect URL parameter matching the redirect URL parameter in the - * authorization request (see {@link #setRedirectUri(String)} - */ - public GoogleAuthorizationCodeTokenRequest(HttpTransport transport, JsonFactory jsonFactory, - String clientId, String clientSecret, String code, String redirectUri) { - this(transport, jsonFactory, GoogleOAuthConstants.TOKEN_SERVER_URL, clientId, clientSecret, - code, redirectUri); - } - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - * @param tokenServerEncodedUrl token server encoded URL - * @param clientId client identifier issued to the client during the registration process - * @param clientSecret client secret - * @param code authorization code generated by the authorization server - * @param redirectUri redirect URL parameter matching the redirect URL parameter in the - * authorization request (see {@link #setRedirectUri(String)} - * - * @since 1.12 - */ - public GoogleAuthorizationCodeTokenRequest(HttpTransport transport, JsonFactory jsonFactory, - String tokenServerEncodedUrl, String clientId, String clientSecret, String code, - String redirectUri) { - super(transport, jsonFactory, new GenericUrl(tokenServerEncodedUrl), code); - setClientAuthentication(new ClientParametersAuthentication(clientId, clientSecret)); - setRedirectUri(redirectUri); - } - - @Override - public GoogleAuthorizationCodeTokenRequest setRequestInitializer( - HttpRequestInitializer requestInitializer) { - return (GoogleAuthorizationCodeTokenRequest) super.setRequestInitializer(requestInitializer); - } - - @Override - public GoogleAuthorizationCodeTokenRequest setTokenServerUrl(GenericUrl tokenServerUrl) { - return (GoogleAuthorizationCodeTokenRequest) super.setTokenServerUrl(tokenServerUrl); - } - - @Override - public GoogleAuthorizationCodeTokenRequest setScopes(Collection scopes) { - return (GoogleAuthorizationCodeTokenRequest) super.setScopes(scopes); - } - - @Override - public GoogleAuthorizationCodeTokenRequest setGrantType(String grantType) { - return (GoogleAuthorizationCodeTokenRequest) super.setGrantType(grantType); - } - - @Override - public GoogleAuthorizationCodeTokenRequest setClientAuthentication( - HttpExecuteInterceptor clientAuthentication) { - Preconditions.checkNotNull(clientAuthentication); - return (GoogleAuthorizationCodeTokenRequest) super.setClientAuthentication( - clientAuthentication); - } - - @Override - public GoogleAuthorizationCodeTokenRequest setCode(String code) { - return (GoogleAuthorizationCodeTokenRequest) super.setCode(code); - } - - @Override - public GoogleAuthorizationCodeTokenRequest setRedirectUri(String redirectUri) { - Preconditions.checkNotNull(redirectUri); - return (GoogleAuthorizationCodeTokenRequest) super.setRedirectUri(redirectUri); - } - - @Override - public GoogleTokenResponse execute() throws IOException { - return executeUnparsed().parseAs(GoogleTokenResponse.class); - } - - @Override - public GoogleAuthorizationCodeTokenRequest set(String fieldName, Object value) { - return (GoogleAuthorizationCodeTokenRequest) super.set(fieldName, value); - } -} 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 deleted file mode 100644 index a7da93a9..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleBrowserClientRequestUrl.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.oauth2.BrowserClientRequestUrl; -import com.google.api.client.util.Key; -import com.google.api.client.util.Preconditions; - -import java.util.Collection; - -/** - * Google-specific implementation of the OAuth 2.0 URL builder for an authorization web page to - * allow the end user to authorize the application to access their protected resources and that - * returns the access token to a browser client using a scripting language such as JavaScript, as - * specified in Using OAuth - * 2.0 for Client-side Applications. - * - *

- * The default for {@link #getResponseTypes()} is {@code "token"}. - *

- * - *

- * Sample usage for a web application: - *

- * - *
-  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);
-  }
- * 
- * - *

- * Implementation is not thread-safe. - *

- * - * @since 1.7 - * @author Yaniv Inbar - */ -public class GoogleBrowserClientRequestUrl extends BrowserClientRequestUrl { - - /** - * Prompt for consent behavior ({@code "auto"} to request auto-approval or {@code "force"} to - * force the approval UI to show) or {@code null} for the default behavior. - */ - @Key("approval_prompt") - private String approvalPrompt; - - /** - * @param clientId client identifier - * @param redirectUri URI that the authorization server directs the resource owner's user-agent - * back to the client after a successful authorization grant - * @param scopes scopes (see {@link #setScopes(Collection)}) - * - * @since 1.15 - */ - public GoogleBrowserClientRequestUrl( - String clientId, String redirectUri, Collection scopes) { - super(GoogleOAuthConstants.AUTHORIZATION_SERVER_URL, clientId); - setRedirectUri(redirectUri); - setScopes(scopes); - } - - /** - * @param clientSecrets OAuth 2.0 client secrets JSON model as specified in - * client_secrets.json file format - * @param redirectUri URI that the authorization server directs the resource owner's user-agent - * back to the client after a successful authorization grant - * @param scopes scopes (see {@link #setScopes(Collection)}) - * - * @since 1.15 - */ - public GoogleBrowserClientRequestUrl( - GoogleClientSecrets clientSecrets, String redirectUri, Collection scopes) { - this(clientSecrets.getDetails().getClientId(), redirectUri, scopes); - } - - /** - * Returns the approval prompt behavior ({@code "auto"} to request auto-approval or - * {@code "force"} to force the approval UI to show) or {@code null} for the default behavior of - * {@code "auto"}. - */ - public final String getApprovalPrompt() { - return approvalPrompt; - } - - /** - * Sets the approval prompt behavior ({@code "auto"} to request auto-approval or {@code "force"} - * to force the approval UI to show) or {@code null} for the default behavior of {@code "auto"}. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public GoogleBrowserClientRequestUrl setApprovalPrompt(String approvalPrompt) { - this.approvalPrompt = approvalPrompt; - return this; - } - - @Override - public GoogleBrowserClientRequestUrl setResponseTypes(Collection responseTypes) { - return (GoogleBrowserClientRequestUrl) super.setResponseTypes(responseTypes); - } - - @Override - public GoogleBrowserClientRequestUrl setRedirectUri(String redirectUri) { - return (GoogleBrowserClientRequestUrl) super.setRedirectUri(redirectUri); - } - - @Override - public GoogleBrowserClientRequestUrl setScopes(Collection scopes) { - Preconditions.checkArgument(scopes.iterator().hasNext()); - return (GoogleBrowserClientRequestUrl) super.setScopes(scopes); - } - - @Override - public GoogleBrowserClientRequestUrl setClientId(String clientId) { - return (GoogleBrowserClientRequestUrl) super.setClientId(clientId); - } - - @Override - public GoogleBrowserClientRequestUrl setState(String state) { - return (GoogleBrowserClientRequestUrl) super.setState(state); - } - - @Override - public GoogleBrowserClientRequestUrl set(String fieldName, Object value) { - return (GoogleBrowserClientRequestUrl) super.set(fieldName, value); - } - - @Override - public GoogleBrowserClientRequestUrl clone() { - return (GoogleBrowserClientRequestUrl) super.clone(); - } -} 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 deleted file mode 100644 index 894cb9ca..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleClientSecrets.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.json.GenericJson; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.util.Key; -import com.google.api.client.util.Preconditions; - -import java.io.IOException; -import java.io.Reader; -import java.util.List; - -/** - * OAuth 2.0 client secrets JSON model as specified in client_secrets.json - * file format. - * - *

- * Sample usage: - *

- * - *
-  static GoogleClientSecrets loadClientSecretsResource(JsonFactory jsonFactory) throws IOException {
-    return GoogleClientSecrets.load(
-        jsonFactory,
-        new InputStreamReader(
-            SampleClass.class.getResourceAsStream("/client_secrets.json"), "UTF-8"));
-  }
- * 
- * - * @since 1.7 - * @author Yaniv Inbar - */ -public final class GoogleClientSecrets extends GenericJson { - - /** Details for installed applications. */ - @Key - private Details installed; - - /** Details for web applications. */ - @Key - private Details web; - - /** Returns the details for installed applications. */ - public Details getInstalled() { - return installed; - } - - /** Sets the details for installed applications. */ - public GoogleClientSecrets setInstalled(Details installed) { - this.installed = installed; - return this; - } - - /** Returns the details for web applications. */ - public Details getWeb() { - return web; - } - - /** Sets the details for web applications. */ - public GoogleClientSecrets setWeb(Details web) { - this.web = web; - return this; - } - - /** Returns the details for either installed or web applications. */ - public Details getDetails() { - // that web or installed, but not both - Preconditions.checkArgument((web == null) != (installed == null)); - return web == null ? installed : web; - } - - /** Client credential details. */ - public static final class Details extends GenericJson { - - /** Client ID. */ - @Key("client_id") - private String clientId; - - /** Client secret. */ - @Key("client_secret") - private String clientSecret; - - /** Redirect URIs. */ - @Key("redirect_uris") - private List redirectUris; - - /** Authorization server URI. */ - @Key("auth_uri") - private String authUri; - - /** Token server URI. */ - @Key("token_uri") - private String tokenUri; - - /** Returns the client ID. */ - public String getClientId() { - return clientId; - } - - /** Sets the client ID. */ - public Details setClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** Returns the client secret. */ - public String getClientSecret() { - return clientSecret; - } - - /** Sets the client secret. */ - public Details setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** Returns the redirect URIs. */ - public List getRedirectUris() { - return redirectUris; - } - - /** Sets the redirect URIs. */ - public Details setRedirectUris(List redirectUris) { - this.redirectUris = redirectUris; - return this; - } - - /** Returns the authorization server URI. */ - public String getAuthUri() { - return authUri; - } - - /** Sets the authorization server URI. */ - public Details setAuthUri(String authUri) { - this.authUri = authUri; - return this; - } - - /** Returns the token server URI. */ - public String getTokenUri() { - return tokenUri; - } - - /** Sets the token server URI. */ - public Details setTokenUri(String tokenUri) { - this.tokenUri = tokenUri; - return this; - } - - @Override - public Details set(String fieldName, Object value) { - return (Details) super.set(fieldName, value); - } - - @Override - public Details clone() { - return (Details) super.clone(); - } - } - - @Override - public GoogleClientSecrets set(String fieldName, Object value) { - return (GoogleClientSecrets) super.set(fieldName, value); - } - - @Override - public GoogleClientSecrets clone() { - return (GoogleClientSecrets) super.clone(); - } - - /** - * Loads the {@code client_secrets.json} file from the given reader. - * - * @since 1.15 - */ - public static GoogleClientSecrets load(JsonFactory jsonFactory, Reader reader) - throws IOException { - return jsonFactory.fromReader(reader, GoogleClientSecrets.class); - } -} 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 deleted file mode 100644 index 6948e529..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.java +++ /dev/null @@ -1,826 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.ClientParametersAuthentication; -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.auth.oauth2.CredentialRefreshListener; -import com.google.api.client.auth.oauth2.DataStoreCredentialRefreshListener; -import com.google.api.client.auth.oauth2.TokenRequest; -import com.google.api.client.auth.oauth2.TokenResponse; -import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets.Details; -import com.google.api.client.googleapis.util.Utils; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.HttpUnsuccessfulResponseHandler; -import com.google.api.client.json.GenericJson; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonObjectParser; -import com.google.api.client.json.webtoken.JsonWebSignature; -import com.google.api.client.json.webtoken.JsonWebToken; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Clock; -import com.google.api.client.util.Joiner; -import com.google.api.client.util.PemReader; -import com.google.api.client.util.PemReader.Section; -import com.google.api.client.util.Preconditions; -import com.google.api.client.util.SecurityUtils; -import com.google.api.client.util.store.DataStoreFactory; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.Reader; -import java.io.StringReader; -import java.security.GeneralSecurityException; -import java.security.KeyFactory; -import java.security.NoSuchAlgorithmException; -import java.security.PrivateKey; -import java.security.spec.InvalidKeySpecException; -import java.security.spec.PKCS8EncodedKeySpec; -import java.util.Collection; -import java.util.Collections; - -/** - * Thread-safe Google-specific implementation of the OAuth 2.0 helper for accessing protected - * resources using an access token, as well as optionally refreshing the access token when it - * expires using a refresh token. - * - *

- * There are three modes supported: access token only, refresh token flow, and service account flow - * (with or without impersonating a user). - *

- * - *

- * If all you have is an access token, you simply pass the {@link TokenResponse} to the credential - * using {@link Builder#setFromTokenResponse(TokenResponse)}. Google credential uses - * {@link BearerToken#authorizationHeaderAccessMethod()} as the access method. Sample usage: - *

- * - *
-  public static GoogleCredential createCredentialWithAccessTokenOnly(TokenResponse tokenResponse) {
-    return new GoogleCredential().setFromTokenResponse(tokenResponse);
-  }
- * 
- * - *

- * 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 Builder#setClientSecrets(GoogleClientSecrets)} or - * {@link Builder#setClientSecrets(String, String)}. Google credential uses - * {@link GoogleOAuthConstants#TOKEN_SERVER_URL} as the token server URL, and - * {@link ClientParametersAuthentication} with the client ID and secret as the client - * authentication. Sample usage: - *

- * - *
-  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);
-  }
- * 
- * - *

- * 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: - *

- * - *
-  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();
-  }
- * 
- * - *

- * 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: - *

- * - *
-  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();
-  }
- * 
- * - *

- * If you need to persist the access token in a data store, use {@link DataStoreFactory} and - * {@link Builder#addRefreshListener(CredentialRefreshListener)} with - * {@link DataStoreCredentialRefreshListener}. - *

- * - *

- * If you have a custom request initializer, request execute interceptor, or unsuccessful response - * handler, take a look at the sample usage for {@link HttpExecuteInterceptor} and - * {@link HttpUnsuccessfulResponseHandler}, which are interfaces that this class also implements. - *

- * - * @since 1.7 - * @author Yaniv Inbar - */ -public class GoogleCredential extends Credential { - - static final String USER_FILE_TYPE = "authorized_user"; - static final String SERVICE_ACCOUNT_FILE_TYPE = "service_account"; - - @Beta - private static DefaultCredentialProvider defaultCredentialProvider = - new DefaultCredentialProvider(); - - /** - * {@link Beta}
- * Returns the Application Default Credentials. - * - *

Returns the Application Default Credentials which are credentials that identify and - * authorize the whole application. This is the built-in service account if running on Google - * Compute Engine or the credentials file from the path in the environment variable - * GOOGLE_APPLICATION_CREDENTIALS.

- * - * @return the credential instance. - * @throws IOException if the credential cannot be created in the current environment. - */ - @Beta - public static GoogleCredential getApplicationDefault() throws IOException { - return getApplicationDefault(Utils.getDefaultTransport(), Utils.getDefaultJsonFactory()); - } - - /** - * {@link Beta}
- * Returns the Application Default Credentials. - * - *

Returns the Application Default Credentials which are credentials that identify and - * authorize the whole application. This is the built-in service account if running on Google - * Compute Engine or the credentials file from the path in the environment variable - * GOOGLE_APPLICATION_CREDENTIALS.

- * - * @param transport the transport for Http calls. - * @param jsonFactory the factory for Json parsing and formatting. - * @return the credential instance. - * @throws IOException if the credential cannot be created in the current environment. - */ - @Beta - public static GoogleCredential getApplicationDefault( - HttpTransport transport, JsonFactory jsonFactory) throws IOException { - Preconditions.checkNotNull(transport); - Preconditions.checkNotNull(jsonFactory); - return defaultCredentialProvider.getDefaultCredential(transport, jsonFactory); - } - - /** - * {@link Beta}
- * Return a credential defined by a Json file. - * - * @param credentialStream the stream with the credential definition. - * @return the credential defined by the credentialStream. - * @throws IOException if the credential cannot be created from the stream. - */ - @Beta - public static GoogleCredential fromStream(InputStream credentialStream) throws IOException { - return fromStream( - credentialStream, - Utils.getDefaultTransport(), - Utils.getDefaultJsonFactory()); - } - - /** - * {@link Beta}
- * Return a credential defined by a Json file. - * - * @param credentialStream the stream with the credential definition. - * @param transport the transport for Http calls. - * @param jsonFactory the factory for Json parsing and formatting. - * @return the credential defined by the credentialStream. - * @throws IOException if the credential cannot be created from the stream. - */ - @Beta - public static GoogleCredential fromStream(InputStream credentialStream, HttpTransport transport, - JsonFactory jsonFactory) throws IOException { - Preconditions.checkNotNull(credentialStream); - Preconditions.checkNotNull(transport); - Preconditions.checkNotNull(jsonFactory); - - JsonObjectParser parser = new JsonObjectParser(jsonFactory); - GenericJson fileContents = parser.parseAndClose( - credentialStream, OAuth2Utils.UTF_8, GenericJson.class); - String fileType = (String) fileContents.get("type"); - if (fileType == null) { - throw new IOException("Error reading credentials from stream, 'type' field not specified."); - } - if (USER_FILE_TYPE.equals(fileType)) { - return fromStreamUser(fileContents, transport, jsonFactory); - } - if (SERVICE_ACCOUNT_FILE_TYPE.equals(fileType)) { - return fromStreamServiceAccount(fileContents, transport, jsonFactory); - } - throw new IOException(String.format( - "Error reading credentials from stream, 'type' value '%s' not recognized." - + " Expecting '%s' or '%s'.", - fileType, USER_FILE_TYPE, SERVICE_ACCOUNT_FILE_TYPE)); - } - - /** - * Service account ID (typically an e-mail address) or {@code null} if not using the service - * account flow. - */ - private String serviceAccountId; - - /** - * Collection of OAuth scopes to use with the service account flow or {@code null} if not - * using the service account flow. - */ - private Collection serviceAccountScopes; - - /** - * Private key to use with the service account flow or {@code null} if not using the service - * account flow. - */ - private PrivateKey serviceAccountPrivateKey; - - /** - * ID of private key to use with the service account flow or {@code null} if not using the - * service account flow. - */ - private String serviceAccountPrivateKeyId; - - /** - * Email address of the user the application is trying to impersonate in the service account flow - * or {@code null} for none or if not using the service account flow. - */ - private String serviceAccountUser; - - /** - * Constructor with the ability to access protected resources, but not refresh tokens. - * - *

- * To use with the ability to refresh tokens, use {@link Builder}. - *

- */ - public GoogleCredential() { - this(new Builder()); - } - - /** - * @param builder Google credential builder - * - * @since 1.14 - */ - protected GoogleCredential(Builder builder) { - super(builder); - if (builder.serviceAccountPrivateKey == null) { - Preconditions.checkArgument(builder.serviceAccountId == null - && builder.serviceAccountScopes == null && builder.serviceAccountUser == null); - } else { - serviceAccountId = Preconditions.checkNotNull(builder.serviceAccountId); - serviceAccountScopes = Collections.unmodifiableCollection(builder.serviceAccountScopes); - serviceAccountPrivateKey = builder.serviceAccountPrivateKey; - serviceAccountPrivateKeyId = builder.serviceAccountPrivateKeyId; - serviceAccountUser = builder.serviceAccountUser; - } - } - - @Override - public GoogleCredential setAccessToken(String accessToken) { - return (GoogleCredential) super.setAccessToken(accessToken); - } - - @Override - public GoogleCredential setRefreshToken(String refreshToken) { - if (refreshToken != null) { - Preconditions.checkArgument( - getJsonFactory() != null && getTransport() != null && getClientAuthentication() != null, - "Please use the Builder and call setJsonFactory, setTransport and setClientSecrets"); - } - return (GoogleCredential) super.setRefreshToken(refreshToken); - } - - @Override - public GoogleCredential setExpirationTimeMilliseconds(Long expirationTimeMilliseconds) { - return (GoogleCredential) super.setExpirationTimeMilliseconds(expirationTimeMilliseconds); - } - - @Override - public GoogleCredential setExpiresInSeconds(Long expiresIn) { - return (GoogleCredential) super.setExpiresInSeconds(expiresIn); - } - - @Override - public GoogleCredential setFromTokenResponse(TokenResponse tokenResponse) { - return (GoogleCredential) super.setFromTokenResponse(tokenResponse); - } - - @Override - @Beta - protected TokenResponse executeRefreshToken() throws IOException { - if (serviceAccountPrivateKey == null) { - return super.executeRefreshToken(); - } - // service accounts: no refresh token; instead use private key to request new access token - JsonWebSignature.Header header = new JsonWebSignature.Header(); - header.setAlgorithm("RS256"); - header.setType("JWT"); - header.setKeyId(serviceAccountPrivateKeyId); - JsonWebToken.Payload payload = new JsonWebToken.Payload(); - long currentTime = getClock().currentTimeMillis(); - payload.setIssuer(serviceAccountId); - payload.setAudience(getTokenServerEncodedUrl()); - payload.setIssuedAtTimeSeconds(currentTime / 1000); - payload.setExpirationTimeSeconds(currentTime / 1000 + 3600); - payload.setSubject(serviceAccountUser); - payload.put("scope", Joiner.on(' ').join(serviceAccountScopes)); - try { - String assertion = JsonWebSignature.signUsingRsaSha256( - serviceAccountPrivateKey, getJsonFactory(), header, payload); - TokenRequest request = new TokenRequest( - getTransport(), getJsonFactory(), new GenericUrl(getTokenServerEncodedUrl()), - "urn:ietf:params:oauth:grant-type:jwt-bearer"); - request.put("assertion", assertion); - return request.execute(); - } catch (GeneralSecurityException exception) { - IOException e = new IOException(); - e.initCause(exception); - throw e; - } - } - - /** - * Returns the service account ID (typically an e-mail address) or {@code null} if not using the - * service account flow. - */ - public final String getServiceAccountId() { - return serviceAccountId; - } - - /** - * Returns a collection of OAuth scopes to use with the service account flow or {@code null} - * if not using the service account flow. - */ - public final Collection getServiceAccountScopes() { - return serviceAccountScopes; - } - - /** - * Returns the space-separated OAuth scopes to use with the service account flow or - * {@code null} if not using the service account flow. - * - * @since 1.15 - */ - public final String getServiceAccountScopesAsString() { - return serviceAccountScopes == null ? null : Joiner.on(' ').join(serviceAccountScopes); - } - - /** - * Returns the private key to use with the service account flow or {@code null} if not using - * the service account flow. - */ - public final PrivateKey getServiceAccountPrivateKey() { - return serviceAccountPrivateKey; - } - - /** - * {@link Beta}
- * Returns the ID of the private key to use with the service account flow or {@code null} if - * not using the service account flow. - */ - @Beta - public final String getServiceAccountPrivateKeyId() { - return serviceAccountPrivateKeyId; - } - - /** - * Returns the email address of the user the application is trying to impersonate in the service - * account flow or {@code null} for none or if not using the service account flow. - */ - public final String getServiceAccountUser() { - return serviceAccountUser; - } - - /** - * {@link Beta}
- * Indicates whether the credential requires scopes to be specified by calling createScoped - * before use. - */ - @Beta - public boolean createScopedRequired() { - if (serviceAccountPrivateKey == null) { - return false; - } - return (serviceAccountScopes == null || serviceAccountScopes.isEmpty()); - } - - /** - * {@link Beta}
- * For credentials that require scopes, creates a copy of the credential with the specified - * scopes. - */ - @Beta - public GoogleCredential createScoped(Collection scopes) { - if (serviceAccountPrivateKey == null) { - return this; - } - return new GoogleCredential.Builder() - .setServiceAccountPrivateKey(serviceAccountPrivateKey) - .setServiceAccountPrivateKeyId(serviceAccountPrivateKeyId) - .setServiceAccountId(serviceAccountId) - .setServiceAccountUser(serviceAccountUser) - .setServiceAccountScopes(scopes) - .setTransport(getTransport()) - .setJsonFactory(getJsonFactory()) - .setClock(getClock()) - .build(); - } - - /** - * Google credential builder. - * - *

- * Implementation is not thread-safe. - *

- */ - public static class Builder extends Credential.Builder { - - /** Service account ID (typically an e-mail address) or {@code null} for none. */ - String serviceAccountId; - - /** - * Collection of OAuth scopes to use with the service account flow or {@code null} for none. - */ - Collection serviceAccountScopes; - - /** Private key to use with the service account flow or {@code null} for none. */ - PrivateKey serviceAccountPrivateKey; - - /** Id of the private key to use with the service account flow or {@code null} for none. */ - String serviceAccountPrivateKeyId; - - /** - * Email address of the user the application is trying to impersonate in the service account - * flow or {@code null} for none. - */ - String serviceAccountUser; - - public Builder() { - super(BearerToken.authorizationHeaderAccessMethod()); - setTokenServerEncodedUrl(GoogleOAuthConstants.TOKEN_SERVER_URL); - } - - @Override - public GoogleCredential build() { - return new GoogleCredential(this); - } - - @Override - public Builder setTransport(HttpTransport transport) { - return (Builder) super.setTransport(transport); - } - - @Override - public Builder setJsonFactory(JsonFactory jsonFactory) { - return (Builder) super.setJsonFactory(jsonFactory); - } - - /** - * @since 1.9 - */ - @Override - public Builder setClock(Clock clock) { - return (Builder) super.setClock(clock); - } - - /** - * Sets the client identifier and secret. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setClientSecrets(String clientId, String clientSecret) { - setClientAuthentication(new ClientParametersAuthentication(clientId, clientSecret)); - return this; - } - - /** - * Sets the client secrets. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setClientSecrets(GoogleClientSecrets clientSecrets) { - Details details = clientSecrets.getDetails(); - setClientAuthentication( - new ClientParametersAuthentication(details.getClientId(), details.getClientSecret())); - return this; - } - - /** - * Returns the service account ID (typically an e-mail address) or {@code null} for none. - */ - public final String getServiceAccountId() { - return serviceAccountId; - } - - /** - * Sets the service account ID (typically an e-mail address) or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setServiceAccountId(String serviceAccountId) { - this.serviceAccountId = serviceAccountId; - return this; - } - - /** - * Returns a collection of OAuth scopes to use with the service account flow or {@code null} - * for none. - */ - public final Collection getServiceAccountScopes() { - return serviceAccountScopes; - } - - /** - * Sets the space-separated OAuth scopes to use with the service account flow or - * {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- * - * @param serviceAccountScopes collection of scopes to be joined by a space separator (or a - * single value containing multiple space-separated scopes) - * @since 1.15 - */ - public Builder setServiceAccountScopes(Collection serviceAccountScopes) { - this.serviceAccountScopes = serviceAccountScopes; - return this; - } - - /** - * Returns the private key to use with the service account flow or {@code null} for none. - */ - public final PrivateKey getServiceAccountPrivateKey() { - return serviceAccountPrivateKey; - } - - /** - * Sets the private key to use with the service account flow or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setServiceAccountPrivateKey(PrivateKey serviceAccountPrivateKey) { - this.serviceAccountPrivateKey = serviceAccountPrivateKey; - return this; - } - - /** - * {@link Beta}
- * Returns the id of the private key to use with the service account flow or {@code null} - * for none. - */ - @Beta - public final String getServiceAccountPrivateKeyId() { - return serviceAccountPrivateKeyId; - } - - /** - * {@link Beta}
- * Sets the id of the private key to use with the service account flow or {@code null} for - * none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - @Beta - public Builder setServiceAccountPrivateKeyId(String serviceAccountPrivateKeyId) { - this.serviceAccountPrivateKeyId = serviceAccountPrivateKeyId; - return this; - } - - - /** - * Sets the private key to use with the service account flow or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- * - * @param p12File input stream to the p12 file (closed at the end of this method in a finally - * block) - */ - public Builder setServiceAccountPrivateKeyFromP12File(File p12File) - throws GeneralSecurityException, IOException { - serviceAccountPrivateKey = SecurityUtils.loadPrivateKeyFromKeyStore( - SecurityUtils.getPkcs12KeyStore(), new FileInputStream(p12File), "notasecret", - "privatekey", "notasecret"); - return this; - } - - /** - * {@link Beta}
- * Sets the private key to use with the service account flow or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- * - * @param pemFile input stream to the PEM file (closed at the end of this method in a finally - * block) - * @since 1.13 - */ - @Beta - public Builder setServiceAccountPrivateKeyFromPemFile(File pemFile) - throws GeneralSecurityException, IOException { - byte[] bytes = PemReader.readFirstSectionAndClose(new FileReader(pemFile), "PRIVATE KEY") - .getBase64DecodedBytes(); - serviceAccountPrivateKey = - SecurityUtils.getRsaKeyFactory().generatePrivate(new PKCS8EncodedKeySpec(bytes)); - return this; - } - - /** - * Returns the email address of the user the application is trying to impersonate in the service - * account flow or {@code null} for none. - */ - public final String getServiceAccountUser() { - return serviceAccountUser; - } - - /** - * Sets the email address of the user the application is trying to impersonate in the service - * account flow or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setServiceAccountUser(String serviceAccountUser) { - this.serviceAccountUser = serviceAccountUser; - return this; - } - - @Override - public Builder setRequestInitializer(HttpRequestInitializer requestInitializer) { - return (Builder) super.setRequestInitializer(requestInitializer); - } - - @Override - public Builder addRefreshListener(CredentialRefreshListener refreshListener) { - return (Builder) super.addRefreshListener(refreshListener); - } - - @Override - public Builder setRefreshListeners(Collection refreshListeners) { - return (Builder) super.setRefreshListeners(refreshListeners); - } - - @Override - public Builder setTokenServerUrl(GenericUrl tokenServerUrl) { - return (Builder) super.setTokenServerUrl(tokenServerUrl); - } - - @Override - public Builder setTokenServerEncodedUrl(String tokenServerEncodedUrl) { - return (Builder) super.setTokenServerEncodedUrl(tokenServerEncodedUrl); - } - - @Override - public Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication) { - return (Builder) super.setClientAuthentication(clientAuthentication); - } - } - - @Beta - private static GoogleCredential fromStreamUser(GenericJson fileContents, HttpTransport transport, - JsonFactory jsonFactory) throws IOException { - String clientId = (String) fileContents.get("client_id"); - String clientSecret = (String) fileContents.get("client_secret"); - String refreshToken = (String) fileContents.get("refresh_token"); - if (clientId == null || clientSecret == null || refreshToken == null) { - throw new IOException("Error reading user credential from stream, " - + " expecting 'client_id', 'client_secret' and 'refresh_token'."); - } - - GoogleCredential credential = new GoogleCredential.Builder() - .setClientSecrets(clientId, clientSecret) - .setTransport(transport) - .setJsonFactory(jsonFactory) - .build(); - credential.setRefreshToken(refreshToken); - - // Do a refresh so we can fail early rather than return an unusable credential - credential.refreshToken(); - return credential; - } - - @Beta - private static GoogleCredential fromStreamServiceAccount(GenericJson fileContents, - HttpTransport transport, JsonFactory jsonFactory) throws IOException { - String clientId = (String) fileContents.get("client_id"); - String clientEmail = (String) fileContents.get("client_email"); - String privateKeyPem = (String) fileContents.get("private_key"); - String privateKeyId = (String) fileContents.get("private_key_id"); - if (clientId == null || clientEmail == null || privateKeyPem == null || privateKeyId == null) { - throw new IOException("Error reading service account credential from stream, " - + "expecting 'client_id', 'client_email', 'private_key' and 'private_key_id'."); - } - - PrivateKey privateKey = privateKeyFromPkcs8(privateKeyPem); - - Collection emptyScopes = Collections.emptyList(); - - GoogleCredential credential = new GoogleCredential.Builder() - .setTransport(transport) - .setJsonFactory(jsonFactory) - .setServiceAccountId(clientEmail) - .setServiceAccountScopes(emptyScopes) - .setServiceAccountPrivateKey(privateKey) - .setServiceAccountPrivateKeyId(privateKeyId) - .build(); - - // Don't do a refresh at this point, as it will always fail before the scopes are added. - return credential; - } - - @Beta - private static PrivateKey privateKeyFromPkcs8(String privateKeyPem) throws IOException { - Reader reader = new StringReader(privateKeyPem); - Section section = PemReader.readFirstSectionAndClose(reader, "PRIVATE KEY"); - if (section == null) { - throw new IOException("Invalid PKCS8 data."); - } - byte[] bytes = section.getBase64DecodedBytes(); - PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(bytes); - Exception unexpectedException = null; - try { - KeyFactory keyFactory = SecurityUtils.getRsaKeyFactory(); - PrivateKey privateKey = keyFactory.generatePrivate(keySpec); - return privateKey; - } catch (NoSuchAlgorithmException exception) { - unexpectedException = exception; - } catch (InvalidKeySpecException exception) { - unexpectedException = exception; - } - throw OAuth2Utils.exceptionWithCause( - new IOException("Unexpected exception reading PKCS data"), unexpectedException); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdToken.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdToken.java deleted file mode 100644 index 09619b7d..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdToken.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.openidconnect.IdToken; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.webtoken.JsonWebSignature; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Key; - -import java.io.IOException; -import java.security.GeneralSecurityException; -import java.util.List; - -/** - * {@link Beta}
- * Google ID tokens as specified in Using OAuth 2.0 for Login. - * - *

- * Google ID tokens contain useful information about the authorized end user. Google ID tokens are - * signed and the signature must be verified using {@link #verify(GoogleIdTokenVerifier)}. - *

- * - *

- * Implementation is not thread-safe. - *

- * - * @since 1.7 - * @author Yaniv Inbar - */ -@SuppressWarnings("javadoc") -@Beta -public class GoogleIdToken extends IdToken { - - /** - * Parses the given ID token string and returns the parsed {@link GoogleIdToken}. - * - * @param jsonFactory JSON factory - * @param idTokenString ID token string - * @return parsed Google ID token - */ - public static GoogleIdToken parse(JsonFactory jsonFactory, String idTokenString) - throws IOException { - JsonWebSignature jws = - JsonWebSignature.parser(jsonFactory).setPayloadClass(Payload.class).parse(idTokenString); - return new GoogleIdToken(jws.getHeader(), (Payload) jws.getPayload(), jws.getSignatureBytes(), - jws.getSignedContentBytes()); - } - - /** - * @param header header - * @param payload payload - * @param signatureBytes bytes of the signature - * @param signedContentBytes bytes of the signature content - */ - public GoogleIdToken( - Header header, Payload payload, byte[] signatureBytes, byte[] signedContentBytes) { - super(header, payload, signatureBytes, signedContentBytes); - } - - /** - * Verifies that this ID token is valid using {@link GoogleIdTokenVerifier#verify(GoogleIdToken)}. - */ - public boolean verify(GoogleIdTokenVerifier verifier) - throws GeneralSecurityException, IOException { - return verifier.verify(this); - } - - @Override - public Payload getPayload() { - return (Payload) super.getPayload(); - } - - /** - * {@link Beta}
- * Google ID token payload. - */ - @Beta - public static class Payload extends IdToken.Payload { - /** Hosted domain name if asserted user is a domain managed user or {@code null} for none. */ - @Key("hd") - private String hostedDomain; - - /** E-mail of the user or {@code null} if not requested. */ - @Key("email") - private String email; - - /** - * {@code true} if the email is verified. - * TODO(mwan): change the type of the field to Boolean and the handling in - * {@link #getEmailVerified()} accordingly after Google OpenID Connect endpoint fixes the - * type of the field in ID Token. - */ - @Key("email_verified") - private Object emailVerified; - - public Payload() { - } - - /** - * Returns the obfuscated Google user id or {@code null} for none. - * - * @deprecated (scheduled to be removed in 1.18) Use {@link #getSubject()} instead. - */ - @Deprecated - public String getUserId() { - return getSubject(); - } - - /** - * Sets the obfuscated Google user id or {@code null} for none. - * - * @deprecated (scheduled to be removed in 1.18) Use {@link #setSubject(String)} instead. - */ - @Deprecated - public Payload setUserId(String userId) { - return setSubject(userId); - } - - /** - * Returns the client ID of issuee or {@code null} for none. - * - * @deprecated (scheduled to be removed in 1.18) Use {@link #getAuthorizedParty()} instead. - */ - @Deprecated - public String getIssuee() { - return getAuthorizedParty(); - } - - /** - * Sets the client ID of issuee or {@code null} for none. - * - * @deprecated (scheduled to be removed in 1.18) Use {@link #setAuthorizedParty(String)} - * instead. - */ - @Deprecated - public Payload setIssuee(String issuee) { - return setAuthorizedParty(issuee); - } - - /** - * Returns the hosted domain name if asserted user is a domain managed user or {@code null} for - * none. - */ - public String getHostedDomain() { - return hostedDomain; - } - - /** - * Sets the hosted domain name if asserted user is a domain managed user or {@code null} for - * none. - */ - public Payload setHostedDomain(String hostedDomain) { - this.hostedDomain = hostedDomain; - return this; - } - - /** - * Returns the e-mail address of the user or {@code null} if it was not requested. - * - *

- * Requires the {@code "https://www.googleapis.com/auth/userinfo.email"} scope. - *

- * - * @since 1.10 - */ - public String getEmail() { - return email; - } - - /** - * Sets the e-mail address of the user or {@code null} if it was not requested. - * - *

- * Used in conjunction with the {@code "https://www.googleapis.com/auth/userinfo.email"} scope. - *

- * - * @since 1.10 - */ - public Payload setEmail(String email) { - this.email = email; - return this; - } - - /** - * Returns {@code true} if the users e-mail address has been verified by Google. - * - *

- * Requires the {@code "https://www.googleapis.com/auth/userinfo.email"} scope. - *

- * - * @since 1.10 - * - *

- * Upgrade warning: in prior version 1.16 this method accessed {@code "verified_email"} - * and returns a boolean, but starting with verison 1.17, it now accesses - * {@code "email_verified"} and returns a Boolean. Previously, if this value was not - * specified, this method would return {@code false}, but now it returns {@code null}. - *

- */ - public Boolean getEmailVerified() { - if (emailVerified == null) { - return null; - } - if (emailVerified instanceof Boolean) { - return (Boolean) emailVerified; - } - - return Boolean.valueOf((String) emailVerified); - } - - /** - * Sets whether the users e-mail address has been verified by Google or not. - * - *

- * Used in conjunction with the {@code "https://www.googleapis.com/auth/userinfo.email"} scope. - *

- * - * @since 1.10 - * - *

- * Upgrade warning: in prior version 1.16 this method accessed {@code "verified_email"} and - * required a boolean parameter, but starting with verison 1.17, it now accesses - * {@code "email_verified"} and requires a Boolean parameter. - *

- */ - public Payload setEmailVerified(Boolean emailVerified) { - this.emailVerified = emailVerified; - return this; - } - - @Override - public Payload setAuthorizationTimeSeconds(Long authorizationTimeSeconds) { - return (Payload) super.setAuthorizationTimeSeconds(authorizationTimeSeconds); - } - - @Override - public Payload setAuthorizedParty(String authorizedParty) { - return (Payload) super.setAuthorizedParty(authorizedParty); - } - - @Override - public Payload setNonce(String nonce) { - return (Payload) super.setNonce(nonce); - } - - @Override - public Payload setAccessTokenHash(String accessTokenHash) { - return (Payload) super.setAccessTokenHash(accessTokenHash); - } - - @Override - public Payload setClassReference(String classReference) { - return (Payload) super.setClassReference(classReference); - } - - @Override - public Payload setMethodsReferences(List methodsReferences) { - return (Payload) super.setMethodsReferences(methodsReferences); - } - - @Override - public Payload setExpirationTimeSeconds(Long expirationTimeSeconds) { - return (Payload) super.setExpirationTimeSeconds(expirationTimeSeconds); - } - - @Override - public Payload setNotBeforeTimeSeconds(Long notBeforeTimeSeconds) { - return (Payload) super.setNotBeforeTimeSeconds(notBeforeTimeSeconds); - } - - @Override - public Payload setIssuedAtTimeSeconds(Long issuedAtTimeSeconds) { - return (Payload) super.setIssuedAtTimeSeconds(issuedAtTimeSeconds); - } - - @Override - public Payload setIssuer(String issuer) { - return (Payload) super.setIssuer(issuer); - } - - @Override - public Payload setAudience(Object audience) { - return (Payload) super.setAudience(audience); - } - - @Override - public Payload setJwtId(String jwtId) { - return (Payload) super.setJwtId(jwtId); - } - - @Override - public Payload setType(String type) { - return (Payload) super.setType(type); - } - - @Override - public Payload setSubject(String subject) { - return (Payload) super.setSubject(subject); - } - - @Override - public Payload set(String fieldName, Object value) { - return (Payload) super.set(fieldName, value); - } - - @Override - public Payload clone() { - return (Payload) super.clone(); - } - } -} 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 deleted file mode 100644 index eda859d5..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenVerifier.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.openidconnect.IdToken; -import com.google.api.client.auth.openidconnect.IdTokenVerifier; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Clock; -import com.google.api.client.util.Preconditions; - -import java.io.IOException; -import java.security.GeneralSecurityException; -import java.security.PublicKey; -import java.util.Collection; -import java.util.List; - -/** - * {@link Beta}
- * Thread-safe Google ID token verifier. - * - *

- * Call {@link #verify(IdToken)} to verify a ID token. Use the constructor - * {@link #GoogleIdTokenVerifier(HttpTransport, JsonFactory)} for the typical simpler case if your - * application has only a single instance of {@link GoogleIdTokenVerifier}. Otherwise, ideally you - * should use {@link #GoogleIdTokenVerifier(GooglePublicKeysManager)} with a shared global instance - * of the {@link GooglePublicKeysManager} since that way the Google public keys are cached. Sample - * usage: - *

- * - *
-    GoogleIdTokenVerifier verifier = new GoogleIdTokenVerifier.Builder(transport, jsonFactory)
-        .setAudience(Arrays.asList("myClientId"))
-        .build();
-    ...
-    if (!verifier.verify(googleIdToken)) {...}
- * 
- * - * @since 1.7 - */ -@Beta -public class GoogleIdTokenVerifier extends IdTokenVerifier { - - /** Google public keys manager. */ - private final GooglePublicKeysManager publicKeys; - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - */ - public GoogleIdTokenVerifier(HttpTransport transport, JsonFactory jsonFactory) { - this(new Builder(transport, jsonFactory)); - } - - /** - * @param publicKeys Google public keys manager - * - * @since 1.17 - */ - public GoogleIdTokenVerifier(GooglePublicKeysManager publicKeys) { - this(new Builder(publicKeys)); - } - - /** - * @param builder builder - * - * @since 1.14 - */ - protected GoogleIdTokenVerifier(Builder builder) { - super(builder); - publicKeys = builder.publicKeys; - } - - /** - * Returns the Google public keys manager. - * - * @since 1.17 - */ - public final GooglePublicKeysManager getPublicKeysManager() { - return publicKeys; - } - - /** - * Returns the HTTP transport. - * - * @since 1.14 - */ - public final HttpTransport getTransport() { - return publicKeys.getTransport(); - } - - /** Returns the JSON factory. */ - public final JsonFactory getJsonFactory() { - return publicKeys.getJsonFactory(); - } - - /** - * Returns the public certificates encoded URL. - * - * @since 1.15 - * @deprecated (scheduled to be removed in 1.18) Use {@link #getPublicKeysManager()} and - * {@link GooglePublicKeysManager#getPublicCertsEncodedUrl()} instead. - */ - @Deprecated - public final String getPublicCertsEncodedUrl() { - return publicKeys.getPublicCertsEncodedUrl(); - } - - /** - * Returns the public keys. - * - *

- * Upgrade warning: in prior version 1.16 it may return {@code null} and not throw any exceptions, - * but starting with version 1.17 it cannot return {@code null} and may throw - * {@link GeneralSecurityException} or {@link IOException}. - *

- * - * @deprecated (scheduled to be removed in 1.18) Use {@link #getPublicKeysManager()} and - * {@link GooglePublicKeysManager#getPublicCertsEncodedUrl()} instead. - */ - @Deprecated - public final List getPublicKeys() throws GeneralSecurityException, IOException { - return publicKeys.getPublicKeys(); - } - - /** - * Returns the expiration time in milliseconds to be used with {@link Clock#currentTimeMillis()} - * or {@code 0} for none. - * - * @deprecated (scheduled to be removed in 1.18) Use {@link #getPublicKeysManager()} and - * {@link GooglePublicKeysManager#getExpirationTimeMilliseconds()} instead. - */ - @Deprecated - public final long getExpirationTimeMilliseconds() { - return publicKeys.getExpirationTimeMilliseconds(); - } - - /** - * Verifies that the given ID token is valid using the cached public keys. - * - * It verifies: - * - *
    - *
  • The RS256 signature, which uses RSA and SHA-256 based on the public keys downloaded from - * the public certificate endpoint.
  • - *
  • The current time against the issued at and expiration time (allowing for a 5 minute clock - * skew).
  • - *
  • The issuer is {@code "accounts.google.com"}.
  • - *
- * - * @param googleIdToken Google ID token - * @return {@code true} if verified successfully or {@code false} if failed - */ - public boolean verify(GoogleIdToken googleIdToken) throws GeneralSecurityException, IOException { - // check the payload - if (!super.verify(googleIdToken)) { - return false; - } - // verify signature - for (PublicKey publicKey : publicKeys.getPublicKeys()) { - if (googleIdToken.verifySignature(publicKey)) { - return true; - } - } - return false; - } - - /** - * Verifies that the given ID token is valid using {@link #verify(GoogleIdToken)} and returns the - * ID token if succeeded. - * - * @param idTokenString Google ID token string - * @return Google ID token if verified successfully or {@code null} if failed - * @since 1.9 - */ - public GoogleIdToken verify(String idTokenString) throws GeneralSecurityException, IOException { - GoogleIdToken idToken = GoogleIdToken.parse(getJsonFactory(), idTokenString); - return verify(idToken) ? idToken : null; - } - - /** - * Downloads the public keys from the public certificates endpoint at - * {@link #getPublicCertsEncodedUrl}. - * - *

- * This method is automatically called if the public keys have not yet been initialized or if the - * expiration time is very close, so normally this doesn't need to be called. Only call this - * method explicitly to force the public keys to be updated. - *

- * - * @deprecated (scheduled to be removed in 1.18) Use {@link #getPublicKeysManager()} and - * {@link GooglePublicKeysManager#refresh()} instead. - */ - @Deprecated - public GoogleIdTokenVerifier loadPublicCerts() throws GeneralSecurityException, IOException { - publicKeys.refresh(); - return this; - } - - /** - * {@link Beta}
- * Builder for {@link GoogleIdTokenVerifier}. - * - *

- * Implementation is not thread-safe. - *

- * - * @since 1.9 - */ - @Beta - public static class Builder extends IdTokenVerifier.Builder { - - /** Google public keys manager. */ - GooglePublicKeysManager publicKeys; - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - */ - public Builder(HttpTransport transport, JsonFactory jsonFactory) { - this(new GooglePublicKeysManager(transport, jsonFactory)); - } - - /** - * @param publicKeys Google public keys manager - * - * @since 1.17 - */ - public Builder(GooglePublicKeysManager publicKeys) { - this.publicKeys = Preconditions.checkNotNull(publicKeys); - setIssuer("accounts.google.com"); - } - - /** Builds a new instance of {@link GoogleIdTokenVerifier}. */ - @Override - public GoogleIdTokenVerifier build() { - return new GoogleIdTokenVerifier(this); - } - - /** - * Returns the Google public keys manager. - * - * @since 1.17 - */ - public final GooglePublicKeysManager getPublicCerts() { - return publicKeys; - } - - /** Returns the HTTP transport. */ - public final HttpTransport getTransport() { - return publicKeys.getTransport(); - } - - /** Returns the JSON factory. */ - public final JsonFactory getJsonFactory() { - return publicKeys.getJsonFactory(); - } - - /** - * Returns the public certificates encoded URL. - * - * @since 1.15 - * @deprecated (scheduled to be removed in 1.18) Use {@link #getPublicCerts()} and - * {@link GooglePublicKeysManager#getPublicCertsEncodedUrl()} instead. - */ - @Deprecated - public final String getPublicCertsEncodedUrl() { - return publicKeys.getPublicCertsEncodedUrl(); - } - - /** - * Sets the public certificates encoded URL. - * - *

- * The default value is {@link GoogleOAuthConstants#DEFAULT_PUBLIC_CERTS_ENCODED_URL}. - *

- * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- * - * @since 1.15 - * @deprecated (scheduled to be removed in 1.18) Use - * {@link GooglePublicKeysManager.Builder#setPublicCertsEncodedUrl(String)} instead. - */ - @Deprecated - public Builder setPublicCertsEncodedUrl(String publicKeysEncodedUrl) { - // TODO(yanivi): make publicKeys field final when this method is removed - publicKeys = new GooglePublicKeysManager.Builder( - getTransport(), getJsonFactory()).setPublicCertsEncodedUrl(publicKeysEncodedUrl) - .setClock(publicKeys.getClock()).build(); - return this; - } - - @Override - public Builder setIssuer(String issuer) { - return (Builder) super.setIssuer(issuer); - } - - @Override - public Builder setAudience(Collection audience) { - return (Builder) super.setAudience(audience); - } - - @Override - public Builder setAcceptableTimeSkewSeconds(long acceptableTimeSkewSeconds) { - return (Builder) super.setAcceptableTimeSkewSeconds(acceptableTimeSkewSeconds); - } - - @Override - public Builder setClock(Clock clock) { - return (Builder) super.setClock(clock); - } - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleOAuthConstants.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleOAuthConstants.java deleted file mode 100644 index 80da89a4..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleOAuthConstants.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.util.Beta; - -/** - * Constants for Google's OAuth 2.0 implementation. - * - * @since 1.7 - * @author Yaniv Inbar - */ -public class GoogleOAuthConstants { - - /** Encoded URL of Google's end-user authorization server. */ - public static final String AUTHORIZATION_SERVER_URL = "https://accounts.google.com/o/oauth2/auth"; - - /** Encoded URL of Google's token server. */ - public static final String TOKEN_SERVER_URL = "https://accounts.google.com/o/oauth2/token"; - - /** - * {@link Beta}
- * Encoded URL of Google's public certificates. - * - * @since 1.15 - */ - @Beta - public static final String DEFAULT_PUBLIC_CERTS_ENCODED_URL = - "https://www.googleapis.com/oauth2/v1/certs"; - - /** - * Redirect URI to use for an installed application as specified in Using OAuth 2.0 for - * Installed Applications. - */ - public static final String OOB_REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob"; - - private GoogleOAuthConstants() { - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GooglePublicKeysManager.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GooglePublicKeysManager.java deleted file mode 100644 index 7b0b848d..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GooglePublicKeysManager.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonParser; -import com.google.api.client.json.JsonToken; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Clock; -import com.google.api.client.util.Preconditions; -import com.google.api.client.util.SecurityUtils; -import com.google.api.client.util.StringUtils; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.security.GeneralSecurityException; -import java.security.PublicKey; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * {@link Beta}
- * Thread-safe Google public keys manager. - * - *

- * The public keys are loaded from the public certificates endpoint at - * {@link #getPublicCertsEncodedUrl} and cached in this instance. Therefore, for maximum efficiency, - * applications should use a single globally-shared instance of the {@link GooglePublicKeysManager}. - *

- * - * @since 1.17 - */ -@Beta -public class GooglePublicKeysManager { - - /** Number of milliseconds before expiration time to force a refresh. */ - private static final long REFRESH_SKEW_MILLIS = 300000; - - /** Pattern for the max-age header element of Cache-Control. */ - private static final Pattern MAX_AGE_PATTERN = Pattern.compile("\\s*max-age\\s*=\\s*(\\d+)\\s*"); - - /** JSON factory. */ - private final JsonFactory jsonFactory; - - /** Unmodifiable view of the public keys or {@code null} for none. */ - private List publicKeys; - - /** - * Expiration time in milliseconds to be used with {@link Clock#currentTimeMillis()} or {@code 0} - * for none. - */ - private long expirationTimeMilliseconds; - - /** HTTP transport. */ - private final HttpTransport transport; - - /** Lock on the public keys. */ - private final Lock lock = new ReentrantLock(); - - /** Clock to use for expiration checks. */ - private final Clock clock; - - /** Public certificates encoded URL. */ - private final String publicCertsEncodedUrl; - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - */ - public GooglePublicKeysManager(HttpTransport transport, JsonFactory jsonFactory) { - this(new Builder(transport, jsonFactory)); - } - - /** - * @param builder builder - */ - protected GooglePublicKeysManager(Builder builder) { - transport = builder.transport; - jsonFactory = builder.jsonFactory; - clock = builder.clock; - publicCertsEncodedUrl = builder.publicCertsEncodedUrl; - } - - /** Returns the HTTP transport. */ - public final HttpTransport getTransport() { - return transport; - } - - /** Returns the JSON factory. */ - public final JsonFactory getJsonFactory() { - return jsonFactory; - } - - /** Returns the public certificates encoded URL. */ - public final String getPublicCertsEncodedUrl() { - return publicCertsEncodedUrl; - } - - /** Returns the clock. */ - public final Clock getClock() { - return clock; - } - - /** - * Returns an unmodifiable view of the public keys. - * - *

- * For efficiency, an in-memory cache of the public keys is used here. If this method is called - * for the first time, or the certificates have expired since last time it has been called (or are - * within 5 minutes of expiring), {@link #refresh()} will be called before returning the value. - *

- */ - public final List getPublicKeys() throws GeneralSecurityException, IOException { - lock.lock(); - try { - if (publicKeys == null - || clock.currentTimeMillis() + REFRESH_SKEW_MILLIS > expirationTimeMilliseconds) { - refresh(); - } - return publicKeys; - } finally { - lock.unlock(); - } - } - - /** - * Returns the expiration time in milliseconds to be used with {@link Clock#currentTimeMillis()} - * or {@code 0} for none. - */ - public final long getExpirationTimeMilliseconds() { - return expirationTimeMilliseconds; - } - - /** - * Forces a refresh of the public certificates downloaded from {@link #getPublicCertsEncodedUrl}. - * - *

- * This method is automatically called from {@link #getPublicKeys()} if the public keys have not - * yet been initialized or if the expiration time is very close, so normally this doesn't need to - * be called. Only call this method to explicitly force the public keys to be updated. - *

- */ - public GooglePublicKeysManager refresh() throws GeneralSecurityException, IOException { - lock.lock(); - try { - publicKeys = new ArrayList(); - // HTTP request to public endpoint - CertificateFactory factory = SecurityUtils.getX509CertificateFactory(); - HttpResponse certsResponse = transport.createRequestFactory() - .buildGetRequest(new GenericUrl(publicCertsEncodedUrl)).execute(); - expirationTimeMilliseconds = - clock.currentTimeMillis() + getCacheTimeInSec(certsResponse.getHeaders()) * 1000; - // parse each public key in the JSON response - JsonParser parser = jsonFactory.createJsonParser(certsResponse.getContent()); - JsonToken currentToken = parser.getCurrentToken(); - // token is null at start, so get next token - if (currentToken == null) { - currentToken = parser.nextToken(); - } - Preconditions.checkArgument(currentToken == JsonToken.START_OBJECT); - try { - while (parser.nextToken() != JsonToken.END_OBJECT) { - parser.nextToken(); - String certValue = parser.getText(); - X509Certificate x509Cert = (X509Certificate) factory.generateCertificate( - new ByteArrayInputStream(StringUtils.getBytesUtf8(certValue))); - publicKeys.add(x509Cert.getPublicKey()); - } - publicKeys = Collections.unmodifiableList(publicKeys); - } finally { - parser.close(); - } - return this; - } finally { - lock.unlock(); - } - } - - /** - * Gets the cache time in seconds. "max-age" in "Cache-Control" header and "Age" header are - * considered. - * - * @param httpHeaders the http header of the response - * @return the cache time in seconds or zero if the response should not be cached - */ - long getCacheTimeInSec(HttpHeaders httpHeaders) { - long cacheTimeInSec = 0; - if (httpHeaders.getCacheControl() != null) { - for (String arg : httpHeaders.getCacheControl().split(",")) { - Matcher m = MAX_AGE_PATTERN.matcher(arg); - if (m.matches()) { - cacheTimeInSec = Long.valueOf(m.group(1)); - break; - } - } - } - if (httpHeaders.getAge() != null) { - cacheTimeInSec -= httpHeaders.getAge(); - } - return Math.max(0, cacheTimeInSec); - } - - /** - * {@link Beta}
- * Builder for {@link GooglePublicKeysManager}. - * - *

- * Implementation is not thread-safe. - *

- * - * @since 1.17 - */ - @Beta - public static class Builder { - - /** Clock. */ - Clock clock = Clock.SYSTEM; - - /** HTTP transport. */ - final HttpTransport transport; - - /** JSON factory. */ - final JsonFactory jsonFactory; - - /** Public certificates encoded URL. */ - String publicCertsEncodedUrl = GoogleOAuthConstants.DEFAULT_PUBLIC_CERTS_ENCODED_URL; - - /** - * Returns an instance of a new builder. - * - * @param transport HTTP transport - * @param jsonFactory JSON factory - */ - public Builder(HttpTransport transport, JsonFactory jsonFactory) { - this.transport = Preconditions.checkNotNull(transport); - this.jsonFactory = Preconditions.checkNotNull(jsonFactory); - } - - /** Builds a new instance of {@link GooglePublicKeysManager}. */ - public GooglePublicKeysManager build() { - return new GooglePublicKeysManager(this); - } - - /** Returns the HTTP transport. */ - public final HttpTransport getTransport() { - return transport; - } - - /** Returns the JSON factory. */ - public final JsonFactory getJsonFactory() { - return jsonFactory; - } - - /** Returns the public certificates encoded URL. */ - public final String getPublicCertsEncodedUrl() { - return publicCertsEncodedUrl; - } - - /** - * Sets the public certificates encoded URL. - * - *

- * The default value is {@link GoogleOAuthConstants#DEFAULT_PUBLIC_CERTS_ENCODED_URL}. - *

- * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setPublicCertsEncodedUrl(String publicCertsEncodedUrl) { - this.publicCertsEncodedUrl = Preconditions.checkNotNull(publicCertsEncodedUrl); - return this; - } - - /** Returns the clock. */ - public final Clock getClock() { - return clock; - } - - /** - * Sets the clock. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setClock(Clock clock) { - this.clock = Preconditions.checkNotNull(clock); - return this; - } - } -} 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 deleted file mode 100644 index f71fd85c..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleRefreshTokenRequest.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.oauth2.ClientParametersAuthentication; -import com.google.api.client.auth.oauth2.RefreshTokenRequest; -import com.google.api.client.auth.oauth2.TokenResponse; -import com.google.api.client.auth.oauth2.TokenResponseException; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.JsonFactory; - -import java.io.IOException; -import java.util.Collection; - -/** - * Google-specific implementation of the OAuth 2.0 request to refresh an access token using a - * refresh token as specified in Refreshing - * an Access Token. - * - *

- * 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 TokenResponseException}. - *

- * - *

- * Sample usage: - *

- * - *
-  static void refreshAccessToken() throws IOException {
-    try {
-      TokenResponse response =
-          new GoogleRefreshTokenRequest(new NetHttpTransport(), new JacksonFactory(),
-              "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());
-      }
-    }
-  }
- * 
- * - *

- * Implementation is not thread-safe. - *

- * - * @since 1.7 - * @author Yaniv Inbar - */ -public class GoogleRefreshTokenRequest extends RefreshTokenRequest { - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - * @param refreshToken refresh token issued to the client - * @param clientId client identifier issued to the client during the registration process - * @param clientSecret client secret - */ - public GoogleRefreshTokenRequest(HttpTransport transport, JsonFactory jsonFactory, - String refreshToken, String clientId, String clientSecret) { - super(transport, jsonFactory, new GenericUrl(GoogleOAuthConstants.TOKEN_SERVER_URL), - refreshToken); - setClientAuthentication(new ClientParametersAuthentication(clientId, clientSecret)); - } - - @Override - public GoogleRefreshTokenRequest setRequestInitializer( - HttpRequestInitializer requestInitializer) { - return (GoogleRefreshTokenRequest) super.setRequestInitializer(requestInitializer); - } - - @Override - public GoogleRefreshTokenRequest setTokenServerUrl(GenericUrl tokenServerUrl) { - return (GoogleRefreshTokenRequest) super.setTokenServerUrl(tokenServerUrl); - } - - @Override - public GoogleRefreshTokenRequest setScopes(Collection scopes) { - return (GoogleRefreshTokenRequest) super.setScopes(scopes); - } - - @Override - public GoogleRefreshTokenRequest setGrantType(String grantType) { - return (GoogleRefreshTokenRequest) super.setGrantType(grantType); - } - - @Override - public GoogleRefreshTokenRequest setClientAuthentication( - HttpExecuteInterceptor clientAuthentication) { - return (GoogleRefreshTokenRequest) super.setClientAuthentication(clientAuthentication); - } - - @Override - public GoogleRefreshTokenRequest setRefreshToken(String refreshToken) { - return (GoogleRefreshTokenRequest) super.setRefreshToken(refreshToken); - } - - @Override - public GoogleTokenResponse execute() throws IOException { - return executeUnparsed().parseAs(GoogleTokenResponse.class); - } - - @Override - public GoogleRefreshTokenRequest set(String fieldName, Object value) { - return (GoogleRefreshTokenRequest) super.set(fieldName, value); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleTokenResponse.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleTokenResponse.java deleted file mode 100644 index acae998f..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleTokenResponse.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.oauth2.TokenResponse; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Key; -import com.google.api.client.util.Preconditions; - -import java.io.IOException; - -/** - * Google OAuth 2.0 JSON model for a successful access token response as specified in Successful Response, including an ID - * token as specified in OpenID - * Connect Session Management 1.0. - * - *

- * This response object is the result of {@link GoogleAuthorizationCodeTokenRequest#execute()} and - * {@link GoogleRefreshTokenRequest#execute()}. Use {@link #parseIdToken()} to parse the - * {@link GoogleIdToken} and then call {@link GoogleIdTokenVerifier#verify(GoogleIdToken)}. - *

- * - *

- * Implementation is not thread-safe. - *

- * - * @since 1.7 - * @author Yaniv Inbar - */ -public class GoogleTokenResponse extends TokenResponse { - - /** ID token. */ - @Key("id_token") - private String idToken; - - @Override - public GoogleTokenResponse setAccessToken(String accessToken) { - return (GoogleTokenResponse) super.setAccessToken(accessToken); - } - - @Override - public GoogleTokenResponse setTokenType(String tokenType) { - return (GoogleTokenResponse) super.setTokenType(tokenType); - } - - @Override - public GoogleTokenResponse setExpiresInSeconds(Long expiresIn) { - return (GoogleTokenResponse) super.setExpiresInSeconds(expiresIn); - } - - @Override - public GoogleTokenResponse setRefreshToken(String refreshToken) { - return (GoogleTokenResponse) super.setRefreshToken(refreshToken); - } - - @Override - public GoogleTokenResponse setScope(String scope) { - return (GoogleTokenResponse) super.setScope(scope); - } - - /** - * {@link Beta}
- * Returns the ID token. - */ - @Beta - public final String getIdToken() { - return idToken; - } - - /** - * {@link Beta}
- * Sets the ID token. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - @Beta - public GoogleTokenResponse setIdToken(String idToken) { - this.idToken = Preconditions.checkNotNull(idToken); - return this; - } - - /** - * {@link Beta}
- * Parses using {@link GoogleIdToken#parse(JsonFactory, String)} based on the {@link #getFactory() - * JSON factory} and {@link #getIdToken() ID token}. - */ - @Beta - public GoogleIdToken parseIdToken() throws IOException { - return GoogleIdToken.parse(getFactory(), getIdToken()); - } - - @Override - public GoogleTokenResponse set(String fieldName, Object value) { - return (GoogleTokenResponse) super.set(fieldName, value); - } - - @Override - public GoogleTokenResponse clone() { - return (GoogleTokenResponse) super.clone(); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/OAuth2Utils.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/OAuth2Utils.java deleted file mode 100644 index 1390b743..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/OAuth2Utils.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2014 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpTransport; - -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.Collection; - -/** - * Utilities used by the com.google.api.client.googleapis.auth.oauth2 namespace. - * - */ -class OAuth2Utils { - - static final Charset UTF_8 = Charset.forName("UTF-8"); - - private static final String METADATA_SERVER_URL = "http://metadata.google.internal"; - - static T exceptionWithCause(T exception, Throwable cause) { - exception.initCause(cause); - return exception; - } - - static boolean headersContainValue(HttpHeaders headers, String headerName, String value) { - Object values = headers.get(headerName); - if (values instanceof Collection) { - @SuppressWarnings("unchecked") - Collection valuesList = (Collection) values; - for (Object headerValue : valuesList) { - if (headerValue instanceof String && ((String) headerValue).equals(value)) { - return true; - } - } - } - return false; - } - - static boolean runningOnComputeEngine(HttpTransport transport) { - try { - GenericUrl tokenUrl = new GenericUrl(METADATA_SERVER_URL); - HttpRequest request = transport.createRequestFactory().buildGetRequest(tokenUrl); - HttpResponse response = request.execute(); - HttpHeaders headers = response.getHeaders(); - if (headersContainValue(headers, "Metadata-Flavor", "Google")) { - return true; - } - } catch (IOException expected) { - } - return false; - } - - private OAuth2Utils() { - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/package-info.java deleted file mode 100644 index f92e5ab9..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/package-info.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Google's additions to OAuth 2.0 authorization as specified in Using OAuth 2.0 to Access Google - * APIs. - * - *

- * Before using this library, you must register your application at the APIs Console. The result of this - * registration process is a set of values that are known to both Google and your application, such - * as the "Client ID", "Client Secret", and "Redirect URIs". - *

- * - *

- * These are the typical steps of the web server flow based on an authorization code, as specified - * in Using OAuth 2.0 for - * Web Server Applications: - *

    - *
  • Redirect the end user in the browser to the authorization page using - * {@link com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl} to grant - * your application access to the end user's protected data.
  • - *
  • Process the authorization response using - * {@link com.google.api.client.auth.oauth2.AuthorizationCodeResponseUrl} to parse the authorization - * code.
  • - *
  • Request an access token and possibly a refresh token using - * {@link com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeTokenRequest}.
  • - *
  • Access protected resources using - * {@link com.google.api.client.googleapis.auth.oauth2.GoogleCredential}. Expired access tokens will - * automatically be refreshed using the refresh token (if applicable).
  • - *
- *

- * - *

- * These are the typical steps of the the browser-based client flow specified in Using OAuth 2.0 for - * Client-side Applications: - *

    - *
  • Redirect the end user in the browser to the authorization page using - * {@link com.google.api.client.googleapis.auth.oauth2.GoogleBrowserClientRequestUrl} to grant your - * browser application access to the end user's protected data.
  • - *
  • Use the Google API Client - * library for JavaScript to process the access token found in the URL fragment at the redirect - * URI registered at the APIs Console. - *
  • - *
- *

- * - * @since 1.7 - * @author Yaniv Inbar - */ - -package com.google.api.client.googleapis.auth.oauth2; - 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 deleted file mode 100644 index f7f31f70..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/BatchCallback.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.batch; - -import com.google.api.client.http.HttpHeaders; - -import java.io.IOException; - -/** - * Callback for an individual batch response. - * - *

- * Sample use: - *

- * - *
-   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());
-     }
-   });
- * 
- * - * @param Type of the data model class - * @param Type of the error data model class - * @since 1.9 - * @author rmistry@google.com (Ravi Mistry) - */ -public interface BatchCallback { - - /** - * Called if the individual batch response is successful. - * - * @param t instance of the parsed data model class - * @param responseHeaders Headers of the batch response - */ - void onSuccess(T t, HttpHeaders responseHeaders) throws IOException; - - /** - * Called if the individual batch response is unsuccessful. - * - * @param e instance of data class representing the error response content - * @param responseHeaders Headers of the batch response - */ - void onFailure(E e, HttpHeaders responseHeaders) throws IOException; -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/BatchRequest.java b/google-api-client/src/main/java/com/google/api/client/googleapis/batch/BatchRequest.java deleted file mode 100644 index 3958b64e..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/BatchRequest.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.batch; - -import com.google.api.client.http.BackOffPolicy; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpBackOffUnsuccessfulResponseHandler; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.HttpUnsuccessfulResponseHandler; -import com.google.api.client.http.MultipartContent; -import com.google.api.client.util.Preconditions; -import com.google.api.client.util.Sleeper; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -/** - * An instance of this class represents a single batch of requests. - * - *

- * Sample use: - *

- * - *
-   BatchRequest batch = new BatchRequest(transport, httpRequestInitializer);
-   batch.queue(volumesList, 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());
-     }
-   });
-   batch.queue(volumesList, 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());
-     }
-   });
-   batch.execute();
- * 
- * - *

- * The content of each individual response is stored in memory. There is thus a potential of - * encountering an {@link OutOfMemoryError} for very large responses. - *

- * - *

- * Redirects are currently not followed in {@link BatchRequest}. - *

- * - *

- * Implementation is not thread-safe. - *

- * - *

- * Note: When setting an {@link HttpUnsuccessfulResponseHandler} by calling to - * {@link HttpRequest#setUnsuccessfulResponseHandler}, the handler is called for each unsuccessful - * part. As a result it's not recommended to use {@link HttpBackOffUnsuccessfulResponseHandler} on a - * batch request, since the back-off policy is invoked for each unsuccessful part. - *

- * - * @since 1.9 - * @author rmistry@google.com (Ravi Mistry) - */ -@SuppressWarnings("deprecation") -public final class BatchRequest { - - /** The URL where batch requests are sent. */ - private GenericUrl batchUrl = new GenericUrl("https://www.googleapis.com/batch"); - - /** The request factory for connections to the server. */ - private final HttpRequestFactory requestFactory; - - /** The list of queued request infos. */ - List> requestInfos = new ArrayList>(); - - /** Sleeper. */ - private Sleeper sleeper = Sleeper.DEFAULT; - - /** A container class used to hold callbacks and data classes. */ - static class RequestInfo { - final BatchCallback callback; - final Class dataClass; - final Class errorClass; - final HttpRequest request; - - RequestInfo(BatchCallback callback, Class dataClass, Class errorClass, - HttpRequest request) { - this.callback = callback; - this.dataClass = dataClass; - this.errorClass = errorClass; - this.request = request; - } - } - - /** - * Construct the {@link BatchRequest}. - * - * @param transport The transport to use for requests - * @param httpRequestInitializer The initializer to use when creating an {@link HttpRequest} or - * {@code null} for none - */ - public BatchRequest(HttpTransport transport, HttpRequestInitializer httpRequestInitializer) { - this.requestFactory = httpRequestInitializer == null - ? transport.createRequestFactory() : transport.createRequestFactory(httpRequestInitializer); - } - - /** - * Sets the URL that will be hit when {@link #execute()} is called. The default value is - * {@code https://www.googleapis.com/batch}. - */ - public BatchRequest setBatchUrl(GenericUrl batchUrl) { - this.batchUrl = batchUrl; - return this; - } - - /** Returns the URL that will be hit when {@link #execute()} is called. */ - public GenericUrl getBatchUrl() { - return batchUrl; - } - - /** - * Returns the sleeper. - * - * @since 1.15 - */ - public Sleeper getSleeper() { - return sleeper; - } - - /** - * Sets the sleeper. The default value is {@link Sleeper#DEFAULT}. - * - * @since 1.15 - */ - public BatchRequest setSleeper(Sleeper sleeper) { - this.sleeper = Preconditions.checkNotNull(sleeper); - return this; - } - - /** - * Queues the specified {@link HttpRequest} for batched execution. Batched requests are executed - * when {@link #execute()} is called. - * - * @param destination class type - * @param error class type - * @param httpRequest HTTP Request - * @param dataClass Data class the response will be parsed into or {@code Void.class} to ignore - * the content - * @param errorClass Data class the unsuccessful response will be parsed into or - * {@code Void.class} to ignore the content - * @param callback Batch Callback - * @return this Batch request - * @throws IOException If building the HTTP Request fails - */ - public BatchRequest queue(HttpRequest httpRequest, Class dataClass, Class errorClass, - BatchCallback callback) throws IOException { - Preconditions.checkNotNull(httpRequest); - // TODO(rmistry): Add BatchUnparsedCallback with onResponse(InputStream content, HttpHeaders). - Preconditions.checkNotNull(callback); - Preconditions.checkNotNull(dataClass); - Preconditions.checkNotNull(errorClass); - - requestInfos.add(new RequestInfo(callback, dataClass, errorClass, httpRequest)); - return this; - } - - /** - * Returns the number of queued requests in this batch request. - */ - public int size() { - return requestInfos.size(); - } - - /** - * Executes all queued HTTP requests in a single call, parses the responses and invokes callbacks. - * - *

- * Calling {@link #execute()} executes and clears the queued requests. This means that the - * {@link BatchRequest} object can be reused to {@link #queue} and {@link #execute()} requests - * again. - *

- */ - public void execute() throws IOException { - boolean retryAllowed; - Preconditions.checkState(!requestInfos.isEmpty()); - HttpRequest batchRequest = requestFactory.buildPostRequest(this.batchUrl, null); - // NOTE: batch does not support gzip encoding - HttpExecuteInterceptor originalInterceptor = batchRequest.getInterceptor(); - batchRequest.setInterceptor(new BatchInterceptor(originalInterceptor)); - int retriesRemaining = batchRequest.getNumberOfRetries(); - BackOffPolicy backOffPolicy = batchRequest.getBackOffPolicy(); - - if (backOffPolicy != null) { - // Reset the BackOffPolicy at the start of each execute. - backOffPolicy.reset(); - } - - do { - retryAllowed = retriesRemaining > 0; - MultipartContent batchContent = new MultipartContent(); - batchContent.getMediaType().setSubType("mixed"); - int contentId = 1; - for (RequestInfo requestInfo : requestInfos) { - batchContent.addPart(new MultipartContent.Part( - new HttpHeaders().setAcceptEncoding(null).set("Content-ID", contentId++), - new HttpRequestContent(requestInfo.request))); - } - batchRequest.setContent(batchContent); - HttpResponse response = batchRequest.execute(); - BatchUnparsedResponse batchResponse; - try { - // Find the boundary from the Content-Type header. - String boundary = "--" + response.getMediaType().getParameter("boundary"); - - // Parse the content stream. - InputStream contentStream = response.getContent(); - batchResponse = - new BatchUnparsedResponse(contentStream, boundary, requestInfos, retryAllowed); - - while (batchResponse.hasNext) { - batchResponse.parseNextResponse(); - } - } finally { - response.disconnect(); - } - - List> unsuccessfulRequestInfos = batchResponse.unsuccessfulRequestInfos; - if (!unsuccessfulRequestInfos.isEmpty()) { - requestInfos = unsuccessfulRequestInfos; - // backOff if required. - if (batchResponse.backOffRequired && backOffPolicy != null) { - long backOffTime = backOffPolicy.getNextBackOffMillis(); - if (backOffTime != BackOffPolicy.STOP) { - try { - sleeper.sleep(backOffTime); - } catch (InterruptedException exception) { - // ignore - } - } - } - } else { - break; - } - retriesRemaining--; - } while (retryAllowed); - requestInfos.clear(); - } - - /** - * Batch HTTP request execute interceptor that loops through all individual HTTP requests and runs - * their interceptors. - */ - class BatchInterceptor implements HttpExecuteInterceptor { - - private HttpExecuteInterceptor originalInterceptor; - - BatchInterceptor(HttpExecuteInterceptor originalInterceptor) { - this.originalInterceptor = originalInterceptor; - } - - public void intercept(HttpRequest batchRequest) throws IOException { - if (originalInterceptor != null) { - originalInterceptor.intercept(batchRequest); - } - for (RequestInfo requestInfo : requestInfos) { - HttpExecuteInterceptor interceptor = requestInfo.request.getInterceptor(); - if (interceptor != null) { - interceptor.intercept(requestInfo.request); - } - } - } - - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/BatchUnparsedResponse.java b/google-api-client/src/main/java/com/google/api/client/googleapis/batch/BatchUnparsedResponse.java deleted file mode 100644 index 246d7ff2..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/BatchUnparsedResponse.java +++ /dev/null @@ -1,429 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.batch; - -import com.google.api.client.googleapis.batch.BatchRequest.RequestInfo; -import com.google.api.client.http.BackOffPolicy; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpStatusCodes; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.HttpUnsuccessfulResponseHandler; -import com.google.api.client.http.LowLevelHttpRequest; -import com.google.api.client.http.LowLevelHttpResponse; -import com.google.api.client.util.ByteStreams; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.FilterInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - - -/** - * The unparsed batch response. - * - * @author rmistry@google.com (Ravi Mistry) - */ -@SuppressWarnings("deprecation") -final class BatchUnparsedResponse { - - /** The boundary used in the batch response to separate individual responses. */ - private final String boundary; - - /** List of request infos. */ - private final List> requestInfos; - - /** Input stream that contains the batch response. */ - private final InputStream inputStream; - - /** Determines whether there are any responses to be parsed. */ - boolean hasNext = true; - - /** List of unsuccessful HTTP requests that can be retried. */ - List> unsuccessfulRequestInfos = new ArrayList>(); - - /** Indicates if back off is required before the next retry. */ - boolean backOffRequired; - - /** The content Id the response is currently at. */ - private int contentId = 0; - - /** Whether unsuccessful HTTP requests can be retried. */ - private final boolean retryAllowed; - - /** - * Construct the {@link BatchUnparsedResponse}. - * - * @param inputStream Input stream that contains the batch response - * @param boundary The boundary of the batch response - * @param requestInfos List of request infos - * @param retryAllowed Whether unsuccessful HTTP requests can be retried - */ - BatchUnparsedResponse(InputStream inputStream, String boundary, - List> requestInfos, boolean retryAllowed) - throws IOException { - this.boundary = boundary; - this.requestInfos = requestInfos; - this.retryAllowed = retryAllowed; - this.inputStream = inputStream; - // First line in the stream will be the boundary. - checkForFinalBoundary(readLine()); - } - - /** - * Parses the next response in the queue if a data class and a {@link BatchCallback} is specified. - * - *

- * This method closes the input stream if there are no more individual responses left. - *

- */ - void parseNextResponse() throws IOException { - contentId++; - - // Extract the outer headers. - String line; - while ((line = readLine()) != null && !line.equals("")) { - // Do nothing. - } - - // Extract the status code. - String statusLine = readLine(); - String[] statusParts = statusLine.split(" "); - int statusCode = Integer.parseInt(statusParts[1]); - - // Extract and store the inner headers. - // TODO(rmistry): Handle inner headers that span multiple lines. More details here: - // http://tools.ietf.org/html/rfc2616#section-2.2 - List headerNames = new ArrayList(); - List headerValues = new ArrayList(); - long contentLength = -1L; - while ((line = readLine()) != null && !line.equals("")) { - String[] headerParts = line.split(": ", 2); - String headerName = headerParts[0]; - String headerValue = headerParts[1]; - headerNames.add(headerName); - headerValues.add(headerValue); - if ("Content-Length".equalsIgnoreCase(headerName.trim())) { - contentLength = Long.parseLong(headerValue); - } - } - - InputStream body; - if (contentLength == -1) { - // This isn't very efficient, but most respectable servers should set the Content-Length - ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - while ((line = readRawLine()) != null && !line.startsWith(boundary)) { - // Convert characters back to bytes: - buffer.write(line.getBytes("ISO-8859-1")); - } - - // Remove CRLF that separates body from boundary token - body = trimCrlf(buffer.toByteArray()); - - // Remove CRLF from the boundary token (to match readLine) - line = trimCrlf(line); - } else { - body = new FilterInputStream(ByteStreams.limit(inputStream, contentLength)) { - @Override - public void close() { - // Don't allow the parser to close the underlying stream - } - }; - } - - HttpResponse response = - getFakeResponse(statusCode, body, headerNames, headerValues); - - parseAndCallback(requestInfos.get(contentId - 1), statusCode, response); - - // Consume any bytes that were not consumed by the parser - while (body.skip(contentLength) > 0 || body.read() != -1) { - } - - if (contentLength != -1) { - line = readLine(); - } else { - // The line was already read - } - // Consume any blank lines that follow the response (not included in Content-Length) - while ((line != null) && (line.length() == 0)) { - line = readLine(); - } - - checkForFinalBoundary(line); - } - - /** - * Parse an object into a new instance of the data class using - * {@link HttpResponse#parseAs(java.lang.reflect.Type)}. - */ - private void parseAndCallback( - RequestInfo requestInfo, int statusCode, HttpResponse response) - throws IOException { - BatchCallback callback = requestInfo.callback; - - HttpHeaders responseHeaders = response.getHeaders(); - HttpUnsuccessfulResponseHandler unsuccessfulResponseHandler = - requestInfo.request.getUnsuccessfulResponseHandler(); - BackOffPolicy backOffPolicy = requestInfo.request.getBackOffPolicy(); - - // Reset backOff flag. - backOffRequired = false; - - if (HttpStatusCodes.isSuccess(statusCode)) { - if (callback == null) { - // No point in parsing if there is no callback. - return; - } - T parsed = getParsedDataClass(requestInfo.dataClass, response, requestInfo); - callback.onSuccess(parsed, responseHeaders); - } else { - HttpContent content = requestInfo.request.getContent(); - boolean retrySupported = retryAllowed && (content == null || content.retrySupported()); - boolean errorHandled = false; - boolean redirectRequest = false; - if (unsuccessfulResponseHandler != null) { - errorHandled = unsuccessfulResponseHandler.handleResponse( - requestInfo.request, response, retrySupported); - } - if (!errorHandled) { - if (requestInfo.request.handleRedirect(response.getStatusCode(), response.getHeaders())) { - redirectRequest = true; - } else if (retrySupported && backOffPolicy != null - && backOffPolicy.isBackOffRequired(response.getStatusCode())) { - backOffRequired = true; - } - } - if (retrySupported && (errorHandled || backOffRequired || redirectRequest)) { - unsuccessfulRequestInfos.add(requestInfo); - } else { - if (callback == null) { - // No point in parsing if there is no callback. - return; - } - E parsed = getParsedDataClass(requestInfo.errorClass, response, requestInfo); - callback.onFailure(parsed, responseHeaders); - } - } - } - - private A getParsedDataClass( - Class dataClass, HttpResponse response, RequestInfo requestInfo) throws IOException { - // TODO(yanivi): Remove the HttpResponse reference and directly parse the InputStream - if (dataClass == Void.class) { - return null; - } - return requestInfo.request.getParser().parseAndClose( - response.getContent(), response.getContentCharset(), dataClass); - } - - /** Create a fake HTTP response object populated with the partContent and the statusCode. */ - private HttpResponse getFakeResponse(final int statusCode, final InputStream partContent, - List headerNames, List headerValues) - throws IOException { - HttpRequest request = new FakeResponseHttpTransport( - statusCode, partContent, headerNames, headerValues).createRequestFactory() - .buildPostRequest(new GenericUrl("http://google.com/"), null); - request.setLoggingEnabled(false); - request.setThrowExceptionOnExecuteError(false); - return request.execute(); - } - - /** - * Reads an HTTP response line (ISO-8859-1 encoding). - * - * @return The line that was read, including CRLF. - */ - private String readRawLine() throws IOException { - int b = inputStream.read(); - if (b == -1) { - return null; - } else { - StringBuilder buffer = new StringBuilder(); - for (; b != -1; b = inputStream.read()) { - buffer.append((char) b); - if (b == '\n') { - break; - } - } - return buffer.toString(); - } - } - - /** - * Reads an HTTP response line (ISO-8859-1 encoding) - *

- * This method is similar to {@link java.io.BufferedReader#readLine()}, but handles newlines in a - * way that is consistent with the HTTP RFC 2616. - * - * @return The line that was read, excluding CRLF. - */ - private String readLine() throws IOException { - return trimCrlf(readRawLine()); - } - - private static String trimCrlf(String input) { - if (input.endsWith("\r\n")) { - return input.substring(0, input.length() - 2); - } else if (input.endsWith("\n")) { - return input.substring(0, input.length() - 1); - } else { - return input; - } - } - - private static InputStream trimCrlf(byte[] bytes) { - int length = bytes.length; - if (length > 0 && bytes[length - 1] == '\n') { - length--; - } - if (length > 0 && bytes[length - 1] == '\r') { - length--; - } - return new ByteArrayInputStream(bytes, 0, length); - } - - /** - * If the boundary line consists of the boundary and "--" then there are no more individual - * responses left to be parsed and the input stream is closed. - */ - private void checkForFinalBoundary(String boundaryLine) throws IOException { - if (boundaryLine.equals(boundary + "--")) { - hasNext = false; - inputStream.close(); - } - } - - private static class FakeResponseHttpTransport extends HttpTransport { - - private int statusCode; - private InputStream partContent; - private List headerNames; - private List headerValues; - - FakeResponseHttpTransport(int statusCode, InputStream partContent, List headerNames, - List headerValues) { - super(); - this.statusCode = statusCode; - this.partContent = partContent; - this.headerNames = headerNames; - this.headerValues = headerValues; - } - - @Override - protected LowLevelHttpRequest buildRequest(String method, String url) { - return new FakeLowLevelHttpRequest(partContent, statusCode, headerNames, headerValues); - } - } - - private static class FakeLowLevelHttpRequest extends LowLevelHttpRequest { - - private InputStream partContent; - private int statusCode; - private List headerNames; - private List headerValues; - - FakeLowLevelHttpRequest(InputStream partContent, int statusCode, List headerNames, - List headerValues) { - this.partContent = partContent; - this.statusCode = statusCode; - this.headerNames = headerNames; - this.headerValues = headerValues; - } - - @Override - public void addHeader(String name, String value) { - } - - @Override - public LowLevelHttpResponse execute() { - FakeLowLevelHttpResponse response = new FakeLowLevelHttpResponse( - partContent, statusCode, headerNames, headerValues); - return response; - } - } - - private static class FakeLowLevelHttpResponse extends LowLevelHttpResponse { - - private InputStream partContent; - private int statusCode; - private List headerNames = new ArrayList(); - private List headerValues = new ArrayList(); - - FakeLowLevelHttpResponse(InputStream partContent, int statusCode, List headerNames, - List headerValues) { - this.partContent = partContent; - this.statusCode = statusCode; - this.headerNames = headerNames; - this.headerValues = headerValues; - } - - @Override - public InputStream getContent() { - return partContent; - } - - @Override - public int getStatusCode() { - return statusCode; - } - - @Override - public String getContentEncoding() { - return null; - } - - @Override - public long getContentLength() { - return 0; - } - - @Override - public String getContentType() { - return null; - } - - @Override - public String getStatusLine() { - return null; - } - - @Override - public String getReasonPhrase() { - return null; - } - - @Override - public int getHeaderCount() { - return headerNames.size(); - } - - @Override - public String getHeaderName(int index) { - return headerNames.get(index); - } - - @Override - public String getHeaderValue(int index) { - return headerValues.get(index); - } - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/HttpRequestContent.java b/google-api-client/src/main/java/com/google/api/client/googleapis/batch/HttpRequestContent.java deleted file mode 100644 index 654d8fbd..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/HttpRequestContent.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.batch; - -import com.google.api.client.http.AbstractHttpContent; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpRequest; - -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; - -/** - * HTTP request wrapped as a content part of a multipart/mixed request. - * - * @author Yaniv Inbar - */ -class HttpRequestContent extends AbstractHttpContent { - - static final String NEWLINE = "\r\n"; - - /** HTTP request. */ - private final HttpRequest request; - - HttpRequestContent(HttpRequest request) { - super("application/http"); - this.request = request; - } - - public void writeTo(OutputStream out) throws IOException { - Writer writer = new OutputStreamWriter(out, getCharset()); - // write method and URL - writer.write(request.getRequestMethod()); - writer.write(" "); - writer.write(request.getUrl().build()); - writer.write(NEWLINE); - // write headers - HttpHeaders headers = new HttpHeaders(); - headers.fromHttpHeaders(request.getHeaders()); - headers.setAcceptEncoding(null).setUserAgent(null) - .setContentEncoding(null).setContentType(null).setContentLength(null); - // analyze the content - HttpContent content = request.getContent(); - if (content != null) { - headers.setContentType(content.getType()); - // NOTE: batch does not support gzip encoding - long contentLength = content.getLength(); - if (contentLength != -1) { - headers.setContentLength(contentLength); - } - } - HttpHeaders.serializeHeadersForMultipartRequests(headers, null, null, writer); - // write content - if (content != null) { - writer.write(NEWLINE); - writer.flush(); - content.writeTo(out); - } - } -} 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 deleted file mode 100644 index 65bea34f..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/json/JsonBatchCallback.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.batch.json; - -import com.google.api.client.googleapis.batch.BatchCallback; -import com.google.api.client.googleapis.json.GoogleJsonError; -import com.google.api.client.googleapis.json.GoogleJsonErrorContainer; -import com.google.api.client.http.HttpHeaders; - -import java.io.IOException; - -/** - * Callback for an individual batch JSON response. - * - *

- * Sample use: - *

- * - *
-   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());
-     }
-   });
- * 
- * - * @param Type of the data model class - * @since 1.9 - * @author rmistry@google.com (Ravi Mistry) - */ -public abstract class JsonBatchCallback implements BatchCallback { - - public final void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders) - throws IOException { - onFailure(e.getError(), responseHeaders); - } - - /** - * Called if the individual batch response is unsuccessful. - * - * @param e Google JSON error response content - * @param responseHeaders Headers of the batch response - */ - public abstract void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) - throws IOException; -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/json/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/batch/json/package-info.java deleted file mode 100644 index 33566b16..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/json/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * JSON batch for Google API's. - * - * @since 1.9 - * @author Ravi Mistry - */ - -package com.google.api.client.googleapis.batch.json; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/batch/package-info.java deleted file mode 100644 index 51f4087d..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/batch/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Batch for Google API's. - * - * @since 1.9 - * @author Ravi Mistry - */ - -package com.google.api.client.googleapis.batch; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/compute/ComputeCredential.java b/google-api-client/src/main/java/com/google/api/client/googleapis/compute/ComputeCredential.java deleted file mode 100644 index 8e19a28b..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/compute/ComputeCredential.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.compute; - -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.auth.oauth2.CredentialRefreshListener; -import com.google.api.client.auth.oauth2.TokenResponse; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonObjectParser; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Clock; -import com.google.api.client.util.Preconditions; - -import java.io.IOException; -import java.util.Collection; - -/** - * {@link Beta}
- * Google Compute Engine service accounts OAuth 2.0 credential based on
Authenticating from Google - * Compute Engine. - * - *

- * Sample usage: - *

- * - *
-  public static HttpRequestFactory createRequestFactory(
-      HttpTransport transport, JsonFactory jsonFactory) {
-    return transport.createRequestFactory(new GoogleComputeCredential(transport, jsonFactory));
-  }
- * 
- * - *

- * Implementation is immutable and thread-safe. - *

- * - * @since 1.15 - * @author Yaniv Inbar - */ -@Beta -public class ComputeCredential extends Credential { - - /** Metadata Service Account token server encoded URL. */ - public static final String TOKEN_SERVER_ENCODED_URL = - "http://metadata/computeMetadata/v1/instance/service-accounts/default/token"; - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - */ - public ComputeCredential(HttpTransport transport, JsonFactory jsonFactory) { - this(new Builder(transport, jsonFactory)); - } - - /** - * @param builder builder - */ - protected ComputeCredential(Builder builder) { - super(builder); - } - - @Override - protected TokenResponse executeRefreshToken() throws IOException { - GenericUrl tokenUrl = new GenericUrl(getTokenServerEncodedUrl()); - HttpRequest request = getTransport().createRequestFactory().buildGetRequest(tokenUrl); - request.setParser(new JsonObjectParser(getJsonFactory())); - request.getHeaders().set("X-Google-Metadata-Request", true); - return request.execute().parseAs(TokenResponse.class); - } - - /** - * {@link Beta}
- * Google Compute Engine credential builder. - * - *

- * Implementation is not thread-safe. - *

- */ - @Beta - public static class Builder extends Credential.Builder { - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - */ - public Builder(HttpTransport transport, JsonFactory jsonFactory) { - super(BearerToken.authorizationHeaderAccessMethod()); - setTransport(transport); - setJsonFactory(jsonFactory); - setTokenServerEncodedUrl(TOKEN_SERVER_ENCODED_URL); - } - - @Override - public ComputeCredential build() { - return new ComputeCredential(this); - } - - @Override - public Builder setTransport(HttpTransport transport) { - return (Builder) super.setTransport(Preconditions.checkNotNull(transport)); - } - - @Override - public Builder setClock(Clock clock) { - return (Builder) super.setClock(clock); - } - - @Override - public Builder setJsonFactory(JsonFactory jsonFactory) { - return (Builder) super.setJsonFactory(Preconditions.checkNotNull(jsonFactory)); - } - - @Override - public Builder setTokenServerUrl(GenericUrl tokenServerUrl) { - return (Builder) super.setTokenServerUrl(Preconditions.checkNotNull(tokenServerUrl)); - } - - @Override - public Builder setTokenServerEncodedUrl(String tokenServerEncodedUrl) { - return (Builder) super.setTokenServerEncodedUrl( - Preconditions.checkNotNull(tokenServerEncodedUrl)); - } - - @Override - public Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication) { - Preconditions.checkArgument(clientAuthentication == null); - return this; - } - - @Override - public Builder setRequestInitializer(HttpRequestInitializer requestInitializer) { - return (Builder) super.setRequestInitializer(requestInitializer); - } - - @Override - public Builder addRefreshListener(CredentialRefreshListener refreshListener) { - return (Builder) super.addRefreshListener(refreshListener); - } - - @Override - public Builder setRefreshListeners(Collection refreshListeners) { - return (Builder) super.setRefreshListeners(refreshListeners); - } - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/compute/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/compute/package-info.java deleted file mode 100644 index 7ba6dc9c..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/compute/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Support for Google Compute Engine. - * - * @since 1.15 - * @author Yaniv Inbar - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.compute; - 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 deleted file mode 100644 index 9029ef11..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/javanet/GoogleNetHttpTransport.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.javanet; - -import com.google.api.client.googleapis.GoogleUtils; -import com.google.api.client.http.javanet.NetHttpTransport; - -import java.io.IOException; -import java.security.GeneralSecurityException; -import java.security.KeyStore; - -/** - * Utilities for Google APIs based on {@link NetHttpTransport}. - * - * @since 1.14 - * @author Yaniv Inbar - */ -public class GoogleNetHttpTransport { - - /** - * Returns a new instance of {@link NetHttpTransport} that uses - * {@link GoogleUtils#getCertificateTrustStore()} for the trusted certificates using - * {@link com.google.api.client.http.javanet.NetHttpTransport.Builder#trustCertificates(KeyStore)} - * . - * - *

- * This helper method doesn't provide for customization of the {@link NetHttpTransport}, such as - * the ability to specify a proxy. To do use, use - * {@link com.google.api.client.http.javanet.NetHttpTransport.Builder}, for example: - *

- * - *
-  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();
-  }
-   * 
- */ - public static NetHttpTransport newTrustedTransport() - throws GeneralSecurityException, IOException { - return new NetHttpTransport.Builder().trustCertificates(GoogleUtils.getCertificateTrustStore()) - .build(); - } - - private GoogleNetHttpTransport() { - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/javanet/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/javanet/package-info.java deleted file mode 100644 index 10669c03..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/javanet/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Google API's support based on the {@code java.net} package. - * - * @since 1.14 - * @author Yaniv Inbar - */ - -package com.google.api.client.googleapis.javanet; - 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 deleted file mode 100644 index 18864c3e..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/json/GoogleJsonError.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.json; - -import com.google.api.client.http.HttpResponse; -import com.google.api.client.json.GenericJson; -import com.google.api.client.json.Json; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonObjectParser; -import com.google.api.client.util.Data; -import com.google.api.client.util.Key; - -import java.io.IOException; -import java.util.Collections; -import java.util.List; - -/** - * Data class representing the Google JSON error response content, as documented for example in Error - * responses. - * - * @since 1.4 - * @author Yaniv Inbar - */ -public class GoogleJsonError extends GenericJson { - - /** - * Parses the given error HTTP response using the given JSON factory. - * - * @param jsonFactory JSON factory - * @param response HTTP response - * @return new instance of the Google JSON error information - * @throws IllegalArgumentException if content type is not {@link Json#MEDIA_TYPE} or if expected - * {@code "data"} or {@code "error"} key is not found - */ - public static GoogleJsonError parse(JsonFactory jsonFactory, HttpResponse response) - throws IOException { - JsonObjectParser jsonObjectParser = new JsonObjectParser.Builder(jsonFactory).setWrapperKeys( - Collections.singleton("error")).build(); - return jsonObjectParser.parseAndClose( - response.getContent(), response.getContentCharset(), GoogleJsonError.class); - } - - static { - // hack to force ProGuard to consider ErrorInfo used, since otherwise it would be stripped out - // see http://code.google.com/p/google-api-java-client/issues/detail?id=527 - Data.nullOf(ErrorInfo.class); - } - - /** Detailed error information. */ - public static class ErrorInfo extends GenericJson { - - /** Error classification or {@code null} for none. */ - @Key - private String domain; - - /** Error reason or {@code null} for none. */ - @Key - private String reason; - - /** Human readable explanation of the error or {@code null} for none. */ - @Key - private String message; - - /** - * Location in the request that caused the error or {@code null} for none or {@code null} for - * none. - */ - @Key - private String location; - - /** Type of location in the request that caused the error or {@code null} for none. */ - @Key - private String locationType; - - /** - * Returns the error classification or {@code null} for none. - * - * @since 1.8 - */ - public final String getDomain() { - return domain; - } - - /** - * Sets the error classification or {@code null} for none. - * - * @since 1.8 - */ - public final void setDomain(String domain) { - this.domain = domain; - } - - /** - * Returns the error reason or {@code null} for none. - * - * @since 1.8 - */ - public final String getReason() { - return reason; - } - - /** - * Sets the error reason or {@code null} for none. - * - * @since 1.8 - */ - public final void setReason(String reason) { - this.reason = reason; - } - - /** - * Returns the human readable explanation of the error or {@code null} for none. - * - * @since 1.8 - */ - public final String getMessage() { - return message; - } - - /** - * Sets the human readable explanation of the error or {@code null} for none. - * - * @since 1.8 - */ - public final void setMessage(String message) { - this.message = message; - } - - /** - * Returns the location in the request that caused the error or {@code null} for none or - * {@code null} for none. - * - * @since 1.8 - */ - public final String getLocation() { - return location; - } - - /** - * Sets the location in the request that caused the error or {@code null} for none or - * {@code null} for none. - * - * @since 1.8 - */ - public final void setLocation(String location) { - this.location = location; - } - - /** - * Returns the type of location in the request that caused the error or {@code null} for none. - * - * @since 1.8 - */ - public final String getLocationType() { - return locationType; - } - - /** - * Sets the type of location in the request that caused the error or {@code null} for none. - * - * @since 1.8 - */ - public final void setLocationType(String locationType) { - this.locationType = locationType; - } - - @Override - public ErrorInfo set(String fieldName, Object value) { - return (ErrorInfo) super.set(fieldName, value); - } - - @Override - public ErrorInfo clone() { - return (ErrorInfo) super.clone(); - } - } - - /** List of detailed errors or {@code null} for none. */ - @Key - private List errors; - - /** HTTP status code of this response or {@code null} for none. */ - @Key - private int code; - - /** Human-readable explanation of the error or {@code null} for none. */ - @Key - private String message; - - /** - * Returns the list of detailed errors or {@code null} for none. - * - * @since 1.8 - */ - public final List getErrors() { - return errors; - } - - /** - * Sets the list of detailed errors or {@code null} for none. - * - * @since 1.8 - */ - public final void setErrors(List errors) { - this.errors = errors; - } - - /** - * Returns the HTTP status code of this response or {@code null} for none. - * - * @since 1.8 - */ - public final int getCode() { - return code; - } - - /** - * Sets the HTTP status code of this response or {@code null} for none. - * - * @since 1.8 - */ - public final void setCode(int code) { - this.code = code; - } - - /** - * Returns the human-readable explanation of the error or {@code null} for none. - * - * @since 1.8 - */ - public final String getMessage() { - return message; - } - - /** - * Sets the human-readable explanation of the error or {@code null} for none. - * - * @since 1.8 - */ - public final void setMessage(String message) { - this.message = message; - } - - @Override - public GoogleJsonError set(String fieldName, Object value) { - return (GoogleJsonError) super.set(fieldName, value); - } - - @Override - public GoogleJsonError clone() { - return (GoogleJsonError) super.clone(); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/json/GoogleJsonErrorContainer.java b/google-api-client/src/main/java/com/google/api/client/googleapis/json/GoogleJsonErrorContainer.java deleted file mode 100644 index 547eb027..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/json/GoogleJsonErrorContainer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.json; - -import com.google.api.client.json.GenericJson; -import com.google.api.client.util.Key; - -/** - * Data class representing a container of {@link GoogleJsonError}. - * - * @since 1.9 - * @author rmistry@google.com (Ravi Mistry) - */ -public class GoogleJsonErrorContainer extends GenericJson { - - @Key - private GoogleJsonError error; - - /** Returns the {@link GoogleJsonError}. */ - public final GoogleJsonError getError() { - return error; - } - - /** Sets the {@link GoogleJsonError}. */ - public final void setError(GoogleJsonError error) { - this.error = error; - } - - @Override - public GoogleJsonErrorContainer set(String fieldName, Object value) { - return (GoogleJsonErrorContainer) super.set(fieldName, value); - } - - @Override - public GoogleJsonErrorContainer clone() { - return (GoogleJsonErrorContainer) super.clone(); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/json/GoogleJsonResponseException.java b/google-api-client/src/main/java/com/google/api/client/googleapis/json/GoogleJsonResponseException.java deleted file mode 100644 index 6047aada..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/json/GoogleJsonResponseException.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.json; - -import com.google.api.client.http.HttpMediaType; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpResponseException; -import com.google.api.client.json.Json; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonParser; -import com.google.api.client.json.JsonToken; -import com.google.api.client.util.Preconditions; -import com.google.api.client.util.StringUtils; - -import java.io.IOException; - -/** - * Exception thrown when an error status code is detected in an HTTP response to a Google API that - * uses the JSON format, using the format specified in Error - * Responses. - * - *

- * 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()}. - *

- * - *
-  static void executeShowingError(JsonFactory factory, HttpRequest request) throws IOException {
-    try {
-      GoogleJsonResponseException.execute(factory, request);
-    } catch (GoogleJsonResponseException e) {
-      System.err.println(e.getDetails());
-    }
-  }
- * 
- * - * @since 1.6 - * @author Yaniv Inbar - */ -public class GoogleJsonResponseException extends HttpResponseException { - - private static final long serialVersionUID = 409811126989994864L; - - /** Google JSON error details or {@code null} for none (for example if response is not JSON). */ - private final transient GoogleJsonError details; - - /** - * @param builder builder - * @param details Google JSON error details - */ - GoogleJsonResponseException(Builder builder, GoogleJsonError details) { - super(builder); - this.details = details; - } - - /** - * Returns the Google JSON error details or {@code null} for none (for example if response is not - * JSON). - */ - public final GoogleJsonError getDetails() { - return details; - } - - /** - * Returns a new instance of {@link GoogleJsonResponseException}. - * - *

- * If there is a JSON error response, it is parsed using {@link GoogleJsonError}, which can be - * inspected using {@link #getDetails()}. Otherwise, the full response content is read and - * included in the exception message. - *

- * - * @param jsonFactory JSON factory - * @param response HTTP response - * @return new instance of {@link GoogleJsonResponseException} - */ - public static GoogleJsonResponseException from(JsonFactory jsonFactory, HttpResponse response) { - HttpResponseException.Builder builder = new HttpResponseException.Builder( - response.getStatusCode(), response.getStatusMessage(), response.getHeaders()); - // details - Preconditions.checkNotNull(jsonFactory); - GoogleJsonError details = null; - String detailString = null; - try { - if (!response.isSuccessStatusCode() - && HttpMediaType.equalsIgnoreParameters(Json.MEDIA_TYPE, response.getContentType()) - && response.getContent() != null) { - JsonParser parser = null; - try { - parser = jsonFactory.createJsonParser(response.getContent()); - JsonToken currentToken = parser.getCurrentToken(); - // token is null at start, so get next token - if (currentToken == null) { - currentToken = parser.nextToken(); - } - // check for empty content - if (currentToken != null) { - // make sure there is an "error" key - parser.skipToKey("error"); - if (parser.getCurrentToken() != JsonToken.END_OBJECT) { - details = parser.parseAndClose(GoogleJsonError.class); - detailString = details.toPrettyString(); - } - } - } catch (IOException exception) { - // it would be bad to throw an exception while throwing an exception - exception.printStackTrace(); - } finally { - if (parser == null) { - response.ignore(); - } else if (details == null) { - parser.close(); - } - } - } else { - detailString = response.parseAsString(); - } - } catch (IOException exception) { - // it would be bad to throw an exception while throwing an exception - exception.printStackTrace(); - } - // message - StringBuilder message = HttpResponseException.computeMessageBuffer(response); - if (!com.google.api.client.util.Strings.isNullOrEmpty(detailString)) { - message.append(StringUtils.LINE_SEPARATOR).append(detailString); - builder.setContent(detailString); - } - builder.setMessage(message.toString()); - // result - return new GoogleJsonResponseException(builder, details); - } - - /** - * Executes an HTTP request using {@link HttpRequest#execute()}, but throws a - * {@link GoogleJsonResponseException} on error instead of {@link HttpResponseException}. - * - *

- * 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: - *

- * - *
-     HttpResponse response = GoogleJsonResponseException.execute(jsonFactory, request);
-     try {
-       // process the HTTP response object
-     } finally {
-       response.disconnect();
-     }
-   * 
- * - * @param jsonFactory JSON factory - * @param request HTTP request - * @return HTTP response for an HTTP success code (or error code if - * {@link HttpRequest#getThrowExceptionOnExecuteError()}) - * @throws GoogleJsonResponseException for an HTTP error code (only if not - * {@link HttpRequest#getThrowExceptionOnExecuteError()}) - * @throws IOException some other kind of I/O exception - * @since 1.7 - */ - public static HttpResponse execute(JsonFactory jsonFactory, HttpRequest request) - throws GoogleJsonResponseException, IOException { - Preconditions.checkNotNull(jsonFactory); - boolean originalThrowExceptionOnExecuteError = request.getThrowExceptionOnExecuteError(); - if (originalThrowExceptionOnExecuteError) { - request.setThrowExceptionOnExecuteError(false); - } - HttpResponse response = request.execute(); - request.setThrowExceptionOnExecuteError(originalThrowExceptionOnExecuteError); - if (!originalThrowExceptionOnExecuteError || response.isSuccessStatusCode()) { - return response; - } - throw GoogleJsonResponseException.from(jsonFactory, response); - } -} 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 deleted file mode 100644 index 96469344..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/json/package-info.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Google's JSON support (see detailed package specification). - * - *

Package Specification

- * - *

- * 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) - *

- * - *

- "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"
-         },
-...
-        }
-    ]
- }
-
- * - *

- * Here's one possible way to design the Java data classes for this (each class in its own Java - * file): - *

- * - *

-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;
-  }
-
-  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;
-  }
-
-  public class Player {
-    // "default" is a Java keyword, so need to specify the JSON key manually
-    @Key("default")
-    public String defaultUrl;
-  }
-
- * - *

- * You can also use the @{@link com.google.api.client.util.Key} annotation to defined query - * parameters for a URL. For example: - *

- * - *

-public class YouTubeUrl extends GoogleUrl {
-
-  @Key
-  public String author;
-
-  @Key("max-results")
-  public Integer maxResults;
-
-  public YouTubeUrl(String encodedUrl) {
-    super(encodedUrl);
-    this.alt = "jsonc";
-  }
-
- * - *

- * To work with the YouTube API, you first need to set up the - * {@link com.google.api.client.http.HttpTransport}. For example: - *

- * - *

-  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 JacksonFactory();
-    transport.addParser(parser);
-    // insert authentication code...
-    return transport;
-  }
-
- * - *

- * Now that we have a transport, we can execute a request to the YouTube API and parse the result: - *

- * - *

-  public static VideoFeed list(HttpTransport transport, YouTubeUrl url)
-      throws IOException {
-    HttpRequest request = transport.buildGetRequest();
-    request.url = url;
-    return request.execute().parseAs(VideoFeed.class);
-  }
-
- * - *

- * 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: - *

- * - *

-    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;
-    }
-
- * - *

- * 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. - *

- * - * @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/MediaHttpDownloader.java b/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpDownloader.java deleted file mode 100644 index 7add848f..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpDownloader.java +++ /dev/null @@ -1,444 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.media; - -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpBackOffIOExceptionHandler; -import com.google.api.client.http.HttpBackOffUnsuccessfulResponseHandler; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.util.IOUtils; -import com.google.api.client.util.Preconditions; - -import java.io.IOException; -import java.io.OutputStream; - -/** - * Media HTTP Downloader, with support for both direct and resumable media downloads. Documentation - * is available here. - * - *

- * Implementation is not thread-safe. - *

- * - *

- * Back-off is disabled by default. To enable it for an abnormal HTTP response and an I/O exception - * you should call {@link HttpRequest#setUnsuccessfulResponseHandler} with a new - * {@link HttpBackOffUnsuccessfulResponseHandler} instance and - * {@link HttpRequest#setIOExceptionHandler} with {@link HttpBackOffIOExceptionHandler}. - *

- * - *

- * Upgrade warning: in prior version 1.14 exponential back-off was enabled by default for an - * abnormal HTTP response. Starting with version 1.15 it's disabled by default. - *

- * - * @since 1.9 - * - * @author rmistry@google.com (Ravi Mistry) - */ -@SuppressWarnings("deprecation") -public final class MediaHttpDownloader { - - /** - * Download state associated with the Media HTTP downloader. - */ - public enum DownloadState { - /** The download process has not started yet. */ - NOT_STARTED, - - /** Set after a media file chunk is downloaded. */ - MEDIA_IN_PROGRESS, - - /** Set after the complete media file is successfully downloaded. */ - MEDIA_COMPLETE - } - - /** - * Default maximum number of bytes that will be downloaded from the server in any single HTTP - * request. Set to 32MB because that is the maximum App Engine request size. - */ - public static final int MAXIMUM_CHUNK_SIZE = 32 * MediaHttpUploader.MB; - - /** The request factory for connections to the server. */ - private final HttpRequestFactory requestFactory; - - /** The transport to use for requests. */ - private final HttpTransport transport; - - /** - * Determines whether direct media download is enabled or disabled. If value is set to - * {@code true} then a direct download will be done where the whole media content is downloaded in - * a single request. If value is set to {@code false} then the download uses the resumable media - * download protocol to download in data chunks. Defaults to {@code false}. - */ - private boolean directDownloadEnabled = false; - - /** - * Progress listener to send progress notifications to or {@code null} for none. - */ - private MediaHttpDownloaderProgressListener progressListener; - - /** - * Maximum size of individual chunks that will get downloaded by single HTTP requests. The default - * value is {@link #MAXIMUM_CHUNK_SIZE}. - */ - private int chunkSize = MAXIMUM_CHUNK_SIZE; - - /** - * The length of the HTTP media content or {@code 0} before it is initialized in - * {@link #setMediaContentLength}. - */ - private long mediaContentLength; - - /** The current state of the downloader. */ - private DownloadState downloadState = DownloadState.NOT_STARTED; - - /** The total number of bytes downloaded by this downloader. */ - private long bytesDownloaded; - - /** - * The last byte position of the media file we want to download, default value is {@code -1}. - * - *

- * If its value is {@code -1} it means there is no upper limit on the byte position. - *

- */ - private long lastBytePos = -1; - - /** - * Construct the {@link MediaHttpDownloader}. - * - * @param transport The transport to use for requests - * @param httpRequestInitializer The initializer to use when creating an {@link HttpRequest} or - * {@code null} for none - */ - public MediaHttpDownloader( - HttpTransport transport, HttpRequestInitializer httpRequestInitializer) { - this.transport = Preconditions.checkNotNull(transport); - this.requestFactory = httpRequestInitializer == null - ? transport.createRequestFactory() : transport.createRequestFactory(httpRequestInitializer); - } - - /** - * Executes a direct media download or a resumable media download. - * - *

- * This method does not close the given output stream. - *

- * - *

- * This method is not reentrant. A new instance of {@link MediaHttpDownloader} must be - * instantiated before download called be called again. - *

- * - * @param requestUrl The request URL where the download requests will be sent - * @param outputStream destination output stream - */ - public void download(GenericUrl requestUrl, OutputStream outputStream) throws IOException { - download(requestUrl, null, outputStream); - } - - /** - * Executes a direct media download or a resumable media download. - * - *

- * This method does not close the given output stream. - *

- * - *

- * This method is not reentrant. A new instance of {@link MediaHttpDownloader} must be - * instantiated before download called be called again. - *

- * - * @param requestUrl request URL where the download requests will be sent - * @param requestHeaders request headers or {@code null} to ignore - * @param outputStream destination output stream - * @since 1.12 - */ - public void download(GenericUrl requestUrl, HttpHeaders requestHeaders, OutputStream outputStream) - throws IOException { - Preconditions.checkArgument(downloadState == DownloadState.NOT_STARTED); - requestUrl.put("alt", "media"); - - if (directDownloadEnabled) { - updateStateAndNotifyListener(DownloadState.MEDIA_IN_PROGRESS); - HttpResponse response = - executeCurrentRequest(lastBytePos, requestUrl, requestHeaders, outputStream); - // All required bytes have been downloaded from the server. - mediaContentLength = response.getHeaders().getContentLength(); - bytesDownloaded = mediaContentLength; - updateStateAndNotifyListener(DownloadState.MEDIA_COMPLETE); - return; - } - - // Download the media content in chunks. - while (true) { - long currentRequestLastBytePos = bytesDownloaded + chunkSize - 1; - if (lastBytePos != -1) { - // If last byte position has been specified use it iff it is smaller than the chunksize. - currentRequestLastBytePos = Math.min(lastBytePos, currentRequestLastBytePos); - } - HttpResponse response = executeCurrentRequest( - currentRequestLastBytePos, requestUrl, requestHeaders, outputStream); - - String contentRange = response.getHeaders().getContentRange(); - long nextByteIndex = getNextByteIndex(contentRange); - setMediaContentLength(contentRange); - - if (mediaContentLength <= nextByteIndex) { - // All required bytes have been downloaded from the server. - bytesDownloaded = mediaContentLength; - updateStateAndNotifyListener(DownloadState.MEDIA_COMPLETE); - return; - } - - bytesDownloaded = nextByteIndex; - updateStateAndNotifyListener(DownloadState.MEDIA_IN_PROGRESS); - } - } - - /** - * Executes the current request. - * - * @param currentRequestLastBytePos last byte position for current request - * @param requestUrl request URL where the download requests will be sent - * @param requestHeaders request headers or {@code null} to ignore - * @param outputStream destination output stream - * @return HTTP response - */ - private HttpResponse executeCurrentRequest(long currentRequestLastBytePos, GenericUrl requestUrl, - HttpHeaders requestHeaders, OutputStream outputStream) throws IOException { - // prepare the GET request - HttpRequest request = requestFactory.buildGetRequest(requestUrl); - // add request headers - if (requestHeaders != null) { - request.getHeaders().putAll(requestHeaders); - } - // set Range header (if necessary) - if (bytesDownloaded != 0 || currentRequestLastBytePos != -1) { - StringBuilder rangeHeader = new StringBuilder(); - rangeHeader.append("bytes=").append(bytesDownloaded).append("-"); - if (currentRequestLastBytePos != -1) { - rangeHeader.append(currentRequestLastBytePos); - } - request.getHeaders().setRange(rangeHeader.toString()); - } - // execute the request and copy into the output stream - HttpResponse response = request.execute(); - try { - IOUtils.copy(response.getContent(), outputStream); - } finally { - response.disconnect(); - } - return response; - } - - /** - * Returns the next byte index identifying data that the server has not yet sent out, obtained - * from the HTTP Content-Range header (E.g a header of "Content-Range: 0-55/1000" would cause 56 - * to be returned). null headers cause 0 to be returned. - * - * @param rangeHeader in the HTTP response - * @return the byte index beginning where the server has yet to send out data - */ - private long getNextByteIndex(String rangeHeader) { - if (rangeHeader == null) { - return 0L; - } - return Long.parseLong( - rangeHeader.substring(rangeHeader.indexOf('-') + 1, rangeHeader.indexOf('/'))) + 1; - } - - /** - * Sets the total number of bytes that have been downloaded of the media resource. - * - *

- * If a download was aborted mid-way due to a connection failure then users can resume the - * download from the point where it left off. - *

- * - *

- * Use {@link #setContentRange} if you need to specify both the bytes downloaded and the last byte - * position. - *

- * - * @param bytesDownloaded The total number of bytes downloaded - */ - public MediaHttpDownloader setBytesDownloaded(long bytesDownloaded) { - Preconditions.checkArgument(bytesDownloaded >= 0); - this.bytesDownloaded = bytesDownloaded; - return this; - } - - /** - * Sets the content range of the next download request. Eg: bytes=firstBytePos-lastBytePos. - * - *

- * If a download was aborted mid-way due to a connection failure then users can resume the - * download from the point where it left off. - *

- * - *

- * Use {@link #setBytesDownloaded} if you only need to specify the first byte position. - *

- * - * @param firstBytePos The first byte position in the content range string - * @param lastBytePos The last byte position in the content range string. - * @since 1.13 - */ - public MediaHttpDownloader setContentRange(long firstBytePos, int lastBytePos) { - Preconditions.checkArgument(lastBytePos >= firstBytePos); - setBytesDownloaded(firstBytePos); - this.lastBytePos = lastBytePos; - return this; - } - - /** - * Sets the media content length from the HTTP Content-Range header (E.g a header of - * "Content-Range: 0-55/1000" would cause 1000 to be set. null headers do not set - * anything. - * - * @param rangeHeader in the HTTP response - */ - private void setMediaContentLength(String rangeHeader) { - if (rangeHeader == null) { - return; - } - if (mediaContentLength == 0) { - mediaContentLength = Long.parseLong(rangeHeader.substring(rangeHeader.indexOf('/') + 1)); - } - } - - /** - * Returns whether direct media download is enabled or disabled. If value is set to {@code true} - * then a direct download will be done where the whole media content is downloaded in a single - * request. If value is set to {@code false} then the download uses the resumable media download - * protocol to download in data chunks. Defaults to {@code false}. - */ - public boolean isDirectDownloadEnabled() { - return directDownloadEnabled; - } - - /** - * Returns whether direct media download is enabled or disabled. If value is set to {@code true} - * then a direct download will be done where the whole media content is downloaded in a single - * request. If value is set to {@code false} then the download uses the resumable media download - * protocol to download in data chunks. Defaults to {@code false}. - */ - public MediaHttpDownloader setDirectDownloadEnabled(boolean directDownloadEnabled) { - this.directDownloadEnabled = directDownloadEnabled; - return this; - } - - /** - * Sets the progress listener to send progress notifications to or {@code null} for none. - */ - public MediaHttpDownloader setProgressListener( - MediaHttpDownloaderProgressListener progressListener) { - this.progressListener = progressListener; - return this; - } - - /** - * Returns the progress listener to send progress notifications to or {@code null} for none. - */ - public MediaHttpDownloaderProgressListener getProgressListener() { - return progressListener; - } - - /** Returns the transport to use for requests. */ - public HttpTransport getTransport() { - return transport; - } - - /** - * Sets the maximum size of individual chunks that will get downloaded by single HTTP requests. - * The default value is {@link #MAXIMUM_CHUNK_SIZE}. - * - *

- * The maximum allowable value is {@link #MAXIMUM_CHUNK_SIZE}. - *

- */ - public MediaHttpDownloader setChunkSize(int chunkSize) { - Preconditions.checkArgument(chunkSize > 0 && chunkSize <= MAXIMUM_CHUNK_SIZE); - this.chunkSize = chunkSize; - return this; - } - - /** - * Returns the maximum size of individual chunks that will get downloaded by single HTTP requests. - * The default value is {@link #MAXIMUM_CHUNK_SIZE}. - */ - public int getChunkSize() { - return chunkSize; - } - - /** - * Gets the total number of bytes downloaded by this downloader. - * - * @return the number of bytes downloaded - */ - public long getNumBytesDownloaded() { - return bytesDownloaded; - } - - /** - * Gets the last byte position of the media file we want to download or {@code -1} if there is no - * upper limit on the byte position. - * - * @return the last byte position - * @since 1.13 - */ - public long getLastBytePosition() { - return lastBytePos; - } - - /** - * Sets the download state and notifies the progress listener. - * - * @param downloadState value to set to - */ - private void updateStateAndNotifyListener(DownloadState downloadState) throws IOException { - this.downloadState = downloadState; - if (progressListener != null) { - progressListener.progressChanged(this); - } - } - - /** - * Gets the current download state of the downloader. - * - * @return the download state - */ - public DownloadState getDownloadState() { - return downloadState; - } - - /** - * Gets the download progress denoting the percentage of bytes that have been downloaded, - * represented between 0.0 (0%) and 1.0 (100%). - * - * @return the download progress - */ - public double getProgress() { - return mediaContentLength == 0 ? 0 : (double) bytesDownloaded / mediaContentLength; - } -} 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 deleted file mode 100644 index 064b2def..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpDownloaderProgressListener.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.media; - -import java.io.IOException; - -/** - * An interface for receiving progress notifications for downloads. - * - *

- * Sample usage: - *

- * - *
-  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;
-      }
-    }
-  }
- * 
- * - * @since 1.9 - * @author rmistry@google.com (Ravi Mistry) - */ -public interface MediaHttpDownloaderProgressListener { - - /** - * Called to notify that progress has been changed. - * - *

- * This method is called multiple times depending on how many chunks are downloaded. Once the - * download completes it is called one final time. - *

- * - *

- * The download state can be queried by calling {@link MediaHttpDownloader#getDownloadState} and - * the progress by calling {@link MediaHttpDownloader#getProgress}. - *

- * - * @param downloader Media HTTP downloader - */ - public void progressChanged(MediaHttpDownloader downloader) throws IOException; -} 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 deleted file mode 100644 index eecc30c3..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpUploader.java +++ /dev/null @@ -1,940 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.media; - -import com.google.api.client.googleapis.MethodOverride; -import com.google.api.client.http.AbstractInputStreamContent; -import com.google.api.client.http.ByteArrayContent; -import com.google.api.client.http.EmptyContent; -import com.google.api.client.http.GZipEncoding; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpBackOffIOExceptionHandler; -import com.google.api.client.http.HttpBackOffUnsuccessfulResponseHandler; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpMethods; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.InputStreamContent; -import com.google.api.client.http.MultipartContent; -import com.google.api.client.util.Beta; -import com.google.api.client.util.ByteStreams; -import com.google.api.client.util.Preconditions; -import com.google.api.client.util.Sleeper; - -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Arrays; - -/** - * Media HTTP Uploader, with support for both direct and resumable media uploads. Documentation is - * available here. - * - *

- * For resumable uploads, when the media content length is known, if the provided - * {@link InputStream} has {@link InputStream#markSupported} as {@code false} then it is wrapped in - * an {@link BufferedInputStream} to support the {@link InputStream#mark} and - * {@link InputStream#reset} methods required for handling server errors. If the media content - * length is unknown then each chunk is stored temporarily in memory. This is required to determine - * when the last chunk is reached. - *

- * - *

- * See {@link #setDisableGZipContent(boolean)} for information on when content is gzipped and how to - * control that behavior. - *

- * - *

- * Back-off is disabled by default. To enable it for an abnormal HTTP response and an I/O exception - * you should call {@link HttpRequest#setUnsuccessfulResponseHandler} with a new - * {@link HttpBackOffUnsuccessfulResponseHandler} instance and - * {@link HttpRequest#setIOExceptionHandler} with {@link HttpBackOffIOExceptionHandler}. - *

- * - *

- * Upgrade warning: in prior version 1.14 exponential back-off was enabled by default for an - * abnormal HTTP response and there was a regular retry (without back-off) when I/O exception was - * thrown. Starting with version 1.15 back-off is disabled and there is no retry on I/O exception by - * default. - *

- * - *

- * Upgrade warning: in prior version 1.16 {@link #serverErrorCallback} was public but starting with - * version 1.17 it has been removed from the public API, and changed to be package private. - *

- * - *

- * Implementation is not thread-safe. - *

- * - * @since 1.9 - * - * @author rmistry@google.com (Ravi Mistry) - * @author peleyal@google.com (Eyal Peled) - */ -@SuppressWarnings("deprecation") -public final class MediaHttpUploader { - - /** - * Upload content type header. - * - * @since 1.13 - */ - public static final String CONTENT_LENGTH_HEADER = "X-Upload-Content-Length"; - - /** - * Upload content length header. - * - * @since 1.13 - */ - public static final String CONTENT_TYPE_HEADER = "X-Upload-Content-Type"; - - /** - * Upload state associated with the Media HTTP uploader. - */ - public enum UploadState { - /** The upload process has not started yet. */ - NOT_STARTED, - - /** Set before the initiation request is sent. */ - INITIATION_STARTED, - - /** Set after the initiation request completes. */ - INITIATION_COMPLETE, - - /** Set after a media file chunk is uploaded. */ - MEDIA_IN_PROGRESS, - - /** Set after the complete media file is successfully uploaded. */ - MEDIA_COMPLETE - } - - /** The current state of the uploader. */ - private UploadState uploadState = UploadState.NOT_STARTED; - - static final int MB = 0x100000; - private static final int KB = 0x400; - - /** - * Minimum number of bytes that can be uploaded to the server (set to 256KB). - */ - public static final int MINIMUM_CHUNK_SIZE = 256 * KB; - - /** - * Default maximum number of bytes that will be uploaded to the server in any single HTTP request - * (set to 10 MB). - */ - public static final int DEFAULT_CHUNK_SIZE = 10 * MB; - - /** The HTTP content of the media to be uploaded. */ - private final AbstractInputStreamContent mediaContent; - - /** The request factory for connections to the server. */ - private final HttpRequestFactory requestFactory; - - /** The transport to use for requests. */ - private final HttpTransport transport; - - /** HTTP content metadata of the media to be uploaded or {@code null} for none. */ - private HttpContent metadata; - - /** - * The length of the HTTP media content. - * - *

- * {@code 0} before it is lazily initialized in {@link #getMediaContentLength()} after which it - * could still be {@code 0} for empty media content. Will be {@code < 0} if the media content - * length has not been specified. - *

- */ - private long mediaContentLength; - - /** - * Determines if media content length has been calculated yet in {@link #getMediaContentLength()}. - */ - private boolean isMediaContentLengthCalculated; - - /** - * The HTTP method used for the initiation request. - * - *

- * Can only be {@link HttpMethods#POST} (for media upload) or {@link HttpMethods#PUT} (for media - * update). The default value is {@link HttpMethods#POST}. - *

- */ - private String initiationRequestMethod = HttpMethods.POST; - - /** The HTTP headers used in the initiation request. */ - private HttpHeaders initiationHeaders = new HttpHeaders(); - - /** - * The HTTP request object that is currently used to send upload requests or {@code null} before - * {@link #upload}. - */ - private HttpRequest currentRequest; - - /** An Input stream of the HTTP media content or {@code null} before {@link #upload}. */ - private InputStream contentInputStream; - - /** - * Determines whether direct media upload is enabled or disabled. If value is set to {@code true} - * then a direct upload will be done where the whole media content is uploaded in a single request - * If value is set to {@code false} then the upload uses the resumable media upload protocol to - * upload in data chunks. Defaults to {@code false}. - */ - private boolean directUploadEnabled; - - /** - * Progress listener to send progress notifications to or {@code null} for none. - */ - private MediaHttpUploaderProgressListener progressListener; - - /** - * The media content length is used in the "Content-Range" header. If we reached the end of the - * stream, this variable will be set with the length of the stream. This value is used only in - * resumable media upload. - */ - String mediaContentLengthStr = "*"; - - /** - * The number of bytes the server received so far. This value will not be calculated for direct - * uploads when the content length is not known in advance. - */ - // TODO(rmistry): Figure out a way to compute the content length using CountingInputStream. - private long totalBytesServerReceived; - - /** - * Maximum size of individual chunks that will get uploaded by single HTTP requests. The default - * value is {@link #DEFAULT_CHUNK_SIZE}. - */ - private int chunkSize = DEFAULT_CHUNK_SIZE; - - /** - * Used to cache a single byte when the media content length is unknown or {@code null} for none. - */ - private Byte cachedByte; - - /** - * The number of bytes the client had sent to the server so far or {@code 0} for none. It is used - * for resumable media upload when the media content length is not specified. - */ - private long totalBytesClientSent; - - /** - * The number of bytes of the current chunk which was sent to the server or {@code 0} for none. - * This value equals to chunk size for each chunk the client send to the server, except for the - * ending chunk. - */ - private int currentChunkLength; - - /** - * The content buffer of the current request or {@code null} for none. It is used for resumable - * media upload when the media content length is not specified. It is instantiated for every - * request in {@link #setContentAndHeadersOnCurrentRequest} and is set to {@code null} when the - * request is completed in {@link #upload}. - */ - private byte currentRequestContentBuffer[]; - - /** - * Whether to disable GZip compression of HTTP content. - * - *

- * The default value is {@code false}. - *

- */ - private boolean disableGZipContent; - - /** Sleeper. **/ - Sleeper sleeper = Sleeper.DEFAULT; - - /** - * Construct the {@link MediaHttpUploader}. - * - *

- * The input stream received by calling {@link AbstractInputStreamContent#getInputStream} is - * closed when the upload process is successfully completed. For resumable uploads, when the media - * content length is known, if the input stream has {@link InputStream#markSupported} as - * {@code false} then it is wrapped in an {@link BufferedInputStream} to support the - * {@link InputStream#mark} and {@link InputStream#reset} methods required for handling server - * errors. If the media content length is unknown then each chunk is stored temporarily in memory. - * This is required to determine when the last chunk is reached. - *

- * - * @param mediaContent The Input stream content of the media to be uploaded - * @param transport The transport to use for requests - * @param httpRequestInitializer The initializer to use when creating an {@link HttpRequest} or - * {@code null} for none - */ - public MediaHttpUploader(AbstractInputStreamContent mediaContent, HttpTransport transport, - HttpRequestInitializer httpRequestInitializer) { - this.mediaContent = Preconditions.checkNotNull(mediaContent); - this.transport = Preconditions.checkNotNull(transport); - this.requestFactory = httpRequestInitializer == null - ? transport.createRequestFactory() : transport.createRequestFactory(httpRequestInitializer); - } - - /** - * Executes a direct media upload or resumable media upload conforming to the specifications - * listed here. - * - *

- * This method is not reentrant. A new instance of {@link MediaHttpUploader} must be instantiated - * before upload called be called again. - *

- * - *

- * If an error is encountered during the request execution the caller is responsible for parsing - * the response correctly. For example for JSON errors: - *

- * - *
-    if (!response.isSuccessStatusCode()) {
-      throw GoogleJsonResponseException.from(jsonFactory, response);
-    }
-   * 
- * - *

- * 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: - *

- * - *
-     HttpResponse response = batch.upload(initiationRequestUrl);
-     try {
-       // process the HTTP response object
-     } finally {
-       response.disconnect();
-     }
-   * 
- * - * @param initiationRequestUrl The request URL where the initiation request will be sent - * @return HTTP response - */ - public HttpResponse upload(GenericUrl initiationRequestUrl) throws IOException { - Preconditions.checkArgument(uploadState == UploadState.NOT_STARTED); - - if (directUploadEnabled) { - return directUpload(initiationRequestUrl); - } - return resumableUpload(initiationRequestUrl); - } - - /** - * Direct Uploads the media. - * - * @param initiationRequestUrl The request URL where the initiation request will be sent - * @return HTTP response - */ - private HttpResponse directUpload(GenericUrl initiationRequestUrl) throws IOException { - updateStateAndNotifyListener(UploadState.MEDIA_IN_PROGRESS); - - HttpContent content = mediaContent; - if (metadata != null) { - content = new MultipartContent().setContentParts(Arrays.asList(metadata, mediaContent)); - initiationRequestUrl.put("uploadType", "multipart"); - } else { - initiationRequestUrl.put("uploadType", "media"); - } - HttpRequest request = - requestFactory.buildRequest(initiationRequestMethod, initiationRequestUrl, content); - request.getHeaders().putAll(initiationHeaders); - // We do not have to do anything special here if media content length is unspecified because - // direct media upload works even when the media content length == -1. - HttpResponse response = executeCurrentRequest(request); - boolean responseProcessed = false; - try { - if (isMediaLengthKnown()) { - totalBytesServerReceived = getMediaContentLength(); - } - updateStateAndNotifyListener(UploadState.MEDIA_COMPLETE); - responseProcessed = true; - } finally { - if (!responseProcessed) { - response.disconnect(); - } - } - return response; - } - - /** - * Uploads the media in a resumable manner. - * - * @param initiationRequestUrl The request URL where the initiation request will be sent - * @return HTTP response - */ - private HttpResponse resumableUpload(GenericUrl initiationRequestUrl) throws IOException { - // Make initial request to get the unique upload URL. - HttpResponse initialResponse = executeUploadInitiation(initiationRequestUrl); - if (!initialResponse.isSuccessStatusCode()) { - // If the initiation request is not successful return it immediately. - return initialResponse; - } - GenericUrl uploadUrl; - try { - uploadUrl = new GenericUrl(initialResponse.getHeaders().getLocation()); - } finally { - initialResponse.disconnect(); - } - - // Convert media content into a byte stream to upload in chunks. - contentInputStream = mediaContent.getInputStream(); - if (!contentInputStream.markSupported() && isMediaLengthKnown()) { - // If we know the media content length then wrap the stream into a Buffered input stream to - // support the {@link InputStream#mark} and {@link InputStream#reset} methods required for - // handling server errors. - contentInputStream = new BufferedInputStream(contentInputStream); - } - - HttpResponse response; - // Upload the media content in chunks. - while (true) { - currentRequest = requestFactory.buildPutRequest(uploadUrl, null); - setContentAndHeadersOnCurrentRequest(); - // set mediaErrorHandler as I/O exception handler and as unsuccessful response handler for - // calling to serverErrorCallback on an I/O exception or an abnormal HTTP response - new MediaUploadErrorHandler(this, currentRequest); - - if (isMediaLengthKnown()) { - // TODO(rmistry): Support gzipping content for the case where media content length is - // known (https://code.google.com/p/google-api-java-client/issues/detail?id=691). - response = executeCurrentRequestWithoutGZip(currentRequest); - } else { - response = executeCurrentRequest(currentRequest); - } - boolean returningResponse = false; - try { - if (response.isSuccessStatusCode()) { - totalBytesServerReceived = getMediaContentLength(); - if (mediaContent.getCloseInputStream()) { - contentInputStream.close(); - } - updateStateAndNotifyListener(UploadState.MEDIA_COMPLETE); - returningResponse = true; - return response; - } - - if (response.getStatusCode() != 308) { - returningResponse = true; - return response; - } - - // Check to see if the upload URL has changed on the server. - String updatedUploadUrl = response.getHeaders().getLocation(); - if (updatedUploadUrl != null) { - uploadUrl = new GenericUrl(updatedUploadUrl); - } - - // we check the amount of bytes the server received so far, because the server may process - // fewer bytes than the amount of bytes the client had sent - long newBytesServerReceived = getNextByteIndex(response.getHeaders().getRange()); - // the server can receive any amount of bytes from 0 to current chunk length - long currentBytesServerReceived = newBytesServerReceived - totalBytesServerReceived; - Preconditions.checkState( - currentBytesServerReceived >= 0 && currentBytesServerReceived <= currentChunkLength); - long copyBytes = currentChunkLength - currentBytesServerReceived; - if (isMediaLengthKnown()) { - if (copyBytes > 0) { - // If the server didn't receive all the bytes the client sent the current position of - // the input stream is incorrect. So we should reset the stream and skip those bytes - // that the server had already received. - // Otherwise (the server got all bytes the client sent), the stream is in its right - // position, and we can continue from there - contentInputStream.reset(); - long actualSkipValue = contentInputStream.skip(currentBytesServerReceived); - Preconditions.checkState(currentBytesServerReceived == actualSkipValue); - } - } else if (copyBytes == 0) { - // server got all the bytes, so we don't need to use this buffer. Otherwise, we have to - // keep the buffer and copy part (or all) of its bytes to the stream we are sending to the - // server - currentRequestContentBuffer = null; - } - totalBytesServerReceived = newBytesServerReceived; - - updateStateAndNotifyListener(UploadState.MEDIA_IN_PROGRESS); - } finally { - if (!returningResponse) { - response.disconnect(); - } - } - } - } - - /** - * @return {@code true} if the media length is known, otherwise {@code false} - */ - private boolean isMediaLengthKnown() throws IOException { - return getMediaContentLength() >= 0; - } - - /** - * Uses lazy initialization to compute the media content length. - * - *

- * This is done to avoid throwing an {@link IOException} in the constructor. - *

- */ - private long getMediaContentLength() throws IOException { - if (!isMediaContentLengthCalculated) { - mediaContentLength = mediaContent.getLength(); - isMediaContentLengthCalculated = true; - } - return mediaContentLength; - } - - /** - * This method sends a POST request with empty content to get the unique upload URL. - * - * @param initiationRequestUrl The request URL where the initiation request will be sent - */ - private HttpResponse executeUploadInitiation(GenericUrl initiationRequestUrl) throws IOException { - updateStateAndNotifyListener(UploadState.INITIATION_STARTED); - - initiationRequestUrl.put("uploadType", "resumable"); - HttpContent content = metadata == null ? new EmptyContent() : metadata; - HttpRequest request = - requestFactory.buildRequest(initiationRequestMethod, initiationRequestUrl, content); - initiationHeaders.set(CONTENT_TYPE_HEADER, mediaContent.getType()); - if (isMediaLengthKnown()) { - initiationHeaders.set(CONTENT_LENGTH_HEADER, getMediaContentLength()); - } - request.getHeaders().putAll(initiationHeaders); - HttpResponse response = executeCurrentRequest(request); - boolean notificationCompleted = false; - - try { - updateStateAndNotifyListener(UploadState.INITIATION_COMPLETE); - notificationCompleted = true; - } finally { - if (!notificationCompleted) { - response.disconnect(); - } - } - return response; - } - - /** - * Executes the current request with some minimal common code. - * - * @param request current request - * @return HTTP response - */ - private HttpResponse executeCurrentRequestWithoutGZip(HttpRequest request) throws IOException { - // method override for non-POST verbs - new MethodOverride().intercept(request); - // don't throw an exception so we can let a custom Google exception be thrown - request.setThrowExceptionOnExecuteError(false); - // execute the request - HttpResponse response = request.execute(); - return response; - } - - /** - * Executes the current request with some common code that includes exponential backoff and GZip - * encoding. - * - * @param request current request - * @return HTTP response - */ - private HttpResponse executeCurrentRequest(HttpRequest request) throws IOException { - // enable GZip encoding if necessary - if (!disableGZipContent && !(request.getContent() instanceof EmptyContent)) { - request.setEncoding(new GZipEncoding()); - } - // execute request - HttpResponse response = executeCurrentRequestWithoutGZip(request); - return response; - } - - /** - * Sets the HTTP media content chunk and the required headers that should be used in the upload - * request. - */ - private void setContentAndHeadersOnCurrentRequest() throws IOException { - int blockSize; - if (isMediaLengthKnown()) { - // We know exactly what the blockSize will be because we know the media content length. - blockSize = (int) Math.min(chunkSize, getMediaContentLength() - totalBytesServerReceived); - } else { - // Use the chunkSize as the blockSize because we do know what what it is yet. - blockSize = chunkSize; - } - - AbstractInputStreamContent contentChunk; - int actualBlockSize = blockSize; - if (isMediaLengthKnown()) { - // Mark the current position in case we need to retry the request. - contentInputStream.mark(blockSize); - - InputStream limitInputStream = ByteStreams.limit(contentInputStream, blockSize); - contentChunk = new InputStreamContent( - mediaContent.getType(), limitInputStream).setRetrySupported(true) - .setLength(blockSize).setCloseInputStream(false); - mediaContentLengthStr = String.valueOf(getMediaContentLength()); - } else { - // If the media content length is not known we implement a custom buffered input stream that - // enables us to detect the length of the media content when the last chunk is sent. We - // accomplish this by always trying to read an extra byte further than the end of the current - // chunk. - int actualBytesRead; - int bytesAllowedToRead; - - // amount of bytes which need to be copied from last chunk buffer - int copyBytes = 0; - if (currentRequestContentBuffer == null) { - bytesAllowedToRead = cachedByte == null ? blockSize + 1 : blockSize; - currentRequestContentBuffer = new byte[blockSize + 1]; - if (cachedByte != null) { - currentRequestContentBuffer[0] = cachedByte; - } - } else { - // currentRequestContentBuffer is not null that means one of the following: - // 1. This is a request to recover from a server error (e.g. 503) - // or - // 2. The server received less bytes than the amount of bytes the client had sent. For - // example, the client sends bytes 100-199, but the server returns back status code 308, - // and its "Range" header is "bytes=0-150". - // In that case, the new request will be constructed from the previous request's byte buffer - // plus new bytes from the stream. - copyBytes = (int) (totalBytesClientSent - totalBytesServerReceived); - // shift copyBytes bytes to the beginning - those are the bytes which weren't received by - // the server in the last chunk. - System.arraycopy(currentRequestContentBuffer, currentChunkLength - copyBytes, - currentRequestContentBuffer, 0, copyBytes); - if (cachedByte != null) { - // add the last cached byte to the buffer - currentRequestContentBuffer[copyBytes] = cachedByte; - } - - bytesAllowedToRead = blockSize - copyBytes; - } - - actualBytesRead = ByteStreams.read( - contentInputStream, currentRequestContentBuffer, blockSize + 1 - bytesAllowedToRead, - bytesAllowedToRead); - - if (actualBytesRead < bytesAllowedToRead) { - actualBlockSize = copyBytes + Math.max(0, actualBytesRead); - if (cachedByte != null) { - actualBlockSize++; - cachedByte = null; - } - - if (mediaContentLengthStr.equals("*")) { - // At this point we know we reached the media content length because we either read less - // than the specified chunk size or there is no more data left to be read. - mediaContentLengthStr = String.valueOf(totalBytesServerReceived + actualBlockSize); - } - } else { - cachedByte = currentRequestContentBuffer[blockSize]; - } - - contentChunk = new ByteArrayContent( - mediaContent.getType(), currentRequestContentBuffer, 0, actualBlockSize); - totalBytesClientSent = totalBytesServerReceived + actualBlockSize; - } - - currentChunkLength = actualBlockSize; - currentRequest.setContent(contentChunk); - if (actualBlockSize == 0) { - // special case of zero content media being uploaded - currentRequest.getHeaders().setContentRange("bytes */0"); - } else { - currentRequest.getHeaders().setContentRange("bytes " + totalBytesServerReceived + "-" - + (totalBytesServerReceived + actualBlockSize - 1) + "/" + mediaContentLengthStr); - } - } - - /** - * {@link Beta}
- * The call back method that will be invoked on a server error or an I/O exception during - * resumable upload inside {@link #upload}. - * - *

- * This method changes the current request to query the current status of the upload to find how - * many bytes were successfully uploaded before the server error occurred. - *

- */ - @Beta - void serverErrorCallback() throws IOException { - Preconditions.checkNotNull(currentRequest, "The current request should not be null"); - - // Query the current status of the upload by issuing an empty PUT request on the upload URI. - currentRequest.setContent(new EmptyContent()); - currentRequest.getHeaders() - .setContentRange("bytes */" + (isMediaLengthKnown() ? getMediaContentLength() : "*")); - } - - /** - * Returns the next byte index identifying data that the server has not yet received, obtained - * from the HTTP Range header (E.g a header of "Range: 0-55" would cause 56 to be returned). - * null or malformed headers cause 0 to be returned. - * - * @param rangeHeader in the HTTP response - * @return the byte index beginning where the server has yet to receive data - */ - private long getNextByteIndex(String rangeHeader) { - if (rangeHeader == null) { - return 0L; - } - return Long.parseLong(rangeHeader.substring(rangeHeader.indexOf('-') + 1)) + 1; - } - - /** Returns HTTP content metadata for the media request or {@code null} for none. */ - public HttpContent getMetadata() { - return metadata; - } - - /** Sets HTTP content metadata for the media request or {@code null} for none. */ - public MediaHttpUploader setMetadata(HttpContent metadata) { - this.metadata = metadata; - return this; - } - - /** Returns the HTTP content of the media to be uploaded. */ - public HttpContent getMediaContent() { - return mediaContent; - } - - /** Returns the transport to use for requests. */ - public HttpTransport getTransport() { - return transport; - } - - /** - * Sets whether direct media upload is enabled or disabled. - * - *

- * If value is set to {@code true} then a direct upload will be done where the whole media content - * is uploaded in a single request. If value is set to {@code false} then the upload uses the - * resumable media upload protocol to upload in data chunks. - *

- * - *

- * Direct upload is recommended if the content size falls below a certain minimum limit. This is - * because there's minimum block write size for some Google APIs, so if the resumable request - * fails in the space of that first block, the client will have to restart from the beginning - * anyway. - *

- * - *

- * Defaults to {@code false}. - *

- * - * @since 1.9 - */ - public MediaHttpUploader setDirectUploadEnabled(boolean directUploadEnabled) { - this.directUploadEnabled = directUploadEnabled; - return this; - } - - /** - * Returns whether direct media upload is enabled or disabled. If value is set to {@code true} - * then a direct upload will be done where the whole media content is uploaded in a single - * request. If value is set to {@code false} then the upload uses the resumable media upload - * protocol to upload in data chunks. Defaults to {@code false}. - * - * @since 1.9 - */ - public boolean isDirectUploadEnabled() { - return directUploadEnabled; - } - - /** - * Sets the progress listener to send progress notifications to or {@code null} for none. - */ - public MediaHttpUploader setProgressListener(MediaHttpUploaderProgressListener progressListener) { - this.progressListener = progressListener; - return this; - } - - /** - * Returns the progress listener to send progress notifications to or {@code null} for none. - */ - public MediaHttpUploaderProgressListener getProgressListener() { - return progressListener; - } - - /** - * Sets the maximum size of individual chunks that will get uploaded by single HTTP requests. The - * default value is {@link #DEFAULT_CHUNK_SIZE}. - * - *

- * The minimum allowable value is {@link #MINIMUM_CHUNK_SIZE} and the specified chunk size must be - * a multiple of {@link #MINIMUM_CHUNK_SIZE}. - *

- */ - public MediaHttpUploader setChunkSize(int chunkSize) { - Preconditions.checkArgument(chunkSize > 0 && chunkSize % MINIMUM_CHUNK_SIZE == 0, "chunkSize" - + " must be a positive multiple of " + MINIMUM_CHUNK_SIZE + "."); - this.chunkSize = chunkSize; - return this; - } - - /** - * Returns the maximum size of individual chunks that will get uploaded by single HTTP requests. - * The default value is {@link #DEFAULT_CHUNK_SIZE}. - */ - public int getChunkSize() { - return chunkSize; - } - - /** - * Returns whether to disable GZip compression of HTTP content. - * - * @since 1.13 - */ - public boolean getDisableGZipContent() { - return disableGZipContent; - } - - /** - * Sets whether to disable GZip compression of HTTP content. - * - *

- * By default it is {@code false}. - *

- * - *

- * If {@link #setDisableGZipContent(boolean)} is set to false (the default value) then content is - * gzipped for direct media upload and resumable media uploads when content length is not known. - * Due to a current limitation, content is not gzipped for resumable media uploads when content - * length is known; this limitation will be removed in the future. - *

- * - * @since 1.13 - */ - public MediaHttpUploader setDisableGZipContent(boolean disableGZipContent) { - this.disableGZipContent = disableGZipContent; - return this; - } - - /** - * Returns the sleeper. - * - * @since 1.15 - */ - public Sleeper getSleeper() { - return sleeper; - } - - /** - * Sets the sleeper. The default value is {@link Sleeper#DEFAULT}. - * - * @since 1.15 - */ - public MediaHttpUploader setSleeper(Sleeper sleeper) { - this.sleeper = sleeper; - return this; - } - - /** - * Returns the HTTP method used for the initiation request. - * - *

- * The default value is {@link HttpMethods#POST}. - *

- * - * @since 1.12 - */ - public String getInitiationRequestMethod() { - return initiationRequestMethod; - } - - /** - * Sets the HTTP method used for the initiation request. - * - *

- * Can only be {@link HttpMethods#POST} (for media upload) or {@link HttpMethods#PUT} (for media - * update). The default value is {@link HttpMethods#POST}. - *

- * - * @since 1.12 - */ - public MediaHttpUploader setInitiationRequestMethod(String initiationRequestMethod) { - Preconditions.checkArgument(initiationRequestMethod.equals(HttpMethods.POST) - || initiationRequestMethod.equals(HttpMethods.PUT)); - this.initiationRequestMethod = initiationRequestMethod; - return this; - } - - /** Sets the HTTP headers used for the initiation request. */ - public MediaHttpUploader setInitiationHeaders(HttpHeaders initiationHeaders) { - this.initiationHeaders = initiationHeaders; - return this; - } - - /** Returns the HTTP headers used for the initiation request. */ - public HttpHeaders getInitiationHeaders() { - return initiationHeaders; - } - - /** - * Gets the total number of bytes the server received so far or {@code 0} for direct uploads when - * the content length is not known. - * - * @return the number of bytes the server received so far - */ - public long getNumBytesUploaded() { - return totalBytesServerReceived; - } - - /** - * Sets the upload state and notifies the progress listener. - * - * @param uploadState value to set to - */ - private void updateStateAndNotifyListener(UploadState uploadState) throws IOException { - this.uploadState = uploadState; - if (progressListener != null) { - progressListener.progressChanged(this); - } - } - - /** - * Gets the current upload state of the uploader. - * - * @return the upload state - */ - public UploadState getUploadState() { - return uploadState; - } - - /** - * Gets the upload progress denoting the percentage of bytes that have been uploaded, represented - * between 0.0 (0%) and 1.0 (100%). - * - *

- * Do not use if the specified {@link AbstractInputStreamContent} has no content length specified. - * Instead, consider using {@link #getNumBytesUploaded} to denote progress. - *

- * - * @throws IllegalArgumentException if the specified {@link AbstractInputStreamContent} has no - * content length - * @return the upload progress - */ - public double getProgress() throws IOException { - Preconditions.checkArgument(isMediaLengthKnown(), "Cannot call getProgress() if " - + "the specified AbstractInputStreamContent has no content length. Use " - + " getNumBytesUploaded() to denote progress instead."); - return getMediaContentLength() == 0 ? 0 : (double) totalBytesServerReceived - / getMediaContentLength(); - } -} 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 deleted file mode 100644 index 7f6c5f6d..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpUploaderProgressListener.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.media; - -import java.io.IOException; - - -/** - * An interface for receiving progress notifications for uploads. - * - *

- * Sample usage (if media content length is provided, else consider using - * {@link MediaHttpUploader#getNumBytesUploaded} instead of {@link MediaHttpUploader#getProgress}: - *

- * - *
-  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;
-      }
-    }
-  }
- * 
- * - * @since 1.9 - * @author rmistry@google.com (Ravi Mistry) - */ -public interface MediaHttpUploaderProgressListener { - - /** - * Called to notify that progress has been changed. - * - *

- * This method is called once before and after the initiation request. For media uploads it is - * called multiple times depending on how many chunks are uploaded. Once the upload completes it - * is called one final time. - *

- * - *

- * The upload state can be queried by calling {@link MediaHttpUploader#getUploadState} and the - * progress by calling {@link MediaHttpUploader#getProgress}. - *

- * - * @param uploader Media HTTP uploader - */ - public void progressChanged(MediaHttpUploader uploader) throws IOException; -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaUploadErrorHandler.java b/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaUploadErrorHandler.java deleted file mode 100644 index 3e0a6503..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaUploadErrorHandler.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.media; - -import com.google.api.client.http.HttpIOExceptionHandler; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpUnsuccessfulResponseHandler; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Preconditions; - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * MediaUpload error handler handles an {@link IOException} and an abnormal HTTP response by calling - * to {@link MediaHttpUploader#serverErrorCallback()}. - * - * @author Eyal Peled - */ -@Beta -class MediaUploadErrorHandler implements HttpUnsuccessfulResponseHandler, HttpIOExceptionHandler { - - static final Logger LOGGER = Logger.getLogger(MediaUploadErrorHandler.class.getName()); - - /** The uploader to callback on if there is a server error. */ - private final MediaHttpUploader uploader; - - /** The original {@link HttpIOExceptionHandler} of the HTTP request. */ - private final HttpIOExceptionHandler originalIOExceptionHandler; - - /** The original {@link HttpUnsuccessfulResponseHandler} of the HTTP request. */ - private final HttpUnsuccessfulResponseHandler originalUnsuccessfulHandler; - - /** - * Constructs a new instance from {@link MediaHttpUploader} and {@link HttpRequest}. - */ - public MediaUploadErrorHandler(MediaHttpUploader uploader, HttpRequest request) { - this.uploader = Preconditions.checkNotNull(uploader); - originalIOExceptionHandler = request.getIOExceptionHandler(); - originalUnsuccessfulHandler = request.getUnsuccessfulResponseHandler(); - - request.setIOExceptionHandler(this); - request.setUnsuccessfulResponseHandler(this); - } - - public boolean handleIOException(HttpRequest request, boolean supportsRetry) throws IOException { - boolean handled = originalIOExceptionHandler != null - && originalIOExceptionHandler.handleIOException(request, supportsRetry); - - // TODO(peleyal): figure out what is best practice - call serverErrorCallback only if I/O - // exception was handled, or call it regardless - if (handled) { - try { - uploader.serverErrorCallback(); - } catch (IOException e) { - LOGGER.log(Level.WARNING, "exception thrown while calling server callback", e); - } - } - return handled; - } - - public boolean handleResponse(HttpRequest request, HttpResponse response, boolean supportsRetry) - throws IOException { - boolean handled = originalUnsuccessfulHandler != null - && originalUnsuccessfulHandler.handleResponse(request, response, supportsRetry); - - // TODO(peleyal): figure out what is best practice - call serverErrorCallback only if the - // abnormal response was handled, or call it regardless - if (handled && supportsRetry && response.getStatusCode() / 100 == 5) { - try { - uploader.serverErrorCallback(); - } catch (IOException e) { - LOGGER.log(Level.WARNING, "exception thrown while calling server callback", e); - } - } - return handled; - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/media/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/media/package-info.java deleted file mode 100644 index 98dd9023..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/media/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Media for Google API's. - * - * @since 1.9 - * @author Ravi Mistry - */ - -package com.google.api.client.googleapis.media; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/AbstractNotification.java b/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/AbstractNotification.java deleted file mode 100644 index f53e77cf..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/AbstractNotification.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.notifications; - -import com.google.api.client.util.Beta; -import com.google.api.client.util.Objects; -import com.google.api.client.util.Preconditions; - -/** - * {@link Beta}
- * Notification metadata sent to this client about a watched resource. - * - *

- * Implementation is not thread-safe. - *

- * - * @author Yaniv Inbar - * @author Matthias Linder (mlinder) - * @since 1.16 - */ -@Beta -public abstract class AbstractNotification { - - /** Message number (a monotonically increasing value starting with 1). */ - private long messageNumber; - - /** {@link ResourceStates Resource state}. */ - private String resourceState; - - /** Opaque ID for the watched resource that is stable across API versions. */ - private String resourceId; - - /** - * Opaque ID (in the form of a canonicalized URI) for the watched resource that is sensitive to - * the API version. - */ - private String resourceUri; - - /** Notification channel UUID provided by the client in the watch request. */ - private String channelId; - - /** Notification channel expiration time or {@code null} for none. */ - private String channelExpiration; - - /** - * Notification channel token (an opaque string) provided by the client in the watch request or - * {@code null} for none. - */ - private String channelToken; - - /** Type of change performed on the resource or {@code null} for none. */ - private String changed; - - /** - * @param messageNumber message number (a monotonically increasing value starting with 1) - * @param resourceState {@link ResourceStates resource state} - * @param resourceId opaque ID for the watched resource that is stable across API versions - * @param resourceUri opaque ID (in the form of a canonicalized URI) for the watched resource that - * is sensitive to the API version - * @param channelId notification channel UUID provided by the client in the watch request - */ - protected AbstractNotification(long messageNumber, String resourceState, String resourceId, - String resourceUri, String channelId) { - setMessageNumber(messageNumber); - setResourceState(resourceState); - setResourceId(resourceId); - setResourceUri(resourceUri); - setChannelId(channelId); - } - - /** Copy constructor based on a source notification object. */ - protected AbstractNotification(AbstractNotification source) { - this(source.getMessageNumber(), source.getResourceState(), source.getResourceId(), source - .getResourceUri(), source.getChannelId()); - setChannelExpiration(source.getChannelExpiration()); - setChannelToken(source.getChannelToken()); - setChanged(source.getChanged()); - } - - @Override - public String toString() { - return toStringHelper().toString(); - } - - /** Returns the helper for {@link #toString()}. */ - protected Objects.ToStringHelper toStringHelper() { - return Objects.toStringHelper(this).add("messageNumber", messageNumber) - .add("resourceState", resourceState).add("resourceId", resourceId) - .add("resourceUri", resourceUri).add("channelId", channelId) - .add("channelExpiration", channelExpiration).add("channelToken", channelToken) - .add("changed", changed); - } - - /** Returns the message number (a monotonically increasing value starting with 1). */ - public final long getMessageNumber() { - return messageNumber; - } - - /** - * Sets the message number (a monotonically increasing value starting with 1). - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public AbstractNotification setMessageNumber(long messageNumber) { - Preconditions.checkArgument(messageNumber >= 1); - this.messageNumber = messageNumber; - return this; - } - - /** Returns the {@link ResourceStates resource state}. */ - public final String getResourceState() { - return resourceState; - } - - /** - * Sets the {@link ResourceStates resource state}. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public AbstractNotification setResourceState(String resourceState) { - this.resourceState = Preconditions.checkNotNull(resourceState); - return this; - } - - /** Returns the opaque ID for the watched resource that is stable across API versions. */ - public final String getResourceId() { - return resourceId; - } - - /** - * Sets the opaque ID for the watched resource that is stable across API versions. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public AbstractNotification setResourceId(String resourceId) { - this.resourceId = Preconditions.checkNotNull(resourceId); - return this; - } - - /** - * Returns the opaque ID (in the form of a canonicalized URI) for the watched resource that is - * sensitive to the API version. - */ - public final String getResourceUri() { - return resourceUri; - } - - /** - * Sets the opaque ID (in the form of a canonicalized URI) for the watched resource that is - * sensitive to the API version. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public AbstractNotification setResourceUri(String resourceUri) { - this.resourceUri = Preconditions.checkNotNull(resourceUri); - return this; - } - - /** Returns the notification channel UUID provided by the client in the watch request. */ - public final String getChannelId() { - return channelId; - } - - /** - * Sets the notification channel UUID provided by the client in the watch request. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public AbstractNotification setChannelId(String channelId) { - this.channelId = Preconditions.checkNotNull(channelId); - return this; - } - - /** Returns the notification channel expiration time or {@code null} for none. */ - public final String getChannelExpiration() { - return channelExpiration; - } - - /** - * Sets the notification channel expiration time or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public AbstractNotification setChannelExpiration(String channelExpiration) { - this.channelExpiration = channelExpiration; - return this; - } - - /** - * Returns the notification channel token (an opaque string) provided by the client in the watch - * request or {@code null} for none. - */ - public final String getChannelToken() { - return channelToken; - } - - /** - * Sets the notification channel token (an opaque string) provided by the client in the watch - * request or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public AbstractNotification setChannelToken(String channelToken) { - this.channelToken = channelToken; - return this; - } - - /** - * Returns the type of change performed on the resource or {@code null} for none. - */ - public final String getChanged() { - return changed; - } - - /** - * Sets the type of change performed on the resource or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public AbstractNotification setChanged(String changed) { - this.changed = changed; - return this; - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/NotificationUtils.java b/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/NotificationUtils.java deleted file mode 100644 index c39cbab2..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/NotificationUtils.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.notifications; - -import java.util.UUID; - -/** - * Utilities for notifications and notification channels. - * - * @author Yaniv Inbar - * @since 1.16 - */ -public final class NotificationUtils { - - /** Returns a new random UUID string to be used as a notification channel ID. */ - public static String randomUuidString() { - return UUID.randomUUID().toString(); - } - - private NotificationUtils() { - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/ResourceStates.java b/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/ResourceStates.java deleted file mode 100644 index 5de4b204..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/ResourceStates.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.notifications; - -import com.google.api.client.util.Beta; - -/** - * {@link Beta}
- * Standard resource states used by notifications. - * - * @author Yaniv Inbar - * @since 1.16 - */ -@Beta -public final class ResourceStates { - - /** Notification that the subscription is alive (comes with no payload). */ - public static final String SYNC = "SYNC"; - - /** Resource exists, for example on a create or update. */ - public static final String EXISTS = "EXISTS"; - - /** Resource does not exist, for example on a delete. */ - public static final String NOT_EXISTS = "NOT_EXISTS"; - - private ResourceStates() { - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/StoredChannel.java b/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/StoredChannel.java deleted file mode 100644 index 36a52cc4..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/StoredChannel.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.notifications; - -import com.google.api.client.util.Beta; -import com.google.api.client.util.Objects; -import com.google.api.client.util.Preconditions; -import com.google.api.client.util.store.DataStore; -import com.google.api.client.util.store.DataStoreFactory; - -import java.io.IOException; -import java.io.Serializable; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; - -/** - * {@link Beta}
- * Notification channel information to be stored in a data store. - * - *

- * Implementation is thread safe. - *

- * - * @author Yaniv Inbar - * @author Matthias Linder (mlinder) - * @since 1.16 - */ -@Beta -public final class StoredChannel implements Serializable { - - /** Default data store ID. */ - public static final String DEFAULT_DATA_STORE_ID = StoredChannel.class.getSimpleName(); - - private static final long serialVersionUID = 1L; - - /** Lock on access to the store. */ - private final Lock lock = new ReentrantLock(); - - /** Notification callback called when a notification is received for this subscription. */ - private final UnparsedNotificationCallback notificationCallback; - - /** - * Arbitrary string provided by the client associated with this subscription that is delivered to - * the target address with each notification or {@code null} for none. - */ - private String clientToken; - - /** - * Milliseconds in Unix time at which the subscription will expire or {@code null} for an infinite - * TTL. - */ - private Long expiration; - - /** Subscription UUID. */ - private final String id; - - /** - * Opaque ID for the subscribed resource that is stable across API versions or {@code null} for - * none. - */ - private String topicId; - - /** - * Constructor with a random UUID using {@link NotificationUtils#randomUuidString()}. - * - * @param notificationCallback notification handler called when a notification is received for - * this subscription - */ - public StoredChannel(UnparsedNotificationCallback notificationCallback) { - this(notificationCallback, NotificationUtils.randomUuidString()); - } - - /** - * Constructor with a custom UUID. - * - * @param notificationCallback notification handler called when a notification is received for - * this subscription - * @param id subscription UUID - */ - public StoredChannel(UnparsedNotificationCallback notificationCallback, String id) { - this.notificationCallback = Preconditions.checkNotNull(notificationCallback); - this.id = Preconditions.checkNotNull(id); - } - - /** - * Stores this notification channel in the notification channel data store, which is derived from - * {@link #getDefaultDataStore(DataStoreFactory)} on the given data store factory. - * - *

- * It is important that this method be called before the watch HTTP request is made in case the - * notification is received before the watch HTTP response is received. - *

- * - * @param dataStoreFactory data store factory - */ - public StoredChannel store(DataStoreFactory dataStoreFactory) throws IOException { - return store(getDefaultDataStore(dataStoreFactory)); - } - - /** - * Stores this notification channel in the given notification channel data store. - * - *

- * It is important that this method be called before the watch HTTP request is made in case the - * notification is received before the watch HTTP response is received. - *

- * - * @param dataStore notification channel data store - */ - public StoredChannel store(DataStore dataStore) throws IOException { - lock.lock(); - try { - dataStore.set(getId(), this); - return this; - } finally { - lock.unlock(); - } - } - - /** - * Returns the notification callback called when a notification is received for this subscription. - */ - public UnparsedNotificationCallback getNotificationCallback() { - lock.lock(); - try { - return notificationCallback; - } finally { - lock.unlock(); - } - } - - /** - * Returns the arbitrary string provided by the client associated with this subscription that is - * delivered to the target address with each notification or {@code null} for none. - */ - public String getClientToken() { - lock.lock(); - try { - return clientToken; - } finally { - lock.unlock(); - } - } - - /** - * Sets the the arbitrary string provided by the client associated with this subscription that is - * delivered to the target address with each notification or {@code null} for none. - */ - public StoredChannel setClientToken(String clientToken) { - lock.lock(); - try { - this.clientToken = clientToken; - } finally { - lock.unlock(); - } - return this; - } - - /** - * Returns the milliseconds in Unix time at which the subscription will expire or {@code null} for - * an infinite TTL. - */ - public Long getExpiration() { - lock.lock(); - try { - return expiration; - } finally { - lock.unlock(); - } - } - - /** - * Sets the milliseconds in Unix time at which the subscription will expire or {@code null} for an - * infinite TTL. - */ - public StoredChannel setExpiration(Long expiration) { - lock.lock(); - try { - this.expiration = expiration; - } finally { - lock.unlock(); - } - return this; - } - - /** Returns the subscription UUID. */ - public String getId() { - lock.lock(); - try { - return id; - } finally { - lock.unlock(); - } - } - - /** - * Returns the opaque ID for the subscribed resource that is stable across API versions or - * {@code null} for none. - */ - public String getTopicId() { - lock.lock(); - try { - return topicId; - } finally { - lock.unlock(); - } - } - - /** - * Sets the opaque ID for the subscribed resource that is stable across API versions or - * {@code null} for none. - */ - public StoredChannel setTopicId(String topicId) { - lock.lock(); - try { - this.topicId = topicId; - } finally { - lock.unlock(); - } - return this; - } - - @Override - public String toString() { - return Objects.toStringHelper(StoredChannel.class) - .add("notificationCallback", getNotificationCallback()).add("clientToken", getClientToken()) - .add("expiration", getExpiration()).add("id", getId()).add("topicId", getTopicId()) - .toString(); - } - - @Override - public boolean equals(Object other) { - if (this == other) { - return true; - } - if (!(other instanceof StoredChannel)) { - return false; - } - StoredChannel o = (StoredChannel) other; - return getId().equals(o.getId()); - } - - @Override - public int hashCode() { - return getId().hashCode(); - } - - /** - * Returns the stored channel data store using the ID {@link #DEFAULT_DATA_STORE_ID}. - * - * @param dataStoreFactory data store factory - * @return stored channel data store - */ - public static DataStore getDefaultDataStore(DataStoreFactory dataStoreFactory) - throws IOException { - return dataStoreFactory.getDataStore(DEFAULT_DATA_STORE_ID); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/TypedNotification.java b/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/TypedNotification.java deleted file mode 100644 index e3da8d0b..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/TypedNotification.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.notifications; - -import com.google.api.client.util.Beta; - -/** - * {@link Beta}
- * Notification metadata and parsed content sent to this client about a watched resource. - * - *

- * Implementation is not thread-safe. - *

- * - * @param Java type of the notification content - * - * @author Yaniv Inbar - * @author Matthias Linder (mlinder) - * @since 1.16 - */ -@Beta -public class TypedNotification extends AbstractNotification { - - /** Parsed notification content or {@code null} for none. */ - private T content; - - /** - * @param messageNumber message number (a monotonically increasing value starting with 1) - * @param resourceState {@link ResourceStates resource state} - * @param resourceId opaque ID for the watched resource that is stable across API versions - * @param resourceUri opaque ID (in the form of a canonicalized URI) for the watched resource that - * is sensitive to the API version - * @param channelId notification channel UUID provided by the client in the watch request - */ - public TypedNotification(long messageNumber, String resourceState, String resourceId, - String resourceUri, String channelId) { - super(messageNumber, resourceState, resourceId, resourceUri, channelId); - } - - /** - * @param sourceNotification source notification metadata to copy - */ - public TypedNotification(UnparsedNotification sourceNotification) { - super(sourceNotification); - } - - /** - * Returns the parsed notification content or {@code null} for none. - */ - public final T getContent() { - return content; - } - - /** - * Sets the parsed notification content or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public TypedNotification setContent(T content) { - this.content = content; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public TypedNotification setMessageNumber(long messageNumber) { - return (TypedNotification) super.setMessageNumber(messageNumber); - } - - @Override - @SuppressWarnings("unchecked") - public TypedNotification setResourceState(String resourceState) { - return (TypedNotification) super.setResourceState(resourceState); - } - - @Override - @SuppressWarnings("unchecked") - public TypedNotification setResourceId(String resourceId) { - return (TypedNotification) super.setResourceId(resourceId); - } - - @Override - @SuppressWarnings("unchecked") - public TypedNotification setResourceUri(String resourceUri) { - return (TypedNotification) super.setResourceUri(resourceUri); - } - - @Override - @SuppressWarnings("unchecked") - public TypedNotification setChannelId(String channelId) { - return (TypedNotification) super.setChannelId(channelId); - } - - @Override - @SuppressWarnings("unchecked") - public TypedNotification setChannelExpiration(String channelExpiration) { - return (TypedNotification) super.setChannelExpiration(channelExpiration); - } - - @Override - @SuppressWarnings("unchecked") - public TypedNotification setChannelToken(String channelToken) { - return (TypedNotification) super.setChannelToken(channelToken); - } - - @Override - @SuppressWarnings("unchecked") - public TypedNotification setChanged(String changed) { - return (TypedNotification) super.setChanged(changed); - } - - @Override - public String toString() { - return super.toStringHelper().add("content", content).toString(); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/TypedNotificationCallback.java b/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/TypedNotificationCallback.java deleted file mode 100644 index 4c912d1b..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/TypedNotificationCallback.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.notifications; - -import com.google.api.client.http.HttpMediaType; -import com.google.api.client.util.Beta; -import com.google.api.client.util.ObjectParser; -import com.google.api.client.util.Preconditions; - -import java.io.IOException; -import java.nio.charset.Charset; - -/** - * {@link Beta}
- * Callback to receive notifications for watched resource in which the . Callback which is used to - * receive typed {@link AbstractNotification}s after subscribing to a topic. - * - *

- * Must NOT be implemented in form of an anonymous class as this will break serialization. - *

- * - *

- * Implementation should be thread-safe. - *

- * - * Example usage: - * - *
-  static class MyNotificationCallback
-      extends JsonNotificationCallback{@literal <}ListResponse{@literal >} {
-
-    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 ObjectParser getObjectParser(Notification notification) throws IOException {
-      return new JsonObjectParser(new JacksonFactory());
-    }
-
-    {@literal @}Override
-    protected Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
-      return ListResponse.class;
-    }
-  }
- * 
- * - * @param Java type of the notification content - * @author Yaniv Inbar - * @author Matthias Linder (mlinder) - * @since 1.16 - */ -@Beta -public abstract class TypedNotificationCallback implements UnparsedNotificationCallback { - - private static final long serialVersionUID = 1L; - - /** - * Handles a received typed notification. - * - * @param storedChannel stored notification channel - * @param notification typed notification - */ - protected abstract void onNotification( - StoredChannel storedChannel, TypedNotification notification) throws IOException; - - /** Returns an {@link ObjectParser} which can be used to parse this notification. */ - protected abstract ObjectParser getObjectParser() throws IOException; - - /** - * Returns the data class to parse the notification content into or {@code Void.class} if no - * notification content is expected. - */ - protected abstract Class getDataClass() throws IOException; - - public final void onNotification(StoredChannel storedChannel, UnparsedNotification notification) - throws IOException { - TypedNotification typedNotification = new TypedNotification(notification); - // TODO(yanivi): how to properly detect if there is no content? - String contentType = notification.getContentType(); - if (contentType != null) { - Charset charset = new HttpMediaType(contentType).getCharsetParameter(); - Class dataClass = Preconditions.checkNotNull(getDataClass()); - typedNotification.setContent( - getObjectParser().parseAndClose(notification.getContentStream(), charset, dataClass)); - } - onNotification(storedChannel, typedNotification); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/UnparsedNotification.java b/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/UnparsedNotification.java deleted file mode 100644 index e9b65951..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/UnparsedNotification.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.notifications; - -import com.google.api.client.util.Beta; - -import java.io.InputStream; - -/** - * {@link Beta}
- * Notification metadata and unparsed content stream sent to this client about a watched resource. - * - *

- * Implementation is not thread-safe. - *

- * - * @author Yaniv Inbar - * @author Matthias Linder (mlinder) - * @since 1.16 - */ -@Beta -public class UnparsedNotification extends AbstractNotification { - - /** Notification content media type for the content stream or {@code null} for none or unknown. */ - private String contentType; - - /** Notification content input stream or {@code null} for none. */ - private InputStream contentStream; - - /** - * @param messageNumber message number (a monotonically increasing value starting with 1) - * @param resourceState {@link ResourceStates resource state} - * @param resourceId opaque ID for the watched resource that is stable across API versions - * @param resourceUri opaque ID (in the form of a canonicalized URI) for the watched resource that - * is sensitive to the API version - * @param channelId notification channel UUID provided by the client in the watch request - */ - public UnparsedNotification(long messageNumber, String resourceState, String resourceId, - String resourceUri, String channelId) { - super(messageNumber, resourceState, resourceId, resourceUri, channelId); - } - - /** - * Returns the notification content media type for the content stream or {@code null} for none or - * unknown. - */ - public final String getContentType() { - return contentType; - } - - /** - * Sets the notification content media type for the content stream or {@code null} for none or - * unknown. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public UnparsedNotification setContentType(String contentType) { - this.contentType = contentType; - return this; - } - - /** - * Returns the notification content input stream or {@code null} for none. - */ - public final InputStream getContentStream() { - return contentStream; - } - - /** - * Sets the notification content content input stream or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public UnparsedNotification setContentStream(InputStream contentStream) { - this.contentStream = contentStream; - return this; - } - - @Override - public UnparsedNotification setMessageNumber(long messageNumber) { - return (UnparsedNotification) super.setMessageNumber(messageNumber); - } - - @Override - public UnparsedNotification setResourceState(String resourceState) { - return (UnparsedNotification) super.setResourceState(resourceState); - } - - @Override - public UnparsedNotification setResourceId(String resourceId) { - return (UnparsedNotification) super.setResourceId(resourceId); - } - - @Override - public UnparsedNotification setResourceUri(String resourceUri) { - return (UnparsedNotification) super.setResourceUri(resourceUri); - } - - @Override - public UnparsedNotification setChannelId(String channelId) { - return (UnparsedNotification) super.setChannelId(channelId); - } - - @Override - public UnparsedNotification setChannelExpiration(String channelExpiration) { - return (UnparsedNotification) super.setChannelExpiration(channelExpiration); - } - - @Override - public UnparsedNotification setChannelToken(String channelToken) { - return (UnparsedNotification) super.setChannelToken(channelToken); - } - - @Override - public UnparsedNotification setChanged(String changed) { - return (UnparsedNotification) super.setChanged(changed); - } - - @Override - public String toString() { - return super.toStringHelper().add("contentType", contentType).toString(); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/UnparsedNotificationCallback.java b/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/UnparsedNotificationCallback.java deleted file mode 100644 index 79fec239..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/UnparsedNotificationCallback.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.notifications; - -import com.google.api.client.util.Beta; - -import java.io.IOException; -import java.io.Serializable; - -/** - * {@link Beta}
- * Callback to receive unparsed notifications for watched resource. - * - *

- * Must NOT be implemented in form of an anonymous class since this would break serialization. - *

- * - *

- * Should be thread-safe as several notifications might be processed at the same time. - *

- * - * Example usage: - * - *
-  static class MyNotificationCallback implements UnparsedNotificationCallback {
-
-    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;
-      }
-    }
-  }
- * 
- * - * @author Yaniv Inbar - * @author Matthias Linder (mlinder) - * @since 1.16 - */ -@Beta -public interface UnparsedNotificationCallback extends Serializable { - - /** - * Handles a received unparsed notification. - * - * @param storedChannel stored notification channel - * @param notification unparsed notification - */ - void onNotification(StoredChannel storedChannel, UnparsedNotification notification) - throws IOException; -} 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 deleted file mode 100644 index b8e9e5bd..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/json/JsonNotificationCallback.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.notifications.json; - -import com.google.api.client.googleapis.notifications.TypedNotificationCallback; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonObjectParser; -import com.google.api.client.util.Beta; - -import java.io.IOException; - -/** - * {@link Beta}
- * A {@link TypedNotificationCallback} which uses an JSON content encoding. - * - *

- * Must NOT be implemented in form of an anonymous class as this will break serialization. - *

- * - *

- * Implementation should be thread-safe. - *

- * - * Example usage: - * - *
-  static class MyNotificationCallback
-      extends JsonNotificationCallback{@literal <}ListResponse{@literal >} {
-
-    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 JsonFactory getJsonFactory() throws IOException {
-      return new JacksonFactory();
-    }
-
-    {@literal @}Override
-    protected Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
-      return ListResponse.class;
-    }
-  }
- * 
- * - * @param Type of the data contained within a notification - * @author Yaniv Inbar - * @since 1.16 - */ -@Beta -public abstract class JsonNotificationCallback extends TypedNotificationCallback { - - private static final long serialVersionUID = 1L; - - @Override - protected final JsonObjectParser getObjectParser() throws IOException { - return new JsonObjectParser(getJsonFactory()); - } - - /** Returns the JSON factory to use to parse the notification content. */ - protected abstract JsonFactory getJsonFactory() throws IOException; -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/json/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/json/package-info.java deleted file mode 100644 index 4252b92e..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/json/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * JSON-based notification handling for notification channels. - * - * @author Yaniv Inbar - * @since 1.16 - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.notifications.json; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/package-info.java deleted file mode 100644 index 20c06903..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/notifications/package-info.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Support for notification channels to listen for changes to watched Google API resources. - * - * @author Yaniv Inbar - * @author Matthias Linder (mlinder) - * @since 1.16 - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.notifications; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/package-info.java deleted file mode 100644 index 6057d481..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Google APIs. - * - * @since 1.0 - * @author Yaniv Inbar - */ - -package com.google.api.client.googleapis; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/services/AbstractGoogleClient.java b/google-api-client/src/main/java/com/google/api/client/googleapis/services/AbstractGoogleClient.java deleted file mode 100644 index 179cba40..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/AbstractGoogleClient.java +++ /dev/null @@ -1,548 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services; - -import com.google.api.client.googleapis.batch.BatchRequest; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.util.ObjectParser; -import com.google.api.client.util.Preconditions; -import com.google.api.client.util.Strings; - -import java.io.IOException; -import java.util.logging.Logger; - -/** - * Abstract thread-safe Google client. - * - * @since 1.12 - * @author Yaniv Inbar - */ -public abstract class AbstractGoogleClient { - - static final Logger LOGGER = Logger.getLogger(AbstractGoogleClient.class.getName()); - - /** The request factory for connections to the server. */ - private final HttpRequestFactory requestFactory; - - /** - * Initializer to use when creating an {@link AbstractGoogleClientRequest} or {@code null} for - * none. - */ - private final GoogleClientRequestInitializer googleClientRequestInitializer; - - /** - * Root URL of the service, for example {@code "https://www.googleapis.com/"}. Must be URL-encoded - * and must end with a "/". - */ - private final String rootUrl; - - /** - * Service path, for example {@code "tasks/v1/"}. Must be URL-encoded and must end with a "/". - */ - private final String servicePath; - - /** - * Application name to be sent in the User-Agent header of each request or {@code null} for none. - */ - private final String applicationName; - - /** Object parser or {@code null} for none. */ - private final ObjectParser objectParser; - - /** Whether discovery pattern checks should be suppressed on required parameters. */ - private boolean suppressPatternChecks; - - /** Whether discovery required parameter checks should be suppressed. */ - private boolean suppressRequiredParameterChecks; - - /** - * @param builder builder - * - * @since 1.14 - */ - protected AbstractGoogleClient(Builder builder) { - googleClientRequestInitializer = builder.googleClientRequestInitializer; - rootUrl = normalizeRootUrl(builder.rootUrl); - servicePath = normalizeServicePath(builder.servicePath); - if (Strings.isNullOrEmpty(builder.applicationName)) { - LOGGER.warning("Application name is not set. Call Builder#setApplicationName."); - } - applicationName = builder.applicationName; - requestFactory = builder.httpRequestInitializer == null - ? builder.transport.createRequestFactory() - : builder.transport.createRequestFactory(builder.httpRequestInitializer); - objectParser = builder.objectParser; - suppressPatternChecks = builder.suppressPatternChecks; - suppressRequiredParameterChecks = builder.suppressRequiredParameterChecks; - } - - /** - * Returns the URL-encoded root URL of the service, for example - * {@code "https://www.googleapis.com/"}. - * - *

- * Must end with a "/". - *

- */ - public final String getRootUrl() { - return rootUrl; - } - - /** - * Returns the URL-encoded service path of the service, for example {@code "tasks/v1/"}. - * - *

- * Must end with a "/" and not begin with a "/". It is allowed to be an empty string {@code ""} or - * a forward slash {@code "/"}, if it is a forward slash then it is treated as an empty string - *

- */ - public final String getServicePath() { - return servicePath; - } - - /** - * Returns the URL-encoded base URL of the service, for example - * {@code "https://www.googleapis.com/tasks/v1/"}. - * - *

- * Must end with a "/". It is guaranteed to be equal to {@code getRootUrl() + getServicePath()}. - *

- */ - public final String getBaseUrl() { - return rootUrl + servicePath; - } - - /** - * Returns the application name to be sent in the User-Agent header of each request or - * {@code null} for none. - */ - public final String getApplicationName() { - return applicationName; - } - - /** Returns the HTTP request factory. */ - public final HttpRequestFactory getRequestFactory() { - return requestFactory; - } - - /** Returns the Google client request initializer or {@code null} for none. */ - public final GoogleClientRequestInitializer getGoogleClientRequestInitializer() { - return googleClientRequestInitializer; - } - - /** - * Returns the object parser or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public ObjectParser getObjectParser() { - return objectParser; - } - - /** - * Initializes a {@link AbstractGoogleClientRequest} using a - * {@link GoogleClientRequestInitializer}. - * - *

- * Must be called before the Google client request is executed, preferably right after the request - * is instantiated. Sample usage: - *

- * - *
-    public class Get extends HttpClientRequest {
-      ...
-    }
-
-    public Get get(String userId) throws IOException {
-      Get result = new Get(userId);
-      initialize(result);
-      return result;
-    }
-   * 
- * - *

- * Subclasses may override by calling the super implementation. - *

- * - * @param httpClientRequest Google client request type - */ - protected void initialize(AbstractGoogleClientRequest httpClientRequest) throws IOException { - if (getGoogleClientRequestInitializer() != null) { - getGoogleClientRequestInitializer().initialize(httpClientRequest); - } - } - - /** - * Create an {@link BatchRequest} object from this Google API client instance. - * - *

- * Sample usage: - *

- * - *
-     client.batch()
-         .queue(...)
-         .queue(...)
-         .execute();
-   * 
- * - * @return newly created Batch request - */ - public final BatchRequest batch() { - return batch(null); - } - - /** - * Create an {@link BatchRequest} object from this Google API client instance. - * - *

- * Sample usage: - *

- * - *
-     client.batch(httpRequestInitializer)
-         .queue(...)
-         .queue(...)
-         .execute();
-   * 
- * - * @param httpRequestInitializer The initializer to use when creating the top-level batch HTTP - * request or {@code null} for none - * @return newly created Batch request - */ - public final BatchRequest batch(HttpRequestInitializer httpRequestInitializer) { - BatchRequest batch = - new BatchRequest(getRequestFactory().getTransport(), httpRequestInitializer); - batch.setBatchUrl(new GenericUrl(getRootUrl() + "batch")); - return batch; - } - - /** Returns whether discovery pattern checks should be suppressed on required parameters. */ - public final boolean getSuppressPatternChecks() { - return suppressPatternChecks; - } - - /** - * Returns whether discovery required parameter checks should be suppressed. - * - * @since 1.14 - */ - public final boolean getSuppressRequiredParameterChecks() { - return suppressRequiredParameterChecks; - } - - /** If the specified root URL does not end with a "/" then a "/" is added to the end. */ - static String normalizeRootUrl(String rootUrl) { - Preconditions.checkNotNull(rootUrl, "root URL cannot be null."); - if (!rootUrl.endsWith("/")) { - rootUrl += "/"; - } - return rootUrl; - } - - /** - * If the specified service path does not end with a "/" then a "/" is added to the end. If the - * specified service path begins with a "/" then the "/" is removed. - */ - static String normalizeServicePath(String servicePath) { - Preconditions.checkNotNull(servicePath, "service path cannot be null"); - if (servicePath.length() == 1) { - Preconditions.checkArgument( - "/".equals(servicePath), "service path must equal \"/\" if it is of length 1."); - servicePath = ""; - } else if (servicePath.length() > 0) { - if (!servicePath.endsWith("/")) { - servicePath += "/"; - } - if (servicePath.startsWith("/")) { - servicePath = servicePath.substring(1); - } - } - return servicePath; - } - - /** - * Builder for {@link AbstractGoogleClient}. - * - *

- * Implementation is not thread-safe. - *

- */ - public abstract static class Builder { - - /** HTTP transport. */ - final HttpTransport transport; - - /** - * Initializer to use when creating an {@link AbstractGoogleClientRequest} or {@code null} for - * none. - */ - GoogleClientRequestInitializer googleClientRequestInitializer; - - /** HTTP request initializer or {@code null} for none. */ - HttpRequestInitializer httpRequestInitializer; - - /** Object parser to use for parsing responses. */ - final ObjectParser objectParser; - - /** The root URL of the service, for example {@code "https://www.googleapis.com/"}. */ - String rootUrl; - - /** The service path of the service, for example {@code "tasks/v1/"}. */ - String servicePath; - - /** - * Application name to be sent in the User-Agent header of each request or {@code null} for - * none. - */ - String applicationName; - - /** Whether discovery pattern checks should be suppressed on required parameters. */ - boolean suppressPatternChecks; - - /** Whether discovery required parameter checks should be suppressed. */ - boolean suppressRequiredParameterChecks; - - /** - * Returns an instance of a new builder. - * - * @param transport The transport to use for requests - * @param rootUrl root URL of the service. Must end with a "/" - * @param servicePath service path - * @param objectParser object parser or {@code null} for none - * @param httpRequestInitializer HTTP request initializer or {@code null} for none - */ - protected Builder(HttpTransport transport, String rootUrl, String servicePath, - ObjectParser objectParser, HttpRequestInitializer httpRequestInitializer) { - this.transport = Preconditions.checkNotNull(transport); - this.objectParser = objectParser; - setRootUrl(rootUrl); - setServicePath(servicePath); - this.httpRequestInitializer = httpRequestInitializer; - } - - /** Builds a new instance of {@link AbstractGoogleClient}. */ - public abstract AbstractGoogleClient build(); - - /** Returns the HTTP transport. */ - public final HttpTransport getTransport() { - return transport; - } - - /** - * Returns the object parser or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public ObjectParser getObjectParser() { - return objectParser; - } - - /** - * Returns the URL-encoded root URL of the service, for example - * {@code https://www.googleapis.com/}. - * - *

- * Must be URL-encoded and must end with a "/". - *

- */ - public final String getRootUrl() { - return rootUrl; - } - - /** - * Sets the URL-encoded root URL of the service, for example {@code https://www.googleapis.com/} - * . - *

- * If the specified root URL does not end with a "/" then a "/" is added to the end. - *

- * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setRootUrl(String rootUrl) { - this.rootUrl = normalizeRootUrl(rootUrl); - return this; - } - - /** - * Returns the URL-encoded service path of the service, for example {@code "tasks/v1/"}. - * - *

- * Must be URL-encoded and must end with a "/" and not begin with a "/". It is allowed to be an - * empty string {@code ""}. - *

- */ - public final String getServicePath() { - return servicePath; - } - - /** - * Sets the URL-encoded service path of the service, for example {@code "tasks/v1/"}. - * - *

- * It is allowed to be an empty string {@code ""} or a forward slash {@code "/"}, if it is a - * forward slash then it is treated as an empty string. This is determined when the library is - * generated and normally should not be changed. - *

- * - *

- * If the specified service path does not end with a "/" then a "/" is added to the end. If the - * specified service path begins with a "/" then the "/" is removed. - *

- * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setServicePath(String servicePath) { - this.servicePath = normalizeServicePath(servicePath); - return this; - } - - /** Returns the Google client request initializer or {@code null} for none. */ - public final GoogleClientRequestInitializer getGoogleClientRequestInitializer() { - return googleClientRequestInitializer; - } - - /** - * Sets the Google client request initializer or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setGoogleClientRequestInitializer( - GoogleClientRequestInitializer googleClientRequestInitializer) { - this.googleClientRequestInitializer = googleClientRequestInitializer; - return this; - } - - /** Returns the HTTP request initializer or {@code null} for none. */ - public final HttpRequestInitializer getHttpRequestInitializer() { - return httpRequestInitializer; - } - - /** - * Sets the HTTP request initializer or {@code null} for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer) { - this.httpRequestInitializer = httpRequestInitializer; - return this; - } - - /** - * Returns the application name to be used in the UserAgent header of each request or - * {@code null} for none. - */ - public final String getApplicationName() { - return applicationName; - } - - /** - * Sets the application name to be used in the UserAgent header of each request or {@code null} - * for none. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setApplicationName(String applicationName) { - this.applicationName = applicationName; - return this; - } - - /** Returns whether discovery pattern checks should be suppressed on required parameters. */ - public final boolean getSuppressPatternChecks() { - return suppressPatternChecks; - } - - /** - * Sets whether discovery pattern checks should be suppressed on required parameters. - * - *

- * Default value is {@code false}. - *

- * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public Builder setSuppressPatternChecks(boolean suppressPatternChecks) { - this.suppressPatternChecks = suppressPatternChecks; - return this; - } - - /** - * Returns whether discovery required parameter checks should be suppressed. - * - * @since 1.14 - */ - public final boolean getSuppressRequiredParameterChecks() { - return suppressRequiredParameterChecks; - } - - /** - * Sets whether discovery required parameter checks should be suppressed. - * - *

- * Default value is {@code false}. - *

- * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- * - * @since 1.14 - */ - public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) { - this.suppressRequiredParameterChecks = suppressRequiredParameterChecks; - return this; - } - - /** - * Suppresses all discovery pattern and required parameter checks. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- * - * @since 1.14 - */ - public Builder setSuppressAllChecks(boolean suppressAllChecks) { - return setSuppressPatternChecks(true).setSuppressRequiredParameterChecks(true); - } - } -} 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 deleted file mode 100644 index 95837810..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequest.java +++ /dev/null @@ -1,610 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services; - -import com.google.api.client.googleapis.MethodOverride; -import com.google.api.client.googleapis.batch.BatchCallback; -import com.google.api.client.googleapis.batch.BatchRequest; -import com.google.api.client.googleapis.media.MediaHttpDownloader; -import com.google.api.client.googleapis.media.MediaHttpUploader; -import com.google.api.client.http.AbstractInputStreamContent; -import com.google.api.client.http.EmptyContent; -import com.google.api.client.http.GZipEncoding; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpMethods; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpResponseException; -import com.google.api.client.http.HttpResponseInterceptor; -import com.google.api.client.http.UriTemplate; -import com.google.api.client.util.GenericData; -import com.google.api.client.util.Preconditions; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * Abstract Google client request for a {@link AbstractGoogleClient}. - * - *

- * Implementation is not thread-safe. - *

- * - * @param type of the response - * - * @since 1.12 - * @author Yaniv Inbar - */ -public abstract class AbstractGoogleClientRequest extends GenericData { - - /** - * User agent suffix for all requests. - * - * @since 1.20 - */ - public static final String USER_AGENT_SUFFIX = "Google-API-Java-Client"; - - /** Google client. */ - private final AbstractGoogleClient abstractGoogleClient; - - /** HTTP method. */ - private final String requestMethod; - - /** URI template for the path relative to the base URL. */ - private final String uriTemplate; - - /** HTTP content or {@code null} for none. */ - private final HttpContent httpContent; - - /** HTTP headers used for the Google client request. */ - private HttpHeaders requestHeaders = new HttpHeaders(); - - /** HTTP headers of the last response or {@code null} before request has been executed. */ - private HttpHeaders lastResponseHeaders; - - /** Status code of the last response or {@code -1} before request has been executed. */ - private int lastStatusCode = -1; - - /** Status message of the last response or {@code null} before request has been executed. */ - private String lastStatusMessage; - - /** Whether to disable GZip compression of HTTP content. */ - private boolean disableGZipContent; - - /** Response class to parse into. */ - private Class responseClass; - - /** Media HTTP uploader or {@code null} for none. */ - private MediaHttpUploader uploader; - - /** Media HTTP downloader or {@code null} for none. */ - private MediaHttpDownloader downloader; - - /** - * @param abstractGoogleClient Google client - * @param requestMethod HTTP Method - * @param uriTemplate URI template for the path relative to the base URL. If it starts with a "/" - * the base path from the base URL will be stripped out. The URI template can also be a - * full URL. URI template expansion is done using - * {@link UriTemplate#expand(String, String, Object, boolean)} - * @param httpContent HTTP content or {@code null} for none - * @param responseClass response class to parse into - */ - protected AbstractGoogleClientRequest(AbstractGoogleClient abstractGoogleClient, - String requestMethod, String uriTemplate, HttpContent httpContent, Class responseClass) { - this.responseClass = Preconditions.checkNotNull(responseClass); - this.abstractGoogleClient = Preconditions.checkNotNull(abstractGoogleClient); - this.requestMethod = Preconditions.checkNotNull(requestMethod); - this.uriTemplate = Preconditions.checkNotNull(uriTemplate); - this.httpContent = httpContent; - // application name - String applicationName = abstractGoogleClient.getApplicationName(); - if (applicationName != null) { - requestHeaders.setUserAgent(applicationName + " " + USER_AGENT_SUFFIX); - } else { - requestHeaders.setUserAgent(USER_AGENT_SUFFIX); - } - } - - /** Returns whether to disable GZip compression of HTTP content. */ - public final boolean getDisableGZipContent() { - return disableGZipContent; - } - - /** - * Sets whether to disable GZip compression of HTTP content. - * - *

- * By default it is {@code false}. - *

- * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public AbstractGoogleClientRequest setDisableGZipContent(boolean disableGZipContent) { - this.disableGZipContent = disableGZipContent; - return this; - } - - /** Returns the HTTP method. */ - public final String getRequestMethod() { - return requestMethod; - } - - /** Returns the URI template for the path relative to the base URL. */ - public final String getUriTemplate() { - return uriTemplate; - } - - /** Returns the HTTP content or {@code null} for none. */ - public final HttpContent getHttpContent() { - return httpContent; - } - - /** - * Returns the Google client. - * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public AbstractGoogleClient getAbstractGoogleClient() { - return abstractGoogleClient; - } - - /** Returns the HTTP headers used for the Google client request. */ - public final HttpHeaders getRequestHeaders() { - return requestHeaders; - } - - /** - * Sets the HTTP headers used for the Google client request. - * - *

- * These headers are set on the request after {@link #buildHttpRequest} is called, this means that - * {@link HttpRequestInitializer#initialize} is called first. - *

- * - *

- * Overriding is only supported for the purpose of calling the super implementation and changing - * the return type, but nothing else. - *

- */ - public AbstractGoogleClientRequest setRequestHeaders(HttpHeaders headers) { - this.requestHeaders = headers; - return this; - } - - /** - * Returns the HTTP headers of the last response or {@code null} before request has been executed. - */ - public final HttpHeaders getLastResponseHeaders() { - return lastResponseHeaders; - } - - /** - * Returns the status code of the last response or {@code -1} before request has been executed. - */ - public final int getLastStatusCode() { - return lastStatusCode; - } - - /** - * Returns the status message of the last response or {@code null} before request has been - * executed. - */ - public final String getLastStatusMessage() { - return lastStatusMessage; - } - - /** Returns the response class to parse into. */ - public final Class getResponseClass() { - return responseClass; - } - - /** Returns the media HTTP Uploader or {@code null} for none. */ - public final MediaHttpUploader getMediaHttpUploader() { - return uploader; - } - - /** - * Initializes the media HTTP uploader based on the media content. - * - * @param mediaContent media content - */ - protected final void initializeMediaUpload(AbstractInputStreamContent mediaContent) { - HttpRequestFactory requestFactory = abstractGoogleClient.getRequestFactory(); - this.uploader = new MediaHttpUploader( - mediaContent, requestFactory.getTransport(), requestFactory.getInitializer()); - this.uploader.setInitiationRequestMethod(requestMethod); - if (httpContent != null) { - this.uploader.setMetadata(httpContent); - } - } - - /** Returns the media HTTP downloader or {@code null} for none. */ - public final MediaHttpDownloader getMediaHttpDownloader() { - return downloader; - } - - /** Initializes the media HTTP downloader. */ - protected final void initializeMediaDownload() { - HttpRequestFactory requestFactory = abstractGoogleClient.getRequestFactory(); - this.downloader = - new MediaHttpDownloader(requestFactory.getTransport(), requestFactory.getInitializer()); - } - - /** - * Creates a new instance of {@link GenericUrl} suitable for use against this service. - * - *

- * Subclasses may override by calling the super implementation. - *

- * - * @return newly created {@link GenericUrl} - */ - public GenericUrl buildHttpRequestUrl() { - return new GenericUrl( - UriTemplate.expand(abstractGoogleClient.getBaseUrl(), uriTemplate, this, true)); - } - - /** - * Create a request suitable for use against this service. - * - *

- * Subclasses may override by calling the super implementation. - *

- */ - public HttpRequest buildHttpRequest() throws IOException { - return buildHttpRequest(false); - } - - /** - * Create a request suitable for use against this service, but using HEAD instead of GET. - * - *

- * Only supported when the original request method is GET. - *

- * - *

- * Subclasses may override by calling the super implementation. - *

- */ - protected HttpRequest buildHttpRequestUsingHead() throws IOException { - return buildHttpRequest(true); - } - - /** Create a request suitable for use against this service. */ - private HttpRequest buildHttpRequest(boolean usingHead) throws IOException { - Preconditions.checkArgument(uploader == null); - Preconditions.checkArgument(!usingHead || requestMethod.equals(HttpMethods.GET)); - String requestMethodToUse = usingHead ? HttpMethods.HEAD : requestMethod; - final HttpRequest httpRequest = getAbstractGoogleClient() - .getRequestFactory().buildRequest(requestMethodToUse, buildHttpRequestUrl(), httpContent); - new MethodOverride().intercept(httpRequest); - httpRequest.setParser(getAbstractGoogleClient().getObjectParser()); - // custom methods may use POST with no content but require a Content-Length header - if (httpContent == null && (requestMethod.equals(HttpMethods.POST) - || requestMethod.equals(HttpMethods.PUT) || requestMethod.equals(HttpMethods.PATCH))) { - httpRequest.setContent(new EmptyContent()); - } - httpRequest.getHeaders().putAll(requestHeaders); - if (!disableGZipContent) { - httpRequest.setEncoding(new GZipEncoding()); - } - final HttpResponseInterceptor responseInterceptor = httpRequest.getResponseInterceptor(); - httpRequest.setResponseInterceptor(new HttpResponseInterceptor() { - - public void interceptResponse(HttpResponse response) throws IOException { - if (responseInterceptor != null) { - responseInterceptor.interceptResponse(response); - } - if (!response.isSuccessStatusCode() && httpRequest.getThrowExceptionOnExecuteError()) { - throw newExceptionOnError(response); - } - } - }); - return httpRequest; - } - - /** - * Sends the metadata request to the server and returns the raw metadata {@link HttpResponse}. - * - *

- * Callers are responsible for disconnecting the HTTP response by calling - * {@link HttpResponse#disconnect}. Example usage: - *

- * - *
-     HttpResponse response = request.executeUnparsed();
-     try {
-       // process response..
-     } finally {
-       response.disconnect();
-     }
-   * 
- * - *

- * Subclasses may override by calling the super implementation. - *

- * - * @return the {@link HttpResponse} - */ - public HttpResponse executeUnparsed() throws IOException { - return executeUnparsed(false); - } - - /** - * Sends the media request to the server and returns the raw media {@link HttpResponse}. - * - *

- * Callers are responsible for disconnecting the HTTP response by calling - * {@link HttpResponse#disconnect}. Example usage: - *

- * - *
-     HttpResponse response = request.executeMedia();
-     try {
-       // process response..
-     } finally {
-       response.disconnect();
-     }
-   * 
- * - *

- * Subclasses may override by calling the super implementation. - *

- * - * @return the {@link HttpResponse} - */ - protected HttpResponse executeMedia() throws IOException { - set("alt", "media"); - return executeUnparsed(); - } - - /** - * Sends the metadata request using HEAD to the server and returns the raw metadata - * {@link HttpResponse} for the response headers. - * - *

- * Only supported when the original request method is GET. The response content is assumed to be - * empty and ignored. Calls {@link HttpResponse#ignore()} so there is no need to disconnect the - * response. Example usage: - *

- * - *
-     HttpResponse response = request.executeUsingHead();
-     // look at response.getHeaders()
-   * 
- * - *

- * Subclasses may override by calling the super implementation. - *

- * - * @return the {@link HttpResponse} - */ - protected HttpResponse executeUsingHead() throws IOException { - Preconditions.checkArgument(uploader == null); - HttpResponse response = executeUnparsed(true); - response.ignore(); - return response; - } - - /** - * Sends the metadata request using the given request method to the server and returns the raw - * metadata {@link HttpResponse}. - */ - private HttpResponse executeUnparsed(boolean usingHead) throws IOException { - HttpResponse response; - if (uploader == null) { - // normal request (not upload) - response = buildHttpRequest(usingHead).execute(); - } else { - // upload request - GenericUrl httpRequestUrl = buildHttpRequestUrl(); - HttpRequest httpRequest = getAbstractGoogleClient() - .getRequestFactory().buildRequest(requestMethod, httpRequestUrl, httpContent); - boolean throwExceptionOnExecuteError = httpRequest.getThrowExceptionOnExecuteError(); - - response = uploader.setInitiationHeaders(requestHeaders) - .setDisableGZipContent(disableGZipContent).upload(httpRequestUrl); - response.getRequest().setParser(getAbstractGoogleClient().getObjectParser()); - // process any error - if (throwExceptionOnExecuteError && !response.isSuccessStatusCode()) { - throw newExceptionOnError(response); - } - } - // process response - lastResponseHeaders = response.getHeaders(); - lastStatusCode = response.getStatusCode(); - lastStatusMessage = response.getStatusMessage(); - return response; - } - - /** - * Returns the exception to throw on an HTTP error response as defined by - * {@link HttpResponse#isSuccessStatusCode()}. - * - *

- * It is guaranteed that {@link HttpResponse#isSuccessStatusCode()} is {@code false}. Default - * implementation is to call {@link HttpResponseException#HttpResponseException(HttpResponse)}, - * but subclasses may override. - *

- * - * @param response HTTP response - * @return exception to throw - */ - protected IOException newExceptionOnError(HttpResponse response) { - return new HttpResponseException(response); - } - - /** - * Sends the metadata request to the server and returns the parsed metadata response. - * - *

- * Subclasses may override by calling the super implementation. - *

- * - * @return parsed HTTP response - */ - public T execute() throws IOException { - return executeUnparsed().parseAs(responseClass); - } - - /** - * Sends the metadata request to the server and returns the metadata content input stream of - * {@link HttpResponse}. - * - *

- * Callers are responsible for closing the input stream after it is processed. Example sample: - *

- * - *
-     InputStream is = request.executeAsInputStream();
-     try {
-       // Process input stream..
-     } finally {
-       is.close();
-     }
-   * 
- * - *

- * Subclasses may override by calling the super implementation. - *

- * - * @return input stream of the response content - */ - public InputStream executeAsInputStream() throws IOException { - return executeUnparsed().getContent(); - } - - /** - * Sends the media request to the server and returns the media content input stream of - * {@link HttpResponse}. - * - *

- * Callers are responsible for closing the input stream after it is processed. Example sample: - *

- * - *
-     InputStream is = request.executeMediaAsInputStream();
-     try {
-       // Process input stream..
-     } finally {
-       is.close();
-     }
-   * 
- * - *

- * Subclasses may override by calling the super implementation. - *

- * - * @return input stream of the response content - */ - protected InputStream executeMediaAsInputStream() throws IOException { - return executeMedia().getContent(); - } - - /** - * Sends the metadata request to the server and writes the metadata content input stream of - * {@link HttpResponse} into the given destination output stream. - * - *

- * This method closes the content of the HTTP response from {@link HttpResponse#getContent()}. - *

- * - *

- * Subclasses may override by calling the super implementation. - *

- * - * @param outputStream destination output stream - */ - public void executeAndDownloadTo(OutputStream outputStream) throws IOException { - executeUnparsed().download(outputStream); - } - - /** - * Sends the media request to the server and writes the media content input stream of - * {@link HttpResponse} into the given destination output stream. - * - *

- * This method closes the content of the HTTP response from {@link HttpResponse#getContent()}. - *

- * - *

- * Subclasses may override by calling the super implementation. - *

- * - * @param outputStream destination output stream - */ - protected void executeMediaAndDownloadTo(OutputStream outputStream) throws IOException { - if (downloader == null) { - executeMedia().download(outputStream); - } else { - downloader.download(buildHttpRequestUrl(), requestHeaders, outputStream); - } - } - - /** - * Queues the request into the specified batch request container using the specified error class. - * - *

- * Batched requests are then executed when {@link BatchRequest#execute()} is called. - *

- * - * @param batchRequest batch request container - * @param errorClass data class the unsuccessful response will be parsed into or - * {@code Void.class} to ignore the content - * @param callback batch callback - */ - public final void queue( - BatchRequest batchRequest, Class errorClass, BatchCallback callback) - throws IOException { - Preconditions.checkArgument(uploader == null, "Batching media requests is not supported"); - batchRequest.queue(buildHttpRequest(), getResponseClass(), errorClass, callback); - } - - // @SuppressWarnings was added here because this is generic class. - // see: http://stackoverflow.com/questions/4169806/java-casting-object-to-a-generic-type and - // http://www.angelikalanger.com/GenericsFAQ/FAQSections/TechnicalDetails.html#Type%20Erasure - // for more details - @SuppressWarnings("unchecked") - @Override - public AbstractGoogleClientRequest set(String fieldName, Object value) { - return (AbstractGoogleClientRequest) super.set(fieldName, value); - } - - /** - * Ensures that the specified required parameter is not null or - * {@link AbstractGoogleClient#getSuppressRequiredParameterChecks()} is true. - * - * @param value the value of the required parameter - * @param name the name of the required parameter - * @throws IllegalArgumentException if the specified required parameter is null and - * {@link AbstractGoogleClient#getSuppressRequiredParameterChecks()} is false - * @since 1.14 - */ - protected final void checkRequiredParameter(Object value, String name) { - Preconditions.checkArgument( - abstractGoogleClient.getSuppressRequiredParameterChecks() || value != null, - "Required parameter %s must be specified", name); - } -} 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 deleted file mode 100644 index e14fa4e8..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/CommonGoogleClientRequestInitializer.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services; - -import java.io.IOException; - - -/** - * Google common client request initializer implementation for setting properties like key and - * userIp. - * - *

- * The simplest usage is to use it to set the key parameter: - *

- * - *
-  public static final GoogleClientRequestInitializer KEY_INITIALIZER =
-      new CommonGoogleClientRequestInitializer(KEY);
- * 
- * - *

- * There is also a constructor to set both the key and userIp parameters: - *

- * - *
-  public static final GoogleClientRequestInitializer INITIALIZER =
-      new CommonGoogleClientRequestInitializer(KEY, USER_IP);
- * 
- * - *

- * If you want to implement custom logic, extend it like this: - *

- * - *
-  public static class MyRequestInitializer extends CommonGoogleClientRequestInitializer {
-
-    {@literal @}Override
-    public void initialize(AbstractGoogleClientRequest{@literal <}?{@literal >} request)
-        throws IOException {
-      // custom logic
-    }
-  }
- * 
- * - *

- * Finally, to set the key and userIp parameters and insert custom logic, extend it like this: - *

- * - *
-  public static class MyRequestInitializer2 extends CommonGoogleClientRequestInitializer {
-
-    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
-    }
-  }
- * 
- * - *

- * Subclasses should be thread-safe. - *

- * - * @since 1.12 - * @author Yaniv Inbar - */ -public class CommonGoogleClientRequestInitializer implements GoogleClientRequestInitializer { - - /** API key or {@code null} to leave it unchanged. */ - private final String key; - - /** User IP or {@code null} to leave it unchanged. */ - private final String userIp; - - public CommonGoogleClientRequestInitializer() { - this(null); - } - - /** - * @param key API key or {@code null} to leave it unchanged - */ - public CommonGoogleClientRequestInitializer(String key) { - this(key, null); - } - - /** - * @param key API key or {@code null} to leave it unchanged - * @param userIp user IP or {@code null} to leave it unchanged - */ - public CommonGoogleClientRequestInitializer(String key, String userIp) { - this.key = key; - this.userIp = userIp; - } - - /** - * Subclasses should call super implementation in order to set the key and userIp. - * - * @throws IOException I/O exception - */ - public void initialize(AbstractGoogleClientRequest request) throws IOException { - if (key != null) { - request.put("key", key); - } - if (userIp != null) { - request.put("userIp", userIp); - } - } - - /** Returns the API key or {@code null} to leave it unchanged. */ - public final String getKey() { - return key; - } - - /** Returns the user IP or {@code null} to leave it unchanged. */ - public final String getUserIp() { - return userIp; - } -} 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 deleted file mode 100644 index c1a76cea..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/GoogleClientRequestInitializer.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services; - -import java.io.IOException; - -/** - * Google client request initializer. - * - *

- * For example, this might be used to set a key URL query parameter on all requests: - *

- * - *
-  public class KeyRequestInitializer implements GoogleClientRequestInitializer {
-    public void initialize(GoogleClientRequest request) {
-      request.put("key", KEY);
-    }
-  }
- * 
- * - *

- * Implementations should be thread-safe. - *

- * - * @since 1.12 - * @author Yaniv Inbar - */ -public interface GoogleClientRequestInitializer { - - /** Initializes a Google client request. */ - void initialize(AbstractGoogleClientRequest request) throws IOException; -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/AbstractGoogleJsonClient.java b/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/AbstractGoogleJsonClient.java deleted file mode 100644 index 65faf653..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/AbstractGoogleJsonClient.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services.json; - -import com.google.api.client.googleapis.services.AbstractGoogleClient; -import com.google.api.client.googleapis.services.GoogleClientRequestInitializer; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonObjectParser; - -import java.util.Arrays; -import java.util.Collections; - -/** - * Thread-safe Google JSON client. - * - * @since 1.12 - * @author Yaniv Inbar - */ -public abstract class AbstractGoogleJsonClient extends AbstractGoogleClient { - - /** - * @param builder builder - * - * @since 1.14 - */ - protected AbstractGoogleJsonClient(Builder builder) { - super(builder); - } - - @Override - public JsonObjectParser getObjectParser() { - return (JsonObjectParser) super.getObjectParser(); - } - - /** Returns the JSON Factory. */ - public final JsonFactory getJsonFactory() { - return getObjectParser().getJsonFactory(); - } - - /** - * Builder for {@link AbstractGoogleJsonClient}. - * - *

- * Implementation is not thread-safe. - *

- */ - public abstract static class Builder extends AbstractGoogleClient.Builder { - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - * @param rootUrl root URL of the service - * @param servicePath service path - * @param httpRequestInitializer HTTP request initializer or {@code null} for none - * @param legacyDataWrapper whether using the legacy data wrapper in responses - */ - protected Builder(HttpTransport transport, JsonFactory jsonFactory, String rootUrl, - String servicePath, HttpRequestInitializer httpRequestInitializer, - boolean legacyDataWrapper) { - super(transport, rootUrl, servicePath, new JsonObjectParser.Builder( - jsonFactory).setWrapperKeys( - legacyDataWrapper ? Arrays.asList("data", "error") : Collections.emptySet()) - .build(), httpRequestInitializer); - } - - @Override - public final JsonObjectParser getObjectParser() { - return (JsonObjectParser) super.getObjectParser(); - } - - /** Returns the JSON Factory. */ - public final JsonFactory getJsonFactory() { - return getObjectParser().getJsonFactory(); - } - - @Override - public abstract AbstractGoogleJsonClient build(); - - @Override - public Builder setRootUrl(String rootUrl) { - return (Builder) super.setRootUrl(rootUrl); - } - - @Override - public Builder setServicePath(String servicePath) { - return (Builder) super.setServicePath(servicePath); - } - - @Override - public Builder setGoogleClientRequestInitializer( - GoogleClientRequestInitializer googleClientRequestInitializer) { - return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer); - } - - @Override - public Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer) { - return (Builder) super.setHttpRequestInitializer(httpRequestInitializer); - } - - @Override - public Builder setApplicationName(String applicationName) { - return (Builder) super.setApplicationName(applicationName); - } - - @Override - public Builder setSuppressPatternChecks(boolean suppressPatternChecks) { - return (Builder) super.setSuppressPatternChecks(suppressPatternChecks); - } - - @Override - public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) { - return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks); - } - - @Override - public Builder setSuppressAllChecks(boolean suppressAllChecks) { - return (Builder) super.setSuppressAllChecks(suppressAllChecks); - } - } -} 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 deleted file mode 100644 index 6a263454..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/AbstractGoogleJsonClientRequest.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services.json; - -import com.google.api.client.googleapis.batch.BatchRequest; -import com.google.api.client.googleapis.batch.json.JsonBatchCallback; -import com.google.api.client.googleapis.json.GoogleJsonErrorContainer; -import com.google.api.client.googleapis.json.GoogleJsonResponseException; -import com.google.api.client.googleapis.services.AbstractGoogleClientRequest; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.UriTemplate; -import com.google.api.client.http.json.JsonHttpContent; - -import java.io.IOException; - -/** - * Google JSON request for a {@link AbstractGoogleJsonClient}. - * - *

- * Implementation is not thread-safe. - *

- * - * @param type of the response - * @since 1.12 - * @author Yaniv Inbar - */ -public abstract class AbstractGoogleJsonClientRequest extends AbstractGoogleClientRequest { - - /** POJO that can be serialized into JSON content or {@code null} for none. */ - private final Object jsonContent; - - /** - * @param abstractGoogleJsonClient Google JSON client - * @param requestMethod HTTP Method - * @param uriTemplate URI template for the path relative to the base URL. If it starts with a "/" - * the base path from the base URL will be stripped out. The URI template can also be a - * full URL. URI template expansion is done using - * {@link UriTemplate#expand(String, String, Object, boolean)} - * @param jsonContent POJO that can be serialized into JSON content or {@code null} for none - * @param responseClass response class to parse into - */ - protected AbstractGoogleJsonClientRequest(AbstractGoogleJsonClient abstractGoogleJsonClient, - String requestMethod, String uriTemplate, Object jsonContent, Class responseClass) { - super(abstractGoogleJsonClient, requestMethod, uriTemplate, jsonContent == null ? null - : new JsonHttpContent(abstractGoogleJsonClient.getJsonFactory(), jsonContent) - .setWrapperKey(abstractGoogleJsonClient.getObjectParser().getWrapperKeys().isEmpty() - ? null : "data"), responseClass); - this.jsonContent = jsonContent; - } - - @Override - public AbstractGoogleJsonClient getAbstractGoogleClient() { - return (AbstractGoogleJsonClient) super.getAbstractGoogleClient(); - } - - @Override - public AbstractGoogleJsonClientRequest setDisableGZipContent(boolean disableGZipContent) { - return (AbstractGoogleJsonClientRequest) super.setDisableGZipContent(disableGZipContent); - } - - @Override - public AbstractGoogleJsonClientRequest setRequestHeaders(HttpHeaders headers) { - return (AbstractGoogleJsonClientRequest) super.setRequestHeaders(headers); - } - - /** - * Queues the request into the specified batch request container. - * - *

- * Batched requests are then executed when {@link BatchRequest#execute()} is called. - *

- *

- * Example usage: - *

- * - *
-     request.queue(batchRequest, new JsonBatchCallback<SomeResponseType>() {
-
-       public void onSuccess(SomeResponseType content, HttpHeaders responseHeaders) {
-         log("Success");
-       }
-
-       public void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) {
-         log(e.getMessage());
-       }
-     });
-   * 
- * - * - * @param batchRequest batch request container - * @param callback batch callback - */ - public final void queue(BatchRequest batchRequest, JsonBatchCallback callback) - throws IOException { - super.queue(batchRequest, GoogleJsonErrorContainer.class, callback); - } - - @Override - protected GoogleJsonResponseException newExceptionOnError(HttpResponse response) { - return GoogleJsonResponseException.from(getAbstractGoogleClient().getJsonFactory(), response); - } - - /** Returns POJO that can be serialized into JSON content or {@code null} for none. */ - public Object getJsonContent() { - return jsonContent; - } - - @Override - public AbstractGoogleJsonClientRequest set(String fieldName, Object value) { - return (AbstractGoogleJsonClientRequest) super.set(fieldName, value); - } -} 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 deleted file mode 100644 index 45784c31..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/CommonGoogleJsonClientRequestInitializer.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services.json; - -import com.google.api.client.googleapis.services.AbstractGoogleClientRequest; -import com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer; - -import java.io.IOException; - -/** - * Google JSON client request initializer implementation for setting properties like key and userIp. - * - *

- * The simplest usage is to use it to set the key parameter: - *

- * - *
-  public static final GoogleClientRequestInitializer KEY_INITIALIZER =
-      new CommonGoogleJsonClientRequestInitializer(KEY);
- * 
- * - *

- * There is also a constructor to set both the key and userIp parameters: - *

- * - *
-  public static final GoogleClientRequestInitializer INITIALIZER =
-      new CommonGoogleJsonClientRequestInitializer(KEY, USER_IP);
- * 
- * - *

- * If you want to implement custom logic, extend it like this: - *

- * - *
-  public static class MyRequestInitializer extends CommonGoogleJsonClientRequestInitializer {
-
-    {@literal @}Override
-    public void initialize(AbstractGoogleJsonClientRequest{@literal <}?{@literal >} request)
-        throws IOException {
-      // custom logic
-    }
-  }
- * 
- * - *

- * Finally, to set the key and userIp parameters and insert custom logic, extend it like this: - *

- * - *
-  public static class MyKeyRequestInitializer extends CommonGoogleJsonClientRequestInitializer {
-
-    public MyKeyRequestInitializer() {
-      super(KEY, USER_IP);
-    }
-
-    {@literal @}Override
-    public void initializeJsonRequest(
-        AbstractGoogleJsonClientRequest{@literal <}?{@literal >} request) throws IOException {
-      // custom logic
-    }
-  }
- * 
- * - *

- * Subclasses should be thread-safe. - *

- * - * @since 1.12 - * @author Yaniv Inbar - */ -public class CommonGoogleJsonClientRequestInitializer extends CommonGoogleClientRequestInitializer { - - public CommonGoogleJsonClientRequestInitializer() { - super(); - } - - /** - * @param key API key or {@code null} to leave it unchanged - */ - public CommonGoogleJsonClientRequestInitializer(String key) { - super(key); - } - - /** - * @param key API key or {@code null} to leave it unchanged - * @param userIp user IP or {@code null} to leave it unchanged - */ - public CommonGoogleJsonClientRequestInitializer(String key, String userIp) { - super(key, userIp); - } - - @Override - public final void initialize(AbstractGoogleClientRequest request) throws IOException { - super.initialize(request); - initializeJsonRequest((AbstractGoogleJsonClientRequest) request); - } - - /** - * Initializes a Google JSON client request. - * - *

- * Default implementation does nothing. Called from - * {@link #initialize(AbstractGoogleClientRequest)}. - *

- * - * @throws IOException I/O exception - */ - protected void initializeJsonRequest(AbstractGoogleJsonClientRequest request) - throws IOException { - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/package-info.java deleted file mode 100644 index 14cbf0f6..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/json/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Contains the basis for the generated service-specific libraries based on the JSON format. - * - * @since 1.12 - * @author Yaniv Inbar - */ - -package com.google.api.client.googleapis.services.json; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/services/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/services/package-info.java deleted file mode 100644 index f35dce21..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/services/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Contains the basis for the generated service-specific libraries. - * - * @since 1.6 - * @author Ravi Mistry - */ - -package com.google.api.client.googleapis.services; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/TestUtils.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/TestUtils.java deleted file mode 100644 index 4eb84292..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/TestUtils.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2014 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.testing; - -import com.google.common.base.Splitter; -import com.google.common.collect.Lists; - -import java.io.IOException; -import java.net.URLDecoder; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Utility class for test code. - */ -public final class TestUtils { - - private static final String UTF_8 = "UTF-8"; - - public static Map parseQuery(String query) throws IOException { - Map map = new HashMap(); - Iterable entries = Splitter.on('&').split(query); - for (String entry : entries) { - List sides = Lists.newArrayList(Splitter.on('=').split(entry)); - if (sides.size() != 2) { - throw new IOException("Invalid Query String"); - } - String key = URLDecoder.decode(sides.get(0), UTF_8); - String value = URLDecoder.decode(sides.get(1), UTF_8); - map.put(key, value); - } - return map; - } - - private TestUtils() { - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/auth/oauth2/MockGoogleCredential.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/auth/oauth2/MockGoogleCredential.java deleted file mode 100644 index fa4879fb..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/auth/oauth2/MockGoogleCredential.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.google.api.client.googleapis.testing.auth.oauth2; - -import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.Json; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpRequest; -import com.google.api.client.testing.http.MockLowLevelHttpResponse; -import com.google.api.client.util.Beta; -import com.google.api.client.util.Clock; - -import java.io.IOException; - -/** - * {@link Beta}
- * Mock for {@link GoogleCredential}. - * - * @since 1.20 - */ -@Beta -public class MockGoogleCredential extends GoogleCredential { - public static final String ACCESS_TOKEN = "access_xyz"; - public static final String REFRESH_TOKEN = "refresh123"; - private static final String EXPIRES_IN_SECONDS = "3600"; - private static final String TOKEN_TYPE = "Bearer"; - private static final String TOKEN_RESPONSE = "{" - + "\"access_token\": \"%s\", " - + "\"expires_in\": %s, " - + "\"refresh_token\": \"%s\", " - + "\"token_type\": \"%s\"" - + "}"; - - private static final String DEFAULT_TOKEN_RESPONSE_JSON = String.format(TOKEN_RESPONSE, - ACCESS_TOKEN, EXPIRES_IN_SECONDS, REFRESH_TOKEN, TOKEN_TYPE); - - public MockGoogleCredential(Builder builder) { - super(builder); - } - - /** - * Mock for GoogleCredential.Builder. - * - *

Setters that are necessary for simple {@link GoogleCredential} creation are overridden in - * order to change the return type. A concrete {@link JsonFactory} is set by default, since JSON - * parsing is relied upon often in GoogleCredential which makes mocking parse calls problematic. - *

- * - *

By default, a standard {@link MockHttpTransport} is supplied. For simple tests in which - * 'refresh' methods are called but the request/response isn't used - * {@link #newMockHttpTransportWithSampleTokenResponse()} provides a minimal implementation. For - * more complex tests which check request/response behavior prefer MockTokenServerTransport.

- */ - @Beta - public static class Builder extends GoogleCredential.Builder { - @Override - public Builder setTransport(HttpTransport transport) { - return (MockGoogleCredential.Builder) super.setTransport(transport); - } - - @Override - public Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication) { - return (MockGoogleCredential.Builder) super.setClientAuthentication(clientAuthentication); - } - - @Override - public Builder setJsonFactory(JsonFactory jsonFactory) { - return (MockGoogleCredential.Builder) super.setJsonFactory(jsonFactory); - } - - @Override - public Builder setClock(Clock clock) { - return (MockGoogleCredential.Builder) super.setClock(clock); - } - - @Override - public MockGoogleCredential build() { - if (getTransport() == null) { - setTransport(new MockHttpTransport.Builder().build()); - } - if (getClientAuthentication() == null) { - setClientAuthentication(new MockClientAuthentication()); - } - if (getJsonFactory() == null) { - setJsonFactory(new JacksonFactory()); - } - return new MockGoogleCredential(this); - } - } - - /** - * Returns a new {@link MockHttpTransport} with a sample {@link MockLowLevelHttpResponse}. The - * response includes sample TokenResponse content as specified in DEFAULT_TOKEN_RESPONSE_JSON. This - * is meant to produce a minimal implementation that allows methods such as - * {@link GoogleCredential#executeRefreshToken()} to be called without failing abruptly. This - * content is static. If you are making assertions based on the content of the request, then - * MockTokenServerTransport should be used instead. - * - * @return mockHttpTransport - */ - public static MockHttpTransport newMockHttpTransportWithSampleTokenResponse() { - MockLowLevelHttpResponse mockLowLevelHttpResponse = new MockLowLevelHttpResponse() - .setContentType(Json.MEDIA_TYPE) - .setContent(DEFAULT_TOKEN_RESPONSE_JSON); - MockLowLevelHttpRequest request = new MockLowLevelHttpRequest() - .setResponse(mockLowLevelHttpResponse); - return new MockHttpTransport.Builder() - .setLowLevelHttpRequest(request) - .build(); - } - - /** - * Mock for ClientAuthentication. - */ - @Beta - private static class MockClientAuthentication implements HttpExecuteInterceptor { - @Override - public void intercept(HttpRequest request) throws IOException { - // pass - } - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/auth/oauth2/MockTokenServerTransport.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/auth/oauth2/MockTokenServerTransport.java deleted file mode 100644 index d89649db..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/auth/oauth2/MockTokenServerTransport.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2014 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.testing.auth.oauth2; - -import com.google.api.client.googleapis.auth.oauth2.GoogleOAuthConstants; -import com.google.api.client.googleapis.testing.TestUtils; -import com.google.api.client.http.LowLevelHttpRequest; -import com.google.api.client.http.LowLevelHttpResponse; -import com.google.api.client.json.GenericJson; -import com.google.api.client.json.Json; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.json.webtoken.JsonWebSignature; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpRequest; -import com.google.api.client.testing.http.MockLowLevelHttpResponse; -import com.google.api.client.util.Beta; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * {@link Beta}
- * A test transport that simulates Google's token server for refresh tokens and service accounts. - * - * @since 1.19 - */ -@Beta -public class MockTokenServerTransport extends MockHttpTransport { - static final String EXPECTED_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:jwt-bearer"; - static final JsonFactory JSON_FACTORY = new JacksonFactory(); - Map serviceAccounts = new HashMap(); - Map clients = new HashMap(); - Map refreshTokens = new HashMap(); - - public MockTokenServerTransport() { - } - - public void addServiceAccount(String email, String accessToken) { - serviceAccounts.put(email, accessToken); - } - - public void addClient(String clientId, String clientSecret) { - clients.put(clientId, clientSecret); - } - - public void addRefreshToken(String refreshToken, String accessTokenToReturn) { - refreshTokens.put(refreshToken, accessTokenToReturn); - } - - @Override - public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { - if (url.equals(GoogleOAuthConstants.TOKEN_SERVER_URL)) { - MockLowLevelHttpRequest request = new MockLowLevelHttpRequest(url) { - @Override - public LowLevelHttpResponse execute() throws IOException { - String content = this.getContentAsString(); - Map query = TestUtils.parseQuery(content); - String accessToken = null; - - String foundId = query.get("client_id"); - if (foundId != null) { - if (!clients.containsKey(foundId)) { - throw new IOException("Client ID not found."); - } - String foundSecret = query.get("client_secret"); - String expectedSecret = clients.get(foundId); - if (foundSecret == null || !foundSecret.equals(expectedSecret)) { - throw new IOException("Client secret not found."); - } - String foundRefresh = query.get("refresh_token"); - if (!refreshTokens.containsKey(foundRefresh)) { - throw new IOException("Refresh Token not found."); - } - accessToken = refreshTokens.get(foundRefresh); - } else if (query.containsKey("grant_type")) { - String grantType = query.get("grant_type"); - if (!EXPECTED_GRANT_TYPE.equals(grantType)) { - throw new IOException("Unexpected Grant Type."); - } - String assertion = query.get("assertion"); - JsonWebSignature signature = JsonWebSignature.parse(JSON_FACTORY, assertion); - String foundEmail = signature.getPayload().getIssuer(); - if (!serviceAccounts.containsKey(foundEmail)) { - throw new IOException("Service Account Email not found as issuer."); - } - accessToken = serviceAccounts.get(foundEmail); - String foundScopes = (String) signature.getPayload().get("scope"); - if (foundScopes == null || foundScopes.length() == 0) { - throw new IOException("Scopes not found."); - } - } else { - throw new IOException("Uknown token type."); - } - - // Create the JSon response - GenericJson refreshContents = new GenericJson(); - refreshContents.setFactory(JSON_FACTORY); - refreshContents.put("access_token", accessToken); - refreshContents.put("expires_in", 3600000); - refreshContents.put("token_type", "Bearer"); - String refreshText = refreshContents.toPrettyString(); - - MockLowLevelHttpResponse response = new MockLowLevelHttpResponse() - .setContentType(Json.MEDIA_TYPE) - .setContent(refreshText); - return response; - } - }; - return request; - } - return super.buildRequest(method, url); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/auth/oauth2/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/auth/oauth2/package-info.java deleted file mode 100644 index ee154a4d..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/auth/oauth2/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Test utilities for the {@code com.google.api.client.googleapis.auth.oauth2} package. - * - * @since 1.19 - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.testing.auth.oauth2; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/compute/MockMetadataServerTransport.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/compute/MockMetadataServerTransport.java deleted file mode 100644 index ddfa4dcc..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/compute/MockMetadataServerTransport.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2014 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.testing.compute; - -import com.google.api.client.http.LowLevelHttpRequest; -import com.google.api.client.http.LowLevelHttpResponse; -import com.google.api.client.json.GenericJson; -import com.google.api.client.json.Json; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpRequest; -import com.google.api.client.testing.http.MockLowLevelHttpResponse; -import com.google.api.client.util.Beta; - -import java.io.IOException; - -/** - * {@link Beta}
- * Transport that simulates the GCE metadata server for access tokens. - * - * @since 1.19 - */ -@Beta -public class MockMetadataServerTransport extends MockHttpTransport { - - private static final String METADATA_TOKEN_SERVER_URL = - "http://metadata/computeMetadata/v1/instance/service-accounts/default/token"; - - private static final String METADATA_SERVER_URL = "http://metadata.google.internal"; - - - static final JsonFactory JSON_FACTORY = new JacksonFactory(); - - String accessToken; - - Integer tokenRequestStatusCode; - - public MockMetadataServerTransport(String accessToken) { - this.accessToken = accessToken; - } - - public void setTokenRequestStatusCode(Integer tokenRequestStatusCode) { - this.tokenRequestStatusCode = tokenRequestStatusCode; - } - - @Override - public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { - if (url.equals(METADATA_TOKEN_SERVER_URL)) { - - MockLowLevelHttpRequest request = new MockLowLevelHttpRequest(url) { - @Override - public LowLevelHttpResponse execute() throws IOException { - - if (tokenRequestStatusCode != null) { - MockLowLevelHttpResponse response = new MockLowLevelHttpResponse() - .setStatusCode(tokenRequestStatusCode) - .setContent("Token Fetch Error"); - return response; - } - - String metadataRequestHeader = getFirstHeaderValue("X-Google-Metadata-Request"); - if (!"true".equals(metadataRequestHeader)) { - throw new IOException("Metadata request header not found."); - } - - // Create the JSon response - GenericJson refreshContents = new GenericJson(); - refreshContents.setFactory(JSON_FACTORY); - refreshContents.put("access_token", accessToken); - refreshContents.put("expires_in", 3600000); - refreshContents.put("token_type", "Bearer"); - String refreshText = refreshContents.toPrettyString(); - - MockLowLevelHttpResponse response = new MockLowLevelHttpResponse() - .setContentType(Json.MEDIA_TYPE) - .setContent(refreshText); - return response; - - } - }; - return request; - } else if (url.equals(METADATA_SERVER_URL)) { - MockLowLevelHttpRequest request = new MockLowLevelHttpRequest(url) { - @Override - public LowLevelHttpResponse execute() { - MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); - response.addHeader("Metadata-Flavor", "Google"); - return response; - } - }; - return request; - } - return super.buildRequest(method, url); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/compute/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/compute/package-info.java deleted file mode 100644 index 1ce05ee8..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/compute/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Test utilities for the {@code com.google.api.client.googleapis.compute} package. - * - * @since 1.19 - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.testing.compute; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/json/GoogleJsonResponseExceptionFactoryTesting.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/json/GoogleJsonResponseExceptionFactoryTesting.java deleted file mode 100644 index dd8e019d..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/json/GoogleJsonResponseExceptionFactoryTesting.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.testing.json; - -import com.google.api.client.googleapis.json.GoogleJsonResponseException; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.testing.http.HttpTesting; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpResponse; -import com.google.api.client.util.Beta; - -import java.io.IOException; - -/** - * {@link Beta}
- * Factory class that builds {@link GoogleJsonResponseException} instances for - * testing. - * - * @since 1.18 - */ -@Beta -public final class GoogleJsonResponseExceptionFactoryTesting { - - /** - * Convenience factory method that builds a {@link GoogleJsonResponseException} - * from its arguments. The method builds a dummy {@link HttpRequest} and - * {@link HttpResponse}, sets the response's status to a user-specified HTTP - * error code, suppresses exceptions, and executes the request. This forces - * the underlying framework to create, but not throw, a - * {@link GoogleJsonResponseException}, which the method retrieves and returns - * to the invoker. - * - * @param jsonFactory the JSON factory that will create all JSON required - * by the underlying framework - * @param httpCode the desired HTTP error code. Note: do nut specify any codes - * that indicate successful completion, e.g. 2XX. - * @param reasonPhrase the HTTP reason code that explains the error. For example, - * if {@code httpCode} is {@code 404}, the reason phrase should be - * {@code NOT FOUND}. - * @return the generated {@link GoogleJsonResponseException}, as specified. - * @throws IOException if request transport fails. - */ - public static GoogleJsonResponseException newMock(JsonFactory jsonFactory, - int httpCode, String reasonPhrase) throws IOException { - MockLowLevelHttpResponse otherServiceUnavaiableLowLevelResponse = - new MockLowLevelHttpResponse() - .setStatusCode(httpCode) - .setReasonPhrase(reasonPhrase); - MockHttpTransport otherTransport = new MockHttpTransport.Builder() - .setLowLevelHttpResponse(otherServiceUnavaiableLowLevelResponse) - .build(); - HttpRequest otherRequest = otherTransport - .createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); - otherRequest.setThrowExceptionOnExecuteError(false); - HttpResponse otherServiceUnavailableResponse = otherRequest.execute(); - return GoogleJsonResponseException.from(jsonFactory, otherServiceUnavailableResponse); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/json/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/json/package-info.java deleted file mode 100644 index 6a04aba1..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/json/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Test utilities for the {@code com.google.api.client.googleapis.json} package. - * - * @since 1.18 - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.testing.json; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/notifications/MockUnparsedNotificationCallback.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/notifications/MockUnparsedNotificationCallback.java deleted file mode 100644 index 583afae4..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/notifications/MockUnparsedNotificationCallback.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.testing.notifications; - -import com.google.api.client.googleapis.notifications.StoredChannel; -import com.google.api.client.googleapis.notifications.UnparsedNotification; -import com.google.api.client.googleapis.notifications.UnparsedNotificationCallback; -import com.google.api.client.util.Beta; - -import java.io.IOException; - -/** - * {@link Beta}
- * Mock for the {@link UnparsedNotificationCallback} class. - * - * @author Yaniv Inbar - * @author Matthias Linder (mlinder) - * @since 1.16 - */ -@SuppressWarnings("rawtypes") -@Beta -public class MockUnparsedNotificationCallback implements UnparsedNotificationCallback { - - private static final long serialVersionUID = 0L; - - /** Whether this handler was called. */ - private boolean wasCalled; - - /** Returns whether this handler was called. */ - public boolean wasCalled() { - return wasCalled; - } - - public MockUnparsedNotificationCallback() { - } - - @SuppressWarnings("unused") - public void onNotification(StoredChannel storedChannel, UnparsedNotification notification) - throws IOException { - wasCalled = true; - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/notifications/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/notifications/package-info.java deleted file mode 100644 index 0f619e03..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/notifications/package-info.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Test utilities for the {@code com.google.api.client.googleapis.notifications} package. - * - * @author Yaniv Inbar - * @author Matthias Linder (mlinder) - * @since 1.16 - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.testing.notifications; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/package-info.java deleted file mode 100644 index d2abd68d..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Test utilities for the {@code com.google.api.client.googleapis} package. - * - * @since 1.19 - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.testing; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/MockGoogleClient.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/MockGoogleClient.java deleted file mode 100644 index 05587a32..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/MockGoogleClient.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.testing.services; - -import com.google.api.client.googleapis.services.AbstractGoogleClient; -import com.google.api.client.googleapis.services.GoogleClientRequestInitializer; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.util.Beta; -import com.google.api.client.util.ObjectParser; - -/** - * {@link Beta}
- * Thread-safe mock Google client. - * - * @since 1.12 - * @author Yaniv Inbar - */ -@Beta -public class MockGoogleClient extends AbstractGoogleClient { - - /** - * @param transport The transport to use for requests - * @param rootUrl root URL of the service. Must end with a "/" - * @param servicePath service path - * @param objectParser object parser or {@code null} for none - * @param httpRequestInitializer HTTP request initializer or {@code null} for none - * - * @since 1.14 - */ - public MockGoogleClient(HttpTransport transport, String rootUrl, String servicePath, - ObjectParser objectParser, HttpRequestInitializer httpRequestInitializer) { - this(new Builder(transport, rootUrl, servicePath, objectParser, httpRequestInitializer)); - } - - /** - * @param builder builder - * - * @since 1.14 - */ - protected MockGoogleClient(Builder builder) { - super(builder); - } - - /** - * Builder for {@link MockGoogleClient}. - * - *

- * Implementation is not thread-safe. - *

- */ - @Beta - public static class Builder extends AbstractGoogleClient.Builder { - - /** - * @param transport The transport to use for requests - * @param rootUrl root URL of the service. Must end with a "/" - * @param servicePath service path - * @param objectParser object parser or {@code null} for none - * @param httpRequestInitializer HTTP request initializer or {@code null} for none - */ - public Builder(HttpTransport transport, String rootUrl, String servicePath, - ObjectParser objectParser, HttpRequestInitializer httpRequestInitializer) { - super(transport, rootUrl, servicePath, objectParser, httpRequestInitializer); - } - - @Override - public MockGoogleClient build() { - return new MockGoogleClient(this); - } - - @Override - public Builder setRootUrl(String rootUrl) { - return (Builder) super.setRootUrl(rootUrl); - } - - @Override - public Builder setServicePath(String servicePath) { - return (Builder) super.setServicePath(servicePath); - } - - @Override - public Builder setGoogleClientRequestInitializer( - GoogleClientRequestInitializer googleClientRequestInitializer) { - return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer); - } - - @Override - public Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer) { - return (Builder) super.setHttpRequestInitializer(httpRequestInitializer); - } - - @Override - public Builder setApplicationName(String applicationName) { - return (Builder) super.setApplicationName(applicationName); - } - - @Override - public Builder setSuppressPatternChecks(boolean suppressPatternChecks) { - return (Builder) super.setSuppressPatternChecks(suppressPatternChecks); - } - - @Override - public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) { - return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks); - } - - @Override - public Builder setSuppressAllChecks(boolean suppressAllChecks) { - return (Builder) super.setSuppressAllChecks(suppressAllChecks); - } - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/MockGoogleClientRequest.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/MockGoogleClientRequest.java deleted file mode 100644 index c82e2f6f..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/MockGoogleClientRequest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.testing.services; - -import com.google.api.client.googleapis.services.AbstractGoogleClient; -import com.google.api.client.googleapis.services.AbstractGoogleClientRequest; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.UriTemplate; -import com.google.api.client.util.Beta; - -/** - * {@link Beta}
- * Thread-safe mock Google request. - * - * @param type of the response - * @since 1.12 - * @author Yaniv Inbar - */ -@Beta -public class MockGoogleClientRequest extends AbstractGoogleClientRequest { - - /** - * @param client Google client - * @param method HTTP Method - * @param uriTemplate URI template for the path relative to the base URL. If it starts with a "/" - * the base path from the base URL will be stripped out. The URI template can also be a - * full URL. URI template expansion is done using - * {@link UriTemplate#expand(String, String, Object, boolean)} - * @param content HTTP content or {@code null} for none - * @param responseClass response class to parse into - */ - public MockGoogleClientRequest(AbstractGoogleClient client, String method, String uriTemplate, - HttpContent content, Class responseClass) { - super(client, method, uriTemplate, content, responseClass); - } - - @Override - public MockGoogleClientRequest setDisableGZipContent(boolean disableGZipContent) { - return (MockGoogleClientRequest) super.setDisableGZipContent(disableGZipContent); - } - - @Override - public MockGoogleClientRequest setRequestHeaders(HttpHeaders headers) { - return (MockGoogleClientRequest) super.setRequestHeaders(headers); - } - - @Override - public MockGoogleClientRequest set(String fieldName, Object value) { - return (MockGoogleClientRequest) super.set(fieldName, value); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/json/MockGoogleJsonClient.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/json/MockGoogleJsonClient.java deleted file mode 100644 index 20a36abf..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/json/MockGoogleJsonClient.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.testing.services.json; - -import com.google.api.client.googleapis.services.GoogleClientRequestInitializer; -import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.util.Beta; - -/** - * {@link Beta}
- * Thread-safe mock Google JSON client. - * - * @since 1.12 - * @author Yaniv Inbar - */ -@Beta -public class MockGoogleJsonClient extends AbstractGoogleJsonClient { - - /** - * @param builder builder - * - * @since 1.14 - */ - protected MockGoogleJsonClient(Builder builder) { - super(builder); - } - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - * @param rootUrl root URL of the service - * @param servicePath service path - * @param httpRequestInitializer HTTP request initializer or {@code null} for none - * @param legacyDataWrapper whether using the legacy data wrapper in responses - */ - public MockGoogleJsonClient(HttpTransport transport, JsonFactory jsonFactory, String rootUrl, - String servicePath, HttpRequestInitializer httpRequestInitializer, - boolean legacyDataWrapper) { - this(new Builder( - transport, jsonFactory, rootUrl, servicePath, httpRequestInitializer, legacyDataWrapper)); - } - - /** - * {@link Beta}
- * Builder for {@link MockGoogleJsonClient}. - * - *

- * Implementation is not thread-safe. - *

- */ - @Beta - public static class Builder extends AbstractGoogleJsonClient.Builder { - - /** - * @param transport HTTP transport - * @param jsonFactory JSON factory - * @param rootUrl root URL of the service - * @param servicePath service path - * @param httpRequestInitializer HTTP request initializer or {@code null} for none - * @param legacyDataWrapper whether using the legacy data wrapper in responses - */ - public Builder(HttpTransport transport, JsonFactory jsonFactory, String rootUrl, - String servicePath, HttpRequestInitializer httpRequestInitializer, - boolean legacyDataWrapper) { - super( - transport, jsonFactory, rootUrl, servicePath, httpRequestInitializer, legacyDataWrapper); - } - - @Override - public MockGoogleJsonClient build() { - return new MockGoogleJsonClient(this); - } - - @Override - public Builder setRootUrl(String rootUrl) { - return (Builder) super.setRootUrl(rootUrl); - } - - @Override - public Builder setServicePath(String servicePath) { - return (Builder) super.setServicePath(servicePath); - } - - @Override - public Builder setGoogleClientRequestInitializer( - GoogleClientRequestInitializer googleClientRequestInitializer) { - return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer); - } - - @Override - public Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer) { - return (Builder) super.setHttpRequestInitializer(httpRequestInitializer); - } - - @Override - public Builder setApplicationName(String applicationName) { - return (Builder) super.setApplicationName(applicationName); - } - - @Override - public Builder setSuppressPatternChecks(boolean suppressPatternChecks) { - return (Builder) super.setSuppressPatternChecks(suppressPatternChecks); - } - - @Override - public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) { - return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks); - } - - @Override - public Builder setSuppressAllChecks(boolean suppressAllChecks) { - return (Builder) super.setSuppressAllChecks(suppressAllChecks); - } - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/json/MockGoogleJsonClientRequest.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/json/MockGoogleJsonClientRequest.java deleted file mode 100644 index a98e47fc..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/json/MockGoogleJsonClientRequest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.testing.services.json; - -import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient; -import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.UriTemplate; -import com.google.api.client.util.Beta; - -/** - * {@link Beta}
- * Thread-safe mock Google JSON request. - * - * @param type of the response - * @since 1.12 - * @author Yaniv Inbar - */ -@Beta -public class MockGoogleJsonClientRequest extends AbstractGoogleJsonClientRequest { - - /** - * @param client Google client - * @param method HTTP Method - * @param uriTemplate URI template for the path relative to the base URL. If it starts with a "/" - * the base path from the base URL will be stripped out. The URI template can also be a - * full URL. URI template expansion is done using - * {@link UriTemplate#expand(String, String, Object, boolean)} - * @param content A POJO that can be serialized into JSON or {@code null} for none - */ - public MockGoogleJsonClientRequest(AbstractGoogleJsonClient client, String method, - String uriTemplate, Object content, Class responseClass) { - super(client, method, uriTemplate, content, responseClass); - } - - @Override - public MockGoogleJsonClient getAbstractGoogleClient() { - return (MockGoogleJsonClient) super.getAbstractGoogleClient(); - } - - @Override - public MockGoogleJsonClientRequest setDisableGZipContent(boolean disableGZipContent) { - return (MockGoogleJsonClientRequest) super.setDisableGZipContent(disableGZipContent); - } - - @Override - public MockGoogleJsonClientRequest setRequestHeaders(HttpHeaders headers) { - return (MockGoogleJsonClientRequest) super.setRequestHeaders(headers); - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/json/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/json/package-info.java deleted file mode 100644 index fff5fc5e..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/json/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Test utilities for the {@code com.google.api.client.googleapis.services.json} package. - * - * @since 1.12 - * @author Yaniv Inbar - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.testing.services.json; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/package-info.java deleted file mode 100644 index fd5c8a01..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/testing/services/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * {@link com.google.api.client.util.Beta}
- * Test utilities for the {@code com.google.api.client.googleapis.services} package. - * - * @since 1.12 - * @author Yaniv Inbar - */ -@com.google.api.client.util.Beta -package com.google.api.client.googleapis.testing.services; - diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/util/Utils.java b/google-api-client/src/main/java/com/google/api/client/googleapis/util/Utils.java deleted file mode 100644 index 8294c0e3..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/util/Utils.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.util; - -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.javanet.NetHttpTransport; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.util.Beta; - -/** - * {@link Beta}
- * Utility class for the Google API Client Library. - * - * @since 1.19 - */ -@Beta -public final class Utils { - - /** - * Returns a cached default implementation of the JsonFactory interface. - */ - public static JsonFactory getDefaultJsonFactory() { - return JsonFactoryInstanceHolder.INSTANCE; - } - - private static class JsonFactoryInstanceHolder { - // The jackson2.JacksonFactory was introduced as a product dependency in 1.19 to enable - // other APIs to not require one of these for input. This was the most commonly used - // implementation in public samples. This is a compile-time dependency to help detect the - // dependency as early as possible. - static final JsonFactory INSTANCE = new JacksonFactory(); - } - - /** - * Returns a cached default implementation of the HttpTransport interface. - */ - public static HttpTransport getDefaultTransport() { - return TransportInstanceHolder.INSTANCE; - } - - private static class TransportInstanceHolder { - static final HttpTransport INSTANCE = new NetHttpTransport(); - } - - private Utils() { - } -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/util/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/util/package-info.java deleted file mode 100644 index 0269964d..00000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/util/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Utilities for the Google API Client Library. - * - * @since 1.19 - */ -package com.google.api.client.googleapis.util; - diff --git a/google-api-client/src/main/resources/com/google/api/client/googleapis/google.jks b/google-api-client/src/main/resources/com/google/api/client/googleapis/google.jks deleted file mode 100644 index 8fa9bc45..00000000 Binary files a/google-api-client/src/main/resources/com/google/api/client/googleapis/google.jks and /dev/null differ diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/GoogleUtilsTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/GoogleUtilsTest.java deleted file mode 100644 index ba894ff0..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/GoogleUtilsTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis; - -import junit.framework.TestCase; - -import java.security.KeyStore; -import java.util.Enumeration; - -/** - * Tests {@link GoogleUtils}. - * - * @author Yaniv Inbar - */ -public class GoogleUtilsTest extends TestCase { - - public void testGetCertificateTrustStore() throws Exception { - KeyStore trustStore = GoogleUtils.getCertificateTrustStore(); - Enumeration aliases = trustStore.aliases(); - while (aliases.hasMoreElements()) { - String alias = aliases.nextElement(); - assertTrue(trustStore.isCertificateEntry(alias)); - } - // intentionally check the count of certificates, so it can help us detect if a new certificate - // has been added or removed - assertEquals(70, trustStore.size()); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/MethodOverrideTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/MethodOverrideTest.java deleted file mode 100644 index 2e4f272c..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/MethodOverrideTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis; - -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpMethods; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.UrlEncodedContent; -import com.google.api.client.testing.http.HttpTesting; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; - -import junit.framework.TestCase; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -/** - * Tests {@link MethodOverride}. - * - * @author Yaniv Inbar - */ -public class MethodOverrideTest extends TestCase { - - private static final List OVERRIDDEN_METHODS = ImmutableList.of( - "FOO", HttpMethods.DELETE, HttpMethods.HEAD, HttpMethods.OPTIONS, HttpMethods.PATCH, - HttpMethods.PUT, HttpMethods.TRACE); - - private static final List SUPPORTED_METHODS = ImmutableList.builder() - .addAll(OVERRIDDEN_METHODS).add(HttpMethods.GET, HttpMethods.POST).build(); - - public MethodOverrideTest(String name) { - super(name); - } - - public void testIntercept() throws Exception { - subtestIntercept(ImmutableSet.of(), new MockHttpTransport(), new MethodOverride()); - subtestIntercept(OVERRIDDEN_METHODS, new MockHttpTransport(), - new MethodOverride.Builder().setOverrideAllMethods(true).build()); - subtestIntercept(OVERRIDDEN_METHODS, new MockHttpTransport.Builder() - .setSupportedMethods(ImmutableSet.of(HttpMethods.GET, HttpMethods.POST)).build(), - new MethodOverride()); - } - - private void subtestIntercept(Collection methodsThatShouldOverride, - HttpTransport transport, MethodOverride interceptor) throws Exception { - for (String requestMethod : SUPPORTED_METHODS) { - subtestIntercept( - methodsThatShouldOverride.contains(requestMethod), transport, interceptor, requestMethod); - } - } - - private void subtestIntercept(boolean shouldOverride, HttpTransport transport, - MethodOverride interceptor, String requestMethod) throws Exception { - HttpRequest request = transport.createRequestFactory() - .buildRequest(requestMethod, HttpTesting.SIMPLE_GENERIC_URL, null); - interceptor.intercept(request); - assertEquals(requestMethod, shouldOverride ? HttpMethods.POST : requestMethod, - request.getRequestMethod()); - assertEquals(requestMethod, shouldOverride ? requestMethod : null, - request.getHeaders().get(MethodOverride.HEADER)); - } - - public void testInterceptMaxLength() throws IOException { - HttpTransport transport = new MockHttpTransport(); - GenericUrl url = new GenericUrl(HttpTesting.SIMPLE_URL); - url.set("a", "foo"); - HttpRequest request = - transport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); - new MethodOverride().intercept(request); - assertEquals(HttpMethods.GET, request.getRequestMethod()); - assertNull(request.getHeaders().get(MethodOverride.HEADER)); - assertNull(request.getContent()); - char[] arr = new char[MethodOverride.MAX_URL_LENGTH]; - Arrays.fill(arr, 'x'); - url.set("a", new String(arr)); - request.setUrl(url); - new MethodOverride().intercept(request); - assertEquals(HttpMethods.POST, request.getRequestMethod()); - assertEquals(HttpMethods.GET, request.getHeaders().get(MethodOverride.HEADER)); - assertEquals(HttpTesting.SIMPLE_GENERIC_URL, request.getUrl()); - char[] arr2 = new char[arr.length + 2]; - Arrays.fill(arr2, 'x'); - arr2[0] = 'a'; - arr2[1] = '='; - UrlEncodedContent content = (UrlEncodedContent) request.getContent(); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - content.writeTo(out); - assertEquals(new String(arr2), out.toString()); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/DefaultCredentialProviderTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/DefaultCredentialProviderTest.java deleted file mode 100644 index c7e1dd49..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/DefaultCredentialProviderTest.java +++ /dev/null @@ -1,606 +0,0 @@ -/* - * Copyright (c) 2014 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.googleapis.testing.auth.oauth2.MockTokenServerTransport; -import com.google.api.client.googleapis.testing.compute.MockMetadataServerTransport; -import com.google.api.client.http.HttpStatusCodes; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.LowLevelHttpRequest; -import com.google.api.client.http.LowLevelHttpResponse; -import com.google.api.client.json.GenericJson; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpRequest; - -import junit.framework.TestCase; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; - -/** - * Tests {@link DefaultCredentialProvider}. - * - */ -public class DefaultCredentialProviderTest extends TestCase { - - private static final JsonFactory JSON_FACTORY = new JacksonFactory(); - - private static final Collection SCOPES = - Collections.unmodifiableCollection(Arrays.asList("scope1", "scope2")); - - private static final String SA_KEY_ID = "key_id"; - private static final String SA_KEY_TEXT = "-----BEGIN PRIVATE KEY-----\n" - + "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALX0PQoe1igW12i" - + "kv1bN/r9lN749y2ijmbc/mFHPyS3hNTyOCjDvBbXYbDhQJzWVUikh4mvGBA07qTj79Xc3yBDfKP2IeyYQIFe0t0" - + "zkd7R9Zdn98Y2rIQC47aAbDfubtkU1U72t4zL11kHvoa0/RuFZjncvlr42X7be7lYh4p3NAgMBAAECgYASk5wDw" - + "4Az2ZkmeuN6Fk/y9H+Lcb2pskJIXjrL533vrDWGOC48LrsThMQPv8cxBky8HFSEklPpkfTF95tpD43iVwJRB/Gr" - + "CtGTw65IfJ4/tI09h6zGc4yqvIo1cHX/LQ+SxKLGyir/dQM925rGt/VojxY5ryJR7GLbCzxPnJm/oQJBANwOCO6" - + "D2hy1LQYJhXh7O+RLtA/tSnT1xyMQsGT+uUCMiKS2bSKx2wxo9k7h3OegNJIu1q6nZ6AbxDK8H3+d0dUCQQDTrP" - + "SXagBxzp8PecbaCHjzNRSQE2in81qYnrAFNB4o3DpHyMMY6s5ALLeHKscEWnqP8Ur6X4PvzZecCWU9BKAZAkAut" - + "LPknAuxSCsUOvUfS1i87ex77Ot+w6POp34pEX+UWb+u5iFn2cQacDTHLV1LtE80L8jVLSbrbrlH43H0DjU5AkEA" - + "gidhycxS86dxpEljnOMCw8CKoUBd5I880IUahEiUltk7OLJYS/Ts1wbn3kPOVX3wyJs8WBDtBkFrDHW2ezth2QJ" - + "ADj3e1YhMVdjJW5jqwlD/VNddGjgzyunmiZg0uOXsHXbytYmsA545S8KRQFaJKFXYYFo2kOjqOiC1T2cAzMDjCQ" - + "==\n-----END PRIVATE KEY-----\n"; - private static final String ACCESS_TOKEN = "1/MkSJoj1xsli0AccessToken_NKPY2"; - - private static final String GAE_SIGNAL_CLASS = "com.google.appengine.api.utils.SystemProperty"; - - private static final Lock lock = new ReentrantLock(); - - private static File tempDirectory = null; - - public void testDefaultCredentialAppEngineDeployed() throws IOException { - HttpTransport transport = new MockHttpTransport(); - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - testProvider.addType(DefaultCredentialProvider.APP_ENGINE_CREDENTIAL_CLASS, - MockAppEngineCredential.class); - testProvider.addType(GAE_SIGNAL_CLASS, MockAppEngineSystemProperty.class); - - Credential defaultCredential = testProvider.getDefaultCredential(transport, JSON_FACTORY); - - assertNotNull(defaultCredential); - assertTrue(defaultCredential instanceof MockAppEngineCredential); - assertSame(transport, defaultCredential.getTransport()); - assertSame(JSON_FACTORY, defaultCredential.getJsonFactory()); - } - - public void testDefaultCredentialAppEngineComponentOffAppEngineGivesNotFoundError() { - HttpTransport transport = new MockHttpTransport(); - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - testProvider.addType(DefaultCredentialProvider.APP_ENGINE_CREDENTIAL_CLASS, - MockAppEngineCredential.class); - testProvider.addType(GAE_SIGNAL_CLASS, MockOffAppEngineSystemProperty.class); - - try { - testProvider.getDefaultCredential(transport, JSON_FACTORY); - fail("No credential expected when not on App Engine."); - } catch (IOException e) { - String message = e.getMessage(); - assertTrue(message.contains(DefaultCredentialProvider.HELP_PERMALINK)); - } - } - - public void testDefaultCredentialAppEngineWithoutDependencyThrowsHelpfulLoadError() { - HttpTransport transport = new MockHttpTransport(); - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - testProvider.addType(GAE_SIGNAL_CLASS, MockAppEngineSystemProperty.class); - - try { - testProvider.getDefaultCredential(transport, JSON_FACTORY); - fail("Credential expected to fail to load if credential class not present."); - } catch (IOException e) { - String message = e.getMessage(); - assertFalse(message.contains(DefaultCredentialProvider.HELP_PERMALINK)); - assertTrue(message.contains(DefaultCredentialProvider.APP_ENGINE_CREDENTIAL_CLASS)); - } - } - - public void testDefaultCredentialAppEngineSingleClassLoadAttempt() { - HttpTransport transport = new MockHttpTransport(); - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - try { - testProvider.getDefaultCredential(transport, JSON_FACTORY); - fail("No credential expected for default test provider."); - } catch (IOException expected) { - } - assertEquals(1, testProvider.getForNameCallCount()); - // Try a second time. - try { - testProvider.getDefaultCredential(transport, JSON_FACTORY); - fail("No credential expected for default test provider."); - } catch (IOException expected) { - } - assertEquals(1, testProvider.getForNameCallCount()); - } - - public void testDefaultCredentialCaches() throws IOException { - HttpTransport transport = new MockHttpTransport(); - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - testProvider.addType(DefaultCredentialProvider.APP_ENGINE_CREDENTIAL_CLASS, - MockAppEngineCredential.class); - testProvider.addType(GAE_SIGNAL_CLASS, MockAppEngineSystemProperty.class); - - Credential firstCall = testProvider.getDefaultCredential(transport, JSON_FACTORY); - - assertNotNull(firstCall); - - Credential secondCall = testProvider.getDefaultCredential(transport, JSON_FACTORY); - - assertSame(firstCall, secondCall); - } - - public void testDefaultCredentialCompute() throws IOException { - HttpTransport transport = new MockMetadataServerTransport(ACCESS_TOKEN); - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - - Credential defaultCredential = testProvider.getDefaultCredential(transport, JSON_FACTORY); - assertNotNull(defaultCredential); - - assertTrue(defaultCredential.refreshToken()); - assertEquals(ACCESS_TOKEN, defaultCredential.getAccessToken()); - } - - public void testDefaultCredentialComputeErrorNotFound() throws IOException { - MockMetadataServerTransport transport = new MockMetadataServerTransport(ACCESS_TOKEN); - transport.setTokenRequestStatusCode(HttpStatusCodes.STATUS_CODE_NOT_FOUND); - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - - Credential defaultCredential = testProvider.getDefaultCredential(transport, JSON_FACTORY); - assertNotNull(defaultCredential); - - try { - defaultCredential.refreshToken(); - fail("Expected error refreshing token."); - } catch (IOException expected) { - String message = expected.getMessage(); - assertTrue(message.contains(Integer.toString(HttpStatusCodes.STATUS_CODE_NOT_FOUND))); - assertTrue(message.contains("scope")); - } - } - - public void testDefaultCredentialComputeErrorUnexpected() throws IOException { - MockMetadataServerTransport transport = new MockMetadataServerTransport(ACCESS_TOKEN); - transport.setTokenRequestStatusCode(HttpStatusCodes.STATUS_CODE_SERVER_ERROR); - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - - Credential defaultCredential = testProvider.getDefaultCredential(transport, JSON_FACTORY); - assertNotNull(defaultCredential); - - try { - defaultCredential.refreshToken(); - fail("Expected error refreshing token."); - } catch (IOException expected) { - String message = expected.getMessage(); - assertTrue(message.contains(Integer.toString(HttpStatusCodes.STATUS_CODE_SERVER_ERROR))); - assertTrue(message.contains("Unexpected")); - } - } - - public void testDefaultCredentialComputeSingleAttempt() { - MockRequestCountingTransport transport = new MockRequestCountingTransport(); - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - - try { - testProvider.getDefaultCredential(transport, JSON_FACTORY); - fail("No credential expected for default test provider."); - } catch (IOException expected) { - } - assertEquals(1, transport.getRequestCount()); - try { - testProvider.getDefaultCredential(transport, JSON_FACTORY); - fail("No credential expected for default test provider."); - } catch (IOException expected) { - } - assertEquals(1, transport.getRequestCount()); - } - - public void testDefaultCredentialNonExistentFileThrows() throws Exception { - File nonExistentFile = new java.io.File(getTempDirectory(), "DefaultCredentialBadFile.json"); - assertFalse(nonExistentFile.exists()); - - HttpTransport transport = new MockHttpTransport(); - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - testProvider.setEnv(DefaultCredentialProvider.CREDENTIAL_ENV_VAR, - nonExistentFile.getAbsolutePath()); - try { - testProvider.getDefaultCredential(transport, JSON_FACTORY); - fail("Non existent user credential should throw exception."); - } catch (IOException e) { - String message = e.getMessage(); - assertTrue(message.contains(DefaultCredentialProvider.CREDENTIAL_ENV_VAR)); - assertTrue(message.contains(nonExistentFile.getAbsolutePath())); - } - } - - public void testDefaultCredentialNotFoundError() { - HttpTransport transport = new MockHttpTransport(); - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - - try { - testProvider.getDefaultCredential(transport, JSON_FACTORY); - fail(); - } catch (IOException e) { - String message = e.getMessage(); - assertTrue(message.contains(DefaultCredentialProvider.HELP_PERMALINK)); - } - } - - public void testDefaultCredentialServiceAccount() throws IOException { - File serviceAccountFile = new java.io.File(getTempDirectory(), - "DefaultCredentialServiceAccount.json"); - if (serviceAccountFile.exists()) { - serviceAccountFile.delete(); - } - final String serviceAccountId = - "36680232662-vrd7ji19qe3nelgchd0ah2csanun6bnr.apps.googleusercontent.com"; - final String serviceAccountEmail = - "36680232662-vrd7ji19qe3nelgchdcsanun6bnr@developer.gserviceaccount.com"; - - MockTokenServerTransport transport = new MockTokenServerTransport(); - transport.addServiceAccount(serviceAccountEmail, ACCESS_TOKEN); - - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - try { - // Write out service account file - GenericJson serviceAccountContents = new GenericJson(); - serviceAccountContents.setFactory(JSON_FACTORY); - serviceAccountContents.put("client_id", serviceAccountId); - serviceAccountContents.put("client_email", serviceAccountEmail); - serviceAccountContents.put("private_key", SA_KEY_TEXT); - serviceAccountContents.put("private_key_id", SA_KEY_ID); - serviceAccountContents.put("type", GoogleCredential.SERVICE_ACCOUNT_FILE_TYPE); - PrintWriter writer = new PrintWriter(serviceAccountFile); - String json = serviceAccountContents.toPrettyString(); - writer.println(json); - writer.close(); - - // Point the default credential to the file - testProvider.setEnv(DefaultCredentialProvider.CREDENTIAL_ENV_VAR, - serviceAccountFile.getAbsolutePath()); - - GoogleCredential credential = testProvider.getDefaultCredential(transport, JSON_FACTORY); - assertNotNull(credential); - credential = credential.createScoped(SCOPES); - - assertTrue(credential.refreshToken()); - assertEquals(ACCESS_TOKEN, credential.getAccessToken()); - } finally { - if (serviceAccountFile.exists()) { - serviceAccountFile.delete(); - } - } - } - - public void testDefaultCredentialUser() throws IOException { - File userCredentialFile = new java.io.File(getTempDirectory(), "DefaultCredentialUser.json"); - if (userCredentialFile.exists()) { - userCredentialFile.delete(); - } - - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - // Point the default credential to the file - testProvider.setEnv(DefaultCredentialProvider.CREDENTIAL_ENV_VAR, - userCredentialFile.getAbsolutePath()); - - testDefaultCredentialUser(userCredentialFile, testProvider); - } - - public void testDefaultCredentialWellKnownFileNonWindows() throws IOException { - // Simulate where the SDK puts the well-known file on non-Windows platforms - File homeDir = getTempDirectory(); - File configDir = new File(homeDir, ".config"); - if (!configDir.exists()) { - configDir.mkdir(); - } - File cloudConfigDir = new File(configDir, DefaultCredentialProvider.CLOUDSDK_CONFIG_DIRECTORY); - if (!cloudConfigDir.exists()) { - cloudConfigDir.mkdir(); - } - File wellKnownFile = new File( - cloudConfigDir, DefaultCredentialProvider.WELL_KNOWN_CREDENTIALS_FILE); - if (wellKnownFile.exists()) { - wellKnownFile.delete(); - } - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - testProvider.addFile(wellKnownFile.getAbsolutePath()); - testProvider.setProperty("os.name", "linux"); - testProvider.setProperty("user.home", homeDir.getAbsolutePath()); - - testDefaultCredentialUser(wellKnownFile, testProvider); - } - - public void testDefaultCredentialWellKnownFileWindows() throws IOException { - // Simulate where the SDK puts the well-known file on Windows - File appDataDir = getTempDirectory(); - File cloudConfigDir = new File(appDataDir, DefaultCredentialProvider.CLOUDSDK_CONFIG_DIRECTORY); - if (!cloudConfigDir.exists()) { - cloudConfigDir.mkdir(); - } - File wellKnownFile = new File( - cloudConfigDir, DefaultCredentialProvider.WELL_KNOWN_CREDENTIALS_FILE); - if (wellKnownFile.exists()) { - wellKnownFile.delete(); - } - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - testProvider.addFile(wellKnownFile.getAbsolutePath()); - testProvider.setProperty("os.name", "windows"); - testProvider.setEnv("APPDATA", appDataDir.getAbsolutePath()); - - testDefaultCredentialUser(wellKnownFile, testProvider); - } - - public void testDefaultCredentialEnvironmentVariableWinsOverWellKnownFile() throws IOException { - final String clientSecret = "jakuaL9YyieakhECKL2SwZcu"; - final String clientId = "ya29.1.AADtN_UtlxH8cruGAxrN2XQnZTVRvDyVWnYq4I6dws"; - final String refreshTokenEnv = "2/Tl6awhpFjkMkSJoj1xsli0H2eL5YsMgU_NKPY2TyGWY"; - final String accessTokenEnv = "2/MkSJoj1xsli0AccessToken_NKPY2"; - final String refreshTokenWkf = "3/Tl6awhpFjkMkSJoj1xsli0H2eL5YsMgU_NKPY2TyGWY"; - final String accessTokenWkf = "3/MkSJoj1xsli0AccessToken_NKPY2"; - - TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider(); - - // Set up an environment variable file - File environmentVariableFile = new java.io.File(getTempDirectory(), "EnvVarUser.json"); - if (environmentVariableFile.exists()) { - environmentVariableFile.delete(); - } - testProvider.setEnv(DefaultCredentialProvider.CREDENTIAL_ENV_VAR, - environmentVariableFile.getAbsolutePath()); - - // Also set up a well-known-location file - File homeDir = getTempDirectory(); - File configDir = new File(homeDir, ".config"); - if (!configDir.exists()) { - configDir.mkdir(); - } - File cloudConfigDir = new File(configDir, DefaultCredentialProvider.CLOUDSDK_CONFIG_DIRECTORY); - if (!cloudConfigDir.exists()) { - cloudConfigDir.mkdir(); - } - File wellKnownFile = new File( - cloudConfigDir, DefaultCredentialProvider.WELL_KNOWN_CREDENTIALS_FILE); - if (wellKnownFile.exists()) { - wellKnownFile.delete(); - } - testProvider.addFile(wellKnownFile.getAbsolutePath()); - testProvider.setProperty("os.name", "linux"); - testProvider.setProperty("user.home", homeDir.getAbsolutePath()); - - // Define a transport that can simulate refreshing tokens - MockTokenServerTransport transport = new MockTokenServerTransport(); - transport.addClient(clientId, clientSecret); - transport.addRefreshToken(refreshTokenEnv, accessTokenEnv); - transport.addRefreshToken(refreshTokenWkf, accessTokenWkf); - - String jsonEnv = GoogleCredentialTest.createUserJson(clientId, clientSecret, refreshTokenEnv); - String jsonWkf = GoogleCredentialTest.createUserJson(clientId, clientSecret, refreshTokenWkf); - - try { - // Write out user files - PrintWriter writer = new PrintWriter(environmentVariableFile); - writer.println(jsonEnv); - writer.close(); - writer = new PrintWriter(wellKnownFile); - writer.println(jsonWkf); - writer.close(); - - Credential credential = testProvider.getDefaultCredential(transport, JSON_FACTORY); - - assertNotNull(credential); - assertEquals(refreshTokenEnv, credential.getRefreshToken()); - assertTrue(credential.refreshToken()); - assertEquals(accessTokenEnv, credential.getAccessToken()); - } finally { - if (wellKnownFile.exists()) { - wellKnownFile.delete(); - } - if (environmentVariableFile.exists()) { - environmentVariableFile.delete(); - } - } - } - - private void testDefaultCredentialUser(File userFile, TestDefaultCredentialProvider testProvider) - throws IOException { - final String clientSecret = "jakuaL9YyieakhECKL2SwZcu"; - final String clientId = "ya29.1.AADtN_UtlxH8cruGAxrN2XQnZTVRvDyVWnYq4I6dws"; - final String refreshToken = "1/Tl6awhpFjkMkSJoj1xsli0H2eL5YsMgU_NKPY2TyGWY"; - - // Define a transport that can simulate refreshing tokens - MockTokenServerTransport transport = new MockTokenServerTransport(); - transport.addClient(clientId, clientSecret); - transport.addRefreshToken(refreshToken, ACCESS_TOKEN); - - String json = GoogleCredentialTest.createUserJson(clientId, clientSecret, refreshToken); - - try { - // Write out user file - PrintWriter writer = new PrintWriter(userFile); - writer.println(json); - writer.close(); - - Credential credential = testProvider.getDefaultCredential(transport, JSON_FACTORY); - - assertNotNull(credential); - assertEquals(refreshToken, credential.getRefreshToken()); - - assertTrue(credential.refreshToken()); - assertEquals(ACCESS_TOKEN, credential.getAccessToken()); - } finally { - if (userFile.exists()) { - userFile.delete(); - } - } - } - - private static File getTempDirectory() { - lock.lock(); - try { - if (tempDirectory == null) { - String userHome = System.getProperty("user.home"); - File temp = new java.io.File(userHome, ".temptest"); - if (!temp.exists()) { - temp.mkdir(); - } else if (!temp.isDirectory()) { - fail("Temp directory is a file!"); - } - tempDirectory = temp; - } - } finally { - lock.unlock(); - } - return tempDirectory; - } - - public static class MockAppEngineCredential extends GoogleCredential { - public MockAppEngineCredential(HttpTransport transport, JsonFactory jsonFactory) { - super(new GoogleCredential.Builder().setTransport(transport).setJsonFactory(jsonFactory)); - } - } - - /* - * App Engine is detected by calling SystemProperty.environment.value() via Reflection. - * The following mock types simulate the shape and behavior of that call sequence. - */ - - private static class MockAppEngineSystemProperty { - - @SuppressWarnings("unused") - public static final MockEnvironment environment = - new MockEnvironment(MockEnvironmentEnum.Production); - } - - private static class MockOffAppEngineSystemProperty { - - @SuppressWarnings("unused") - public static final MockEnvironment environment = new MockEnvironment(null); - } - - private enum MockEnvironmentEnum { - Production, - Development; - } - - public static class MockEnvironment { - - private MockEnvironmentEnum innerValue; - - MockEnvironment(MockEnvironmentEnum value) { - this.innerValue = value; - } - - public MockEnvironmentEnum value() { - return innerValue; - } - } - - /* - * End of types simulating SystemProperty.environment.value() - */ - - private static class MockRequestCountingTransport extends MockHttpTransport { - int requestCount = 0; - - MockRequestCountingTransport() { - } - - int getRequestCount() { - return requestCount; - } - - @Override - public LowLevelHttpRequest buildRequest(String method, String url) { - MockLowLevelHttpRequest request = new MockLowLevelHttpRequest(url) { - @Override - public LowLevelHttpResponse execute() throws IOException { - requestCount++; - throw new IOException("MockRequestCountingTransport request failed."); - } - }; - return request; - } - } - - private static class TestDefaultCredentialProvider extends DefaultCredentialProvider { - - private Map> types = new HashMap>(); - private Map variables = new HashMap(); - private Map properties = new HashMap(); - private Set files = new HashSet(); - private int forNameCallCount = 0; - - TestDefaultCredentialProvider() { - } - - void addFile(String file) { - files.add(file); - } - - void addType(String className, Class type) { - types.put(className, type); - } - - @Override - String getEnv(String name) { - return variables.get(name); - } - - void setEnv(String name, String value) { - variables.put(name, value); - } - - @Override - String getProperty(String property, String def) { - String value = properties.get(property); - return value == null ? def : value; - } - - void setProperty(String property, String value) { - properties.put(property, value); - } - - @Override - boolean fileExists(File file) { - return files.contains(file.getAbsolutePath()); - } - - @Override - Class forName(String className) throws ClassNotFoundException { - forNameCallCount++; - Class lookup = types.get(className); - if (lookup != null) { - return lookup; - } - throw new ClassNotFoundException("TestDefaultCredentialProvider: Class not found."); - } - - int getForNameCallCount() { - return forNameCallCount; - } - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlowTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlowTest.java deleted file mode 100644 index 76283a3c..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlowTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.common.collect.ImmutableList; - -import junit.framework.TestCase; - -/** - * Tests {@link GoogleAuthorizationCodeFlow}. - * - * @author Yaniv Inbar - */ -public class GoogleAuthorizationCodeFlowTest extends TestCase { - - private static final String CLIENT_ID = "812741506391.apps.googleusercontent.com"; - private static final String CLIENT_SECRET = "{client_secret}"; - - public void testBuilder() { - GoogleAuthorizationCodeFlow.Builder builder = new GoogleAuthorizationCodeFlow.Builder( - new MockHttpTransport(), new JacksonFactory(), CLIENT_ID, CLIENT_SECRET, - ImmutableList.of("https://www.googleapis.com/auth/userinfo.email")); - assertNull(builder.getApprovalPrompt()); - assertNull(builder.getAccessType()); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeRequestUrlTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeRequestUrlTest.java deleted file mode 100644 index 01cecf3f..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeRequestUrlTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import junit.framework.TestCase; - -import java.util.Arrays; - -/** - * Tests {@link GoogleAuthorizationCodeRequestUrl}. - * - * @author Yaniv Inbar - */ -public class GoogleAuthorizationCodeRequestUrlTest extends TestCase { - - private static final String EXPECTED = - "https://accounts.google.com/o/oauth2/auth?client_id=812741506391.apps.googleusercontent.com&" - + "redirect_uri=https://oauth2-login-demo.appspot.com/code&response_type=code" - + "&scope=https://www.googleapis.com/auth/userinfo.email%20" - + "https://www.googleapis.com/auth/userinfo.profile&state=/profile"; - - public void testBuild() { - assertEquals(EXPECTED, 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()); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeTokenRequestTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeTokenRequestTest.java deleted file mode 100644 index 2bddfbcb..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeTokenRequestTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.oauth2.ClientParametersAuthentication; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.MockHttpTransport; - -import junit.framework.TestCase; - -/** - * Tests {@link GoogleAuthorizationCodeTokenRequest}. - * - * @author Yaniv Inbar - */ -public class GoogleAuthorizationCodeTokenRequestTest extends TestCase { - - private static final String CLIENT_ID = "812741506391.apps.googleusercontent.com"; - private static final String CLIENT_SECRET = "{client_secret}"; - private static final String CODE = "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"; - private static final String REDIRECT_URI = "https://oauth2-login-demo.appspot.com/code"; - - public void test() { - GoogleAuthorizationCodeTokenRequest request = - new GoogleAuthorizationCodeTokenRequest(new MockHttpTransport(), - new JacksonFactory(), - CLIENT_ID, - CLIENT_SECRET, - CODE, - REDIRECT_URI); - ClientParametersAuthentication clientAuthentication = - (ClientParametersAuthentication) request.getClientAuthentication(); - assertEquals(CLIENT_ID, clientAuthentication.getClientId()); - assertEquals(CLIENT_SECRET, clientAuthentication.getClientSecret()); - assertEquals(CODE, request.getCode()); - assertEquals(REDIRECT_URI, request.getRedirectUri()); - assertEquals("authorization_code", request.getGrantType()); - assertNull(request.getScopes()); - assertNotNull(request.getTokenServerUrl()); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleBrowserClientRequestUrlTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleBrowserClientRequestUrlTest.java deleted file mode 100644 index e9f56c79..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleBrowserClientRequestUrlTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import junit.framework.TestCase; - -import java.util.Arrays; - -/** - * Tests {@link GoogleBrowserClientRequestUrl}. - * - * @author Yaniv Inbar - */ -public class GoogleBrowserClientRequestUrlTest extends TestCase { - - private static final String EXPECTED = - "https://accounts.google.com/o/oauth2/auth?client_id=812741506391.apps.googleusercontent.com&" - + "redirect_uri=https://oauth2-login-demo.appspot.com/oauthcallback&response_type=token" - + "&scope=https://www.googleapis.com/auth/userinfo.email%20" - + "https://www.googleapis.com/auth/userinfo.profile&state=/profile"; - - public void testBuild() { - assertEquals(EXPECTED, 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()); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleClientSecretsTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleClientSecretsTest.java deleted file mode 100644 index cd06d63f..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleClientSecretsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets.Details; -import com.google.api.client.json.gson.GsonFactory; - -import junit.framework.TestCase; - -import java.io.StringReader; - -/** - * Tests {@link GoogleClientSecrets}. - * - * @author Yaniv Inbar - */ -public class GoogleClientSecretsTest extends TestCase { - - private static final String CLIENT_ID = "812741506391.apps.googleusercontent.com"; - - private static final String CLIENT_SECRET = "{client_secret}"; - - private final static String CLIENT_SECRETS = "{\"installed\": {\"client_id\": \"" + CLIENT_ID - + "\",\"client_secret\": \"" + CLIENT_SECRET + "\"}}"; - - public void testLoad() throws Exception { - GoogleClientSecrets clientSecrets = - GoogleClientSecrets.load(new GsonFactory(), new StringReader(CLIENT_SECRETS)); - Details installed = clientSecrets.getInstalled(); - assertNotNull(installed); - assertEquals(CLIENT_ID, installed.getClientId()); - assertEquals(CLIENT_SECRET, installed.getClientSecret()); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredentialTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredentialTest.java deleted file mode 100644 index 49c76c25..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredentialTest.java +++ /dev/null @@ -1,421 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.googleapis.testing.auth.oauth2.MockTokenServerTransport; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.GenericJson; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.util.SecurityTestUtils; - -import junit.framework.TestCase; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; - -/** - * Tests {@link GoogleCredential}. - * - * @author Yaniv Inbar - */ -public class GoogleCredentialTest extends TestCase { - - private static final JsonFactory JSON_FACTORY = new JacksonFactory(); - - private static final Collection SCOPES = - Collections.unmodifiableCollection(Arrays.asList("scope1", "scope2")); - private static final Collection EMPTY_SCOPES = Collections.emptyList(); - - private static final String SA_KEY_TEXT = "-----BEGIN PRIVATE KEY-----\n" - + "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALX0PQoe1igW12i" - + "kv1bN/r9lN749y2ijmbc/mFHPyS3hNTyOCjDvBbXYbDhQJzWVUikh4mvGBA07qTj79Xc3yBDfKP2IeyYQIFe0t0" - + "zkd7R9Zdn98Y2rIQC47aAbDfubtkU1U72t4zL11kHvoa0/RuFZjncvlr42X7be7lYh4p3NAgMBAAECgYASk5wDw" - + "4Az2ZkmeuN6Fk/y9H+Lcb2pskJIXjrL533vrDWGOC48LrsThMQPv8cxBky8HFSEklPpkfTF95tpD43iVwJRB/Gr" - + "CtGTw65IfJ4/tI09h6zGc4yqvIo1cHX/LQ+SxKLGyir/dQM925rGt/VojxY5ryJR7GLbCzxPnJm/oQJBANwOCO6" - + "D2hy1LQYJhXh7O+RLtA/tSnT1xyMQsGT+uUCMiKS2bSKx2wxo9k7h3OegNJIu1q6nZ6AbxDK8H3+d0dUCQQDTrP" - + "SXagBxzp8PecbaCHjzNRSQE2in81qYnrAFNB4o3DpHyMMY6s5ALLeHKscEWnqP8Ur6X4PvzZecCWU9BKAZAkAut" - + "LPknAuxSCsUOvUfS1i87ex77Ot+w6POp34pEX+UWb+u5iFn2cQacDTHLV1LtE80L8jVLSbrbrlH43H0DjU5AkEA" - + "gidhycxS86dxpEljnOMCw8CKoUBd5I880IUahEiUltk7OLJYS/Ts1wbn3kPOVX3wyJs8WBDtBkFrDHW2ezth2QJ" - + "ADj3e1YhMVdjJW5jqwlD/VNddGjgzyunmiZg0uOXsHXbytYmsA545S8KRQFaJKFXYYFo2kOjqOiC1T2cAzMDjCQ" - + "==\n-----END PRIVATE KEY-----\n"; - private static final String SA_KEY_ID = "key_id"; - - public void testRefreshToken_ServiceAccounts() throws Exception { - final String serviceAccountEmail = - "36680232662-vrd7ji19q3ne0ah2csanun6bnr@developer.gserviceaccount.com"; - final String accessToken = "1/MkSJoj1xsli0AccessToken_NKPY2"; - - MockTokenServerTransport transport = new MockTokenServerTransport(); - transport.addServiceAccount(serviceAccountEmail, accessToken); - - GoogleCredential credential = new GoogleCredential.Builder() - .setServiceAccountId(serviceAccountEmail) - .setServiceAccountScopes(SCOPES) - .setServiceAccountPrivateKey(SecurityTestUtils.newRsaPrivateKey()) - .setTransport(transport) - .setJsonFactory(JSON_FACTORY) - .build(); - - assertTrue(credential.refreshToken()); - assertEquals(accessToken, credential.getAccessToken()); - } - - public void testRefreshToken_User() throws Exception { - final String accessToken = "1/MkSJoj1xsli0AccessToken_NKPY2"; - final String clientSecret = "jakuaL9YyieakhECKL2SwZcu"; - final String clientId = "ya29.1.AADtN_UtlxN3PuGAxrN2XQnZTVRvDyVWnYq4I6dws"; - final String refreshToken = "1/Tl6awhpFjkMkSJoj1xsli0H2eL5YsMgU_NKPY2TyGWY"; - - MockTokenServerTransport transport = new MockTokenServerTransport(); - transport.addClient(clientId, clientSecret); - transport.addRefreshToken(refreshToken, accessToken); - - GoogleCredential credential = new GoogleCredential.Builder() - .setClientSecrets(clientId, clientSecret) - .setTransport(transport) - .setJsonFactory(JSON_FACTORY) - .build(); - credential.setRefreshToken(refreshToken); - - assertTrue(credential.refreshToken()); - assertEquals(accessToken, credential.getAccessToken()); - } - - public void testCreateScoped() throws Exception { - final String serviceAccountEmail = - "36680232662-vrd7ji19q3ne0ah2csanun6bnr@developer.gserviceaccount.com"; - final String accessToken = "1/MkSJoj1xsli0AccessToken_NKPY2"; - - MockTokenServerTransport transport = new MockTokenServerTransport(); - transport.addServiceAccount(serviceAccountEmail, accessToken); - GoogleCredential credential = new GoogleCredential.Builder() - .setServiceAccountId(serviceAccountEmail) - .setServiceAccountScopes(EMPTY_SCOPES) - .setServiceAccountPrivateKey(SecurityTestUtils.newRsaPrivateKey()) - .setTransport(transport) - .setJsonFactory(JSON_FACTORY) - .build(); - assertTrue(credential.createScopedRequired()); - try { - credential.refreshToken(); - fail("Should not be able to refresh token without scopes."); - } catch (Exception expected) { - } - - GoogleCredential scopedCredential = credential.createScoped(SCOPES); - assertFalse(scopedCredential.createScopedRequired()); - assertNotSame(credential, scopedCredential); - - assertTrue(scopedCredential.refreshToken()); - assertEquals(accessToken, scopedCredential.getAccessToken()); - - assertSame(credential.getTransport(), scopedCredential.getTransport()); - assertSame(credential.getJsonFactory(), scopedCredential.getJsonFactory()); - assertSame(credential.getServiceAccountId(), scopedCredential.getServiceAccountId()); - assertSame(credential.getServiceAccountUser(), scopedCredential.getServiceAccountUser()); - assertSame(credential.getServiceAccountPrivateKey(), - scopedCredential.getServiceAccountPrivateKey()); - } - - public void testGetApplicationDefaultNullTransportThrows() throws IOException { - try { - GoogleCredential.getApplicationDefault(null, JSON_FACTORY); - fail(); - } catch (NullPointerException expected) { - } - } - - public void testGetApplicationDefaultNullJsonFactoryThrows() throws IOException { - HttpTransport transport = new MockHttpTransport(); - try { - GoogleCredential.getApplicationDefault(transport, null); - fail(); - } catch (NullPointerException expected) { - } - } - - public void testFromStreamNullTransportThrows() throws IOException { - InputStream stream = new ByteArrayInputStream("foo".getBytes()); - try { - GoogleCredential.fromStream(stream, null, JSON_FACTORY); - fail(); - } catch (NullPointerException expected) { - } - } - - public void testFromStreamNullJsonFactoryThrows() throws IOException { - HttpTransport transport = new MockHttpTransport(); - InputStream stream = new ByteArrayInputStream("foo".getBytes()); - try { - GoogleCredential.fromStream(stream, transport, null); - fail(); - } catch (NullPointerException expected) { - } - } - - public void testFromStreamNullStreamThrows() throws IOException { - HttpTransport transport = new MockHttpTransport(); - try { - GoogleCredential.fromStream(null, transport, JSON_FACTORY); - fail(); - } catch (NullPointerException expected) { - } - } - - public void testFromStreamServiceAccount() throws IOException { - final String accessToken = "1/MkSJoj1xsli0AccessToken_NKPY2"; - final String serviceAccountId = - "36680232662-vrd7ji19qe3nelgchd0ah2csanun6bnr.apps.googleusercontent.com"; - final String serviceAccountEmail = - "36680232662-vrd7ji19qgchd0ah2csanun6bnr@developer.gserviceaccount.com"; - - MockTokenServerTransport transport = new MockTokenServerTransport(); - transport.addServiceAccount(serviceAccountEmail, accessToken); - - // Write out user file - GenericJson serviceAccountContents = new GenericJson(); - serviceAccountContents.setFactory(JSON_FACTORY); - serviceAccountContents.put("client_id", serviceAccountId); - serviceAccountContents.put("client_email", serviceAccountEmail); - serviceAccountContents.put("private_key", SA_KEY_TEXT); - serviceAccountContents.put("private_key_id", SA_KEY_ID); - serviceAccountContents.put("type", GoogleCredential.SERVICE_ACCOUNT_FILE_TYPE); - String json = serviceAccountContents.toPrettyString(); - InputStream serviceAccountStream = new ByteArrayInputStream(json.getBytes()); - - GoogleCredential defaultCredential = GoogleCredential - .fromStream(serviceAccountStream, transport, JSON_FACTORY); - assertNotNull(defaultCredential); - defaultCredential = defaultCredential.createScoped(SCOPES); - - assertTrue(defaultCredential.refreshToken()); - assertEquals(accessToken, defaultCredential.getAccessToken()); - } - - public void testFromStreamServiceAccountMissingClientIdThrows() throws IOException { - final String serviceAccountEmail = - "36680232662-vrd7ji19qgchd0ah2csanun6bnr@developer.gserviceaccount.com"; - - MockHttpTransport transport = new MockTokenServerTransport(); - - // Write out user file - GenericJson serviceAccountContents = new GenericJson(); - serviceAccountContents.setFactory(JSON_FACTORY); - serviceAccountContents.put("client_email", serviceAccountEmail); - serviceAccountContents.put("private_key", SA_KEY_TEXT); - serviceAccountContents.put("private_key_id", SA_KEY_ID); - serviceAccountContents.put("type", GoogleCredential.SERVICE_ACCOUNT_FILE_TYPE); - String json = serviceAccountContents.toPrettyString(); - InputStream serviceAccountStream = new ByteArrayInputStream(json.getBytes()); - - try { - GoogleCredential.fromStream(serviceAccountStream, transport, JSON_FACTORY); - fail(); - } catch (IOException expected) { - assertTrue(expected.getMessage().contains("client_id")); - } - } - - public void testFromStreamServiceAccountMissingClientEmailThrows() throws IOException { - final String serviceAccountId = - "36680232662-vrd7ji19qe3nelgchd0ah2csanun6bnr.apps.googleusercontent.com"; - - MockHttpTransport transport = new MockTokenServerTransport(); - - // Write out user file - GenericJson serviceAccountContents = new GenericJson(); - serviceAccountContents.setFactory(JSON_FACTORY); - serviceAccountContents.put("client_id", serviceAccountId); - serviceAccountContents.put("private_key", SA_KEY_TEXT); - serviceAccountContents.put("private_key_id", SA_KEY_ID); - serviceAccountContents.put("type", GoogleCredential.SERVICE_ACCOUNT_FILE_TYPE); - String json = serviceAccountContents.toPrettyString(); - InputStream serviceAccountStream = new ByteArrayInputStream(json.getBytes()); - - try { - GoogleCredential.fromStream(serviceAccountStream, transport, JSON_FACTORY); - fail(); - } catch (IOException expected) { - assertTrue(expected.getMessage().contains("client_email")); - } - } - - public void testFromStreamServiceAccountMissingPrivateKeyThrows() throws IOException { - final String serviceAccountId = - "36680232662-vrd7ji19qe3nelgchd0ah2csanun6bnr.apps.googleusercontent.com"; - final String serviceAccountEmail = - "36680232662-vrd7ji19qgchd0ah2csanun6bnr@developer.gserviceaccount.com"; - - MockHttpTransport transport = new MockTokenServerTransport(); - - // Write out user file - GenericJson serviceAccountContents = new GenericJson(); - serviceAccountContents.setFactory(JSON_FACTORY); - serviceAccountContents.put("client_id", serviceAccountId); - serviceAccountContents.put("client_email", serviceAccountEmail); - serviceAccountContents.put("private_key_id", SA_KEY_ID); - serviceAccountContents.put("type", GoogleCredential.SERVICE_ACCOUNT_FILE_TYPE); - String json = serviceAccountContents.toPrettyString(); - InputStream serviceAccountStream = new ByteArrayInputStream(json.getBytes()); - - try { - GoogleCredential.fromStream(serviceAccountStream, transport, JSON_FACTORY); - fail(); - } catch (IOException expected) { - assertTrue(expected.getMessage().contains("private_key")); - } - } - - public void testFromStreamServiceAccountMissingPrivateKeyIdThrows() throws IOException { - final String serviceAccountId = - "36680232662-vrd7ji19qe3nelgchd0ah2csanun6bnr.apps.googleusercontent.com"; - final String serviceAccountEmail = - "36680232662-vrd7ji19qgchd0ah2csanun6bnr@developer.gserviceaccount.com"; - - MockHttpTransport transport = new MockTokenServerTransport(); - - // Write out user file - GenericJson serviceAccountContents = new GenericJson(); - serviceAccountContents.setFactory(JSON_FACTORY); - serviceAccountContents.put("client_id", serviceAccountId); - serviceAccountContents.put("client_email", serviceAccountEmail); - serviceAccountContents.put("private_key", SA_KEY_TEXT); - serviceAccountContents.put("type", GoogleCredential.SERVICE_ACCOUNT_FILE_TYPE); - String json = serviceAccountContents.toPrettyString(); - InputStream serviceAccountStream = new ByteArrayInputStream(json.getBytes()); - - try { - GoogleCredential.fromStream(serviceAccountStream, transport, JSON_FACTORY); - fail(); - } catch (IOException expected) { - assertTrue(expected.getMessage().contains("private_key_id")); - } - } - - public void testFromStreamUser() throws IOException { - final String accessToken = "1/MkSJoj1xsli0AccessToken_NKPY2"; - final String clientSecret = "jakuaL9YyieakhECKL2SwZcu"; - final String clientId = - "ya29.1.AADtN_UtlxN3PSc5yhCqfA9nDFp1dfvH8cruGAxrN2XQnZTVRvDyVWnYq4I6dws"; - final String refreshToken = "1/Tl6awhpFjkMkSJoj1xsli0H2eL5YsMgU_NKPY2TyGWY"; - - MockTokenServerTransport transport = new MockTokenServerTransport(); - transport.addClient(clientId, clientSecret); - transport.addRefreshToken(refreshToken, accessToken); - - // Create user stream. - String json = createUserJson(clientId, clientSecret, refreshToken); - InputStream userStream = new ByteArrayInputStream(json.getBytes()); - - GoogleCredential defaultCredential = GoogleCredential - .fromStream(userStream, transport, JSON_FACTORY); - - assertNotNull(defaultCredential); - assertEquals(defaultCredential.getRefreshToken(), refreshToken); - - assertTrue(defaultCredential.refreshToken()); - assertEquals(accessToken, defaultCredential.getAccessToken()); - } - - public void testFromStreamUsertMissingClientIdThrows() throws IOException { - final String accessToken = "1/MkSJoj1xsli0AccessToken_NKPY2"; - final String clientSecret = "jakuaL9YyieakhECKL2SwZcu"; - final String clientId = "ya29.1.AADtN_UtlxN3PSruGAxrN2XQnZTVRvDyVWnYq4I6dws"; - final String refreshToken = "1/Tl6awhpFjkMkSJoj1xsli0H2eL5YsMgU_NKPY2TyGWY"; - - MockTokenServerTransport transport = new MockTokenServerTransport(); - transport.addClient(clientId, clientSecret); - transport.addRefreshToken(refreshToken, accessToken); - - // Write out user file - String json = createUserJson(null, clientSecret, refreshToken); - InputStream userStream = new ByteArrayInputStream(json.getBytes()); - - try { - GoogleCredential.fromStream(userStream, transport, JSON_FACTORY); - fail(); - } catch (IOException expected) { - assertTrue(expected.getMessage().contains("client_id")); - } - } - - public void testFromStreamUsertMissingClientSecretThrows() throws IOException { - final String accessToken = "1/MkSJoj1xsli0AccessToken_NKPY2"; - final String clientSecret = "jakuaL9YyieakhECKL2SwZcu"; - final String clientId = "ya29.1.AADtN_UtlxN3PSruGAxrN2XQnZTVRvDyVWnYq4I6dws"; - final String refreshToken = "1/Tl6awhpFjkMkSJoj1xsli0H2eL5YsMgU_NKPY2TyGWY"; - - MockTokenServerTransport transport = new MockTokenServerTransport(); - transport.addClient(clientId, clientSecret); - transport.addRefreshToken(refreshToken, accessToken); - - // Write out user file - String json = createUserJson(clientId, null, refreshToken); - InputStream userStream = new ByteArrayInputStream(json.getBytes()); - - try { - GoogleCredential.fromStream(userStream, transport, JSON_FACTORY); - fail(); - } catch (IOException expected) { - assertTrue(expected.getMessage().contains("client_secret")); - } - } - - public void testFromStreamUsertMissingRefreshTokenThrows() throws IOException { - final String accessToken = "1/MkSJoj1xsli0AccessToken_NKPY2"; - final String clientSecret = "jakuaL9YyieakhECKL2SwZcu"; - final String clientId = "ya29.1.AADtN_UtlxN3PSruGAxrN2XQnZTVRvDyVWnYq4I6dws"; - final String refreshToken = "1/Tl6awhpFjkMkSJoj1xsli0H2eL5YsMgU_NKPY2TyGWY"; - - MockTokenServerTransport transport = new MockTokenServerTransport(); - transport.addClient(clientId, clientSecret); - transport.addRefreshToken(refreshToken, accessToken); - - // Write out user file - String json = createUserJson(clientId, clientSecret, null); - InputStream userStream = new ByteArrayInputStream(json.getBytes()); - - try { - GoogleCredential.fromStream(userStream, transport, JSON_FACTORY); - fail(); - } catch (IOException expected) { - assertTrue(expected.getMessage().contains("refresh_token")); - } - } - - static String createUserJson(String clientId, String clientSecret, String refreshToken) - throws IOException { - GenericJson userCredentialContents = new GenericJson(); - userCredentialContents.setFactory(JSON_FACTORY); - if (clientId != null) { - userCredentialContents.put("client_id", clientId); - } - if (clientSecret != null) { - userCredentialContents.put("client_secret", clientSecret); - } - if (refreshToken != null) { - userCredentialContents.put("refresh_token", refreshToken); - } - userCredentialContents.put("type", GoogleCredential.USER_FILE_TYPE); - String json = userCredentialContents.toPrettyString(); - return json; - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenTest.java deleted file mode 100644 index 013bf0e1..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.googleapis.auth.oauth2.GoogleIdToken.Payload; - -import junit.framework.TestCase; - -/** Tests for {@link GoogleIdToken}.*/ - -public class GoogleIdTokenTest extends TestCase { - private static final String USER_ID = "1234567890"; - private static final String ANOTHER_USER_ID = "2345678901"; - private static final String CLIENT_ID = "myClientId"; - private static final String ANOTHER_CLIENT_ID = "anotherClientId"; - private static final String EMAIL_VERIFIED_KEY = "email_verified"; - - private static Payload newPayload(String userId, String clientId) { - Payload payload = new Payload(); - payload.setIssuer("accounts.google.com"); - payload.setAudience(clientId); - payload.setAuthorizedParty(clientId); - payload.setSubject(userId); - payload.setExpirationTimeSeconds(100L); - payload.setIssuedAtTimeSeconds(0L); - return payload; - } - - @SuppressWarnings("deprecation") - public void testDeprecatedMethods() { - Payload payload = newPayload(USER_ID, CLIENT_ID); - assertEquals(USER_ID, payload.getUserId()); - assertEquals(CLIENT_ID, payload.getIssuee()); - - payload.setUserId(ANOTHER_USER_ID); - payload.setIssuee(ANOTHER_CLIENT_ID); - assertEquals(ANOTHER_USER_ID, payload.getUserId()); - assertEquals(ANOTHER_CLIENT_ID, payload.getIssuee()); - assertEquals(ANOTHER_USER_ID, payload.getSubject()); - assertEquals(ANOTHER_CLIENT_ID, payload.getAuthorizedParty()); - } - - public void testEmailVerified() { - Payload payload = newPayload(USER_ID, CLIENT_ID); - assertNull(payload.getEmailVerified()); - - payload.setEmailVerified(true); - assertTrue(payload.getEmailVerified()); - - payload.setEmailVerified(false); - assertFalse(payload.getEmailVerified()); - - payload.setEmailVerified(null); - assertNull(payload.getEmailVerified()); - - payload.set(EMAIL_VERIFIED_KEY, "true"); - assertTrue(payload.getEmailVerified()); - - payload.set(EMAIL_VERIFIED_KEY, true); - assertTrue(payload.getEmailVerified()); - - payload.set(EMAIL_VERIFIED_KEY, "false"); - assertFalse(payload.getEmailVerified()); - - payload.set(EMAIL_VERIFIED_KEY, false); - assertFalse(payload.getEmailVerified()); - - payload.set(EMAIL_VERIFIED_KEY, "RandomString"); - assertFalse(payload.getEmailVerified()); - - payload.set(EMAIL_VERIFIED_KEY, ""); - assertFalse(payload.getEmailVerified()); - - payload.set(EMAIL_VERIFIED_KEY, null); - assertNull(payload.getEmailVerified()); - - // Wrong type. - payload.set(EMAIL_VERIFIED_KEY, new Integer(5)); - try { - payload.getEmailVerified(); - fail(); - } catch (ClassCastException e) { - // Expected. - } - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenVerifierTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenVerifierTest.java deleted file mode 100644 index 68e45f18..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleIdTokenVerifierTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.auth.openidconnect.IdTokenVerifier; -import com.google.api.client.googleapis.auth.oauth2.GoogleIdToken.Payload; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.json.webtoken.JsonWebSignature.Header; -import com.google.api.client.testing.http.FixedClock; -import com.google.api.client.util.Clock; -import com.google.api.client.util.Lists; - -import junit.framework.TestCase; - -import java.util.Arrays; -import java.util.List; - -/** - * Tests {@link GoogleIdTokenVerifier}. - * - * @author Yaniv Inbar - */ -public class GoogleIdTokenVerifierTest extends TestCase { - - private static final String ISSUER = "issuer.example.com"; - - private static final String CLIENT_ID = "myclientid"; - - private static final List TRUSTED_CLIENT_IDS = Arrays.asList(CLIENT_ID); - - private static Payload newPayload(String clientId) { - Payload payload = new Payload(); - payload.setIssuer("accounts.google.com"); - payload.setAudience(clientId); - payload.setAuthorizedParty(clientId); - payload.setExpirationTimeSeconds(100L); - payload.setIssuedAtTimeSeconds(0L); - return payload; - } - - public void testBuilder() throws Exception { - GoogleIdTokenVerifier.Builder builder = new GoogleIdTokenVerifier.Builder( - new GooglePublicKeysManagerTest.PublicCertsMockHttpTransport(), new JacksonFactory()).setIssuer( - ISSUER).setAudience(TRUSTED_CLIENT_IDS); - assertEquals(Clock.SYSTEM, builder.getClock()); - assertEquals(ISSUER, builder.getIssuer()); - assertTrue(TRUSTED_CLIENT_IDS.equals(builder.getAudience())); - Clock clock = new FixedClock(4); - builder.setClock(clock); - assertEquals(clock, builder.getClock()); - IdTokenVerifier verifier = builder.build(); - assertEquals(clock, verifier.getClock()); - assertEquals(ISSUER, verifier.getIssuer()); - assertEquals(TRUSTED_CLIENT_IDS, Lists.newArrayList(verifier.getAudience())); - } - - public void testVerify() throws Exception { - GoogleIdTokenVerifier verifier = new GoogleIdTokenVerifier.Builder( - new GooglePublicKeysManagerTest.PublicCertsMockHttpTransport(), new JacksonFactory()).build(); - Header header = new Header(); - header.setAlgorithm("RS25"); - Payload payload = newPayload(CLIENT_ID); - Payload payload2 = newPayload(CLIENT_ID + "2"); - GoogleIdToken idToken = new GoogleIdToken(header, payload, new byte[0], new byte[0]); - GoogleIdToken idToken2 = new GoogleIdToken(header, payload2, new byte[0], new byte[0]); - assertFalse(verifier.verify(idToken)); - assertFalse(verifier.verify(idToken2)); - verifier = new GoogleIdTokenVerifier( - new GooglePublicKeysManagerTest.PublicCertsMockHttpTransport(), new JacksonFactory()); - assertFalse(verifier.verify(idToken)); - assertFalse(verifier.verify(idToken2)); - // TODO(yanivi): add a unit test that returns true - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GooglePublicKeysManagerTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GooglePublicKeysManagerTest.java deleted file mode 100644 index c6a79fd7..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GooglePublicKeysManagerTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.auth.oauth2; - -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.LowLevelHttpRequest; -import com.google.api.client.http.LowLevelHttpResponse; -import com.google.api.client.json.Json; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.FixedClock; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpRequest; -import com.google.api.client.testing.http.MockLowLevelHttpResponse; - -import junit.framework.TestCase; - -/** - * Tests {@link GooglePublicKeysManager}. - * - * @author Yaniv Inbar - */ -public class GooglePublicKeysManagerTest extends TestCase { - - private static final String TEST_CERTIFICATES = - "{\r\n \"69d93af12d09b07b1f55680ac7e7fb2513b823e7\": \"-----BEGIN CERTIFICATE-----" - + "\\nMIICITCCAYqgAwIBAgIIA9YgrgKJ4cowDQYJKoZIhvcNAQEFBQAwNjE0MDIGA1UE" - + "\\nAxMrZmVkZXJhdGVkLXNpZ25vbi5zeXN0ZW0uZ3NlcnZpY2VhY2NvdW50LmNvbTAe" - + "\\nFw0xMjA2MTIyMjQzMzRaFw0xMjA2MTQxMTQzMzRaMDYxNDAyBgNVBAMTK2ZlZGVy" - + "\\nYXRlZC1zaWdub24uc3lzdGVtLmdzZXJ2aWNlYWNjb3VudC5jb20wgZ8wDQYJKoZI" - + "\\nhvcNAQEBBQADgY0AMIGJAoGBAJ6TDzmLxYD67aoTrzA3b8ouMXMeFxQOmsHn0SIA" - + "\\nGjJypTQd0hXr3jGKqP53a4qtzm7YxyPyPOsvG8IMsB0RtB8gxh82KDQUqJ+mww8n" - + "\\ney7WxW1qSmzyYog1z80MDYojODZ3j7wv1r8ajeJQSxQjBMehMEQkfjPuzERuzkCk" - + "\\niBzzAgMBAAGjODA2MAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMBYGA1Ud" - + "\\nJQEB/wQMMAoGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4GBAIx9j1gXCEm2Vr9r" - + "\\nck6VK3ayG29+5ehNvzfYob+l731yU0yylEDEfN9OqqdW0dAqaauca+Ol8mGDIszx" - + "\\nxudWD0NzNyvm39jwypvYz9qMYwbwVnQdfbpY5O0qbcb30eIDKZRHXzpZUj0zWHPM" - + "\\nfwdrgc6XqQ48rjOsn22sWKQcB4/u\\n-----END CERTIFICATE-----\\n\",\r\n " - + "\"67aec7b8e284bb03f489a5828d0eba52cc84cc23\": \"-----BEGIN CERTIFICATE-----" - + "\\nMIICITCCAYqgAwIBAgIIcAqoF0CS2WgwDQYJKoZIhvcNAQEFBQAwNjE0MDIGA1UE" - + "\\nAxMrZmVkZXJhdGVkLXNpZ25vbi5zeXN0ZW0uZ3NlcnZpY2VhY2NvdW50LmNvbTAe" - + "\\nFw0xMjA2MTMyMjI4MzRaFw0xMjA2MTUxMTI4MzRaMDYxNDAyBgNVBAMTK2ZlZGVy" - + "\\nYXRlZC1zaWdub24uc3lzdGVtLmdzZXJ2aWNlYWNjb3VudC5jb20wgZ8wDQYJKoZI" - + "\\nhvcNAQEBBQADgY0AMIGJAoGBAMVlf20FzpqZHR7lzNWbbXq5Ol+j+/2gwTtYlgNz" - + "\\ns6njxEP4oTmViZQsuQABmvYzg7BHOOW2IRE0U2osrfAw97Gg8L/84D0Sdf9sAjr2" - + "\\nb3F6reVPUYJNDvpvKr6351+N+VRskOVnpqp/rS8k69jHlUYiGTpeQ5MA5n1BUCoF" - + "\\nJb/vAgMBAAGjODA2MAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMBYGA1Ud" - + "\\nJQEB/wQMMAoGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4GBAHoD+K9ffsDR+XWn" - + "\\nBODExaCtMTie0l2yRds1wsgc7645PeSYsLB8p4NABI/z28VMD2e7CFzoO2kzNj5I" - + "\\nKLO2FYliXRw35P3ZJxvxs8aSP0S/U2vlhfDM/W0a4KMF9ATfoWqTaoHG1rWmYOuj" - + "\\nncTIM79cE3iBrhFqq8HpetXj77Qf\\n-----END CERTIFICATE-----\\n\"\r\n}"; - - private static final int MAX_AGE = 12345; - - private static final int AGE = 42; - - public void testBuilder() throws Exception { - HttpTransport transport = new MockHttpTransport(); - JsonFactory jsonFactory = new JacksonFactory(); - GooglePublicKeysManager.Builder builder = new GooglePublicKeysManager.Builder(transport, jsonFactory); - - GooglePublicKeysManager certs = builder.build(); - assertEquals(transport, certs.getTransport()); - assertEquals(jsonFactory, certs.getJsonFactory()); - } - - static class PublicCertsMockHttpTransport extends MockHttpTransport { - boolean useAgeHeader; - - @Override - public LowLevelHttpRequest buildRequest(String name, String url) { - return new MockLowLevelHttpRequest() { - @Override - public LowLevelHttpResponse execute() { - MockLowLevelHttpResponse r = new MockLowLevelHttpResponse(); - r.setStatusCode(200); - r.addHeader("Cache-Control", "max-age=" + MAX_AGE); - if (useAgeHeader) { - r.addHeader("Age", String.valueOf(AGE)); - } - r.setContentType(Json.MEDIA_TYPE); - r.setContent(TEST_CERTIFICATES); - return r; - } - }; - } - } - - public void testRefresh() throws Exception { - GooglePublicKeysManager certs = new GooglePublicKeysManager.Builder( - new PublicCertsMockHttpTransport(), new JacksonFactory()).build(); - certs.refresh(); - assertEquals(2, certs.getPublicKeys().size()); - } - - public void testLoadCerts_cache() throws Exception { - PublicCertsMockHttpTransport transport = new PublicCertsMockHttpTransport(); - transport.useAgeHeader = true; - GooglePublicKeysManager certs = new GooglePublicKeysManager.Builder( - transport, new JacksonFactory()).setClock(new FixedClock(100)).build(); - - certs.refresh(); - assertEquals(2, certs.getPublicKeys().size()); - assertEquals(100 + (MAX_AGE - AGE) * 1000, certs.getExpirationTimeMilliseconds()); - } - - public void testGetCacheTimeInSec() throws Exception { - GooglePublicKeysManager certs = - new GooglePublicKeysManager.Builder(new MockHttpTransport(), new JacksonFactory()).build(); - assertEquals(12000, certs.getCacheTimeInSec( - new HttpHeaders().setAge(345L).setCacheControl("max-age=" + MAX_AGE))); - assertEquals(0, certs.getCacheTimeInSec(new HttpHeaders())); - assertEquals(0, certs.getCacheTimeInSec(new HttpHeaders().setAge(345L))); - assertEquals( - 0, certs.getCacheTimeInSec(new HttpHeaders().setAge(345L).setCacheControl("max-age=300"))); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/batch/BatchRequestTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/batch/BatchRequestTest.java deleted file mode 100644 index f762e1d7..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/batch/BatchRequestTest.java +++ /dev/null @@ -1,853 +0,0 @@ -// Copyright 2012 Google Inc. All Rights Reserved. - -package com.google.api.client.googleapis.batch; - -import com.google.api.client.googleapis.batch.BatchRequest.RequestInfo; -import com.google.api.client.googleapis.json.GoogleJsonError; -import com.google.api.client.googleapis.json.GoogleJsonError.ErrorInfo; -import com.google.api.client.googleapis.json.GoogleJsonErrorContainer; -import com.google.api.client.googleapis.testing.services.MockGoogleClient; -import com.google.api.client.googleapis.testing.services.MockGoogleClientRequest; -import com.google.api.client.http.ByteArrayContent; -import com.google.api.client.http.ExponentialBackOffPolicy; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpContent; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpMethods; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpUnsuccessfulResponseHandler; -import com.google.api.client.http.LowLevelHttpRequest; -import com.google.api.client.http.LowLevelHttpResponse; -import com.google.api.client.json.GenericJson; -import com.google.api.client.json.JsonObjectParser; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.protobuf.ProtoObjectParser; -import com.google.api.client.testing.http.HttpTesting; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpRequest; -import com.google.api.client.testing.http.MockLowLevelHttpResponse; -import com.google.api.client.util.Charsets; -import com.google.api.client.util.Key; -import com.google.api.client.util.ObjectParser; - -import junit.framework.TestCase; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.util.ArrayList; -import java.util.List; - -/** - * Tests {@link BatchRequest}. - * - * @author rmistry@google.com (Ravi Mistry) - */ -@SuppressWarnings("deprecation") -public class BatchRequestTest extends TestCase { - - private static final String ROOT_URL = "http://www.test.com/"; - private static final String SERVICE_PATH = "test/"; - private static final String TEST_BATCH_URL = "http://www.testgoogleapis.com/batch"; - private static final String URI_TEMPLATE1 = "uri/template/1"; - private static final String URI_TEMPLATE2 = "uri/template/2"; - private static final String METHOD1 = HttpMethods.GET; - private static final String METHOD2 = HttpMethods.POST; - private static final String ERROR_MSG = "Error message"; - private static final String ERROR_REASON = "notFound"; - private static final int ERROR_CODE = 503; - private static final String ERROR_DOMAIN = "global"; - private static final String RESPONSE_BOUNDARY = "ABC=DE=F"; - private static final String TEST_ID = "Humpty Dumpty"; - private static final String TEST_KIND = "Big\nEgg\n"; // Newlines help test boundary detection - private static final String TEST_NAME = "James Bond"; - private static final String TEST_NUM = "007"; - - private TestCallback1 callback1; - private TestCallback2 callback2; - private TestCallback3 callback3; - - private MockTransport transport; - - private MockCredential credential; - - @Override - protected void setUp() { - callback1 = new TestCallback1(); - callback2 = new TestCallback2(); - callback3 = new TestCallback3(); - } - - public static class MockDataClass1 extends GenericJson { - @Key - String id; - - @Key - String kind; - } - - public static class MockDataClass2 extends GenericJson { - @Key - String name; - - @Key - String number; - } - - private static class TestCallback1 - implements - BatchCallback { - - int successCalls; - - TestCallback1() { - } - - @Override - public void onSuccess(MockDataClass1 dataClass, HttpHeaders responseHeaders) { - successCalls++; - assertEquals(TEST_ID, dataClass.id); - assertEquals(TEST_KIND, dataClass.kind); - } - - @Override - public void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders) { - fail("Should not be invoked in this test"); - } - } - - private static class TestCallback2 - implements - BatchCallback { - - int successCalls; - int failureCalls; - - TestCallback2() { - } - - @Override - public void onSuccess(MockDataClass2 dataClass, HttpHeaders responseHeaders) { - successCalls++; - assertEquals(TEST_NAME, dataClass.name); - assertEquals(TEST_NUM, dataClass.number); - } - - @Override - public void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders) { - failureCalls++; - GoogleJsonError error = e.getError(); - ErrorInfo errorInfo = error.getErrors().get(0); - assertEquals(ERROR_DOMAIN, errorInfo.getDomain()); - assertEquals(ERROR_REASON, errorInfo.getReason()); - assertEquals(ERROR_MSG, errorInfo.getMessage()); - assertEquals(ERROR_CODE, error.getCode()); - assertEquals(ERROR_MSG, error.getMessage()); - } - } - - private static class TestCallback3 implements BatchCallback { - - int successCalls; - int failureCalls; - - TestCallback3() { - } - - @Override - public void onSuccess(Void dataClass, HttpHeaders responseHeaders) { - successCalls++; - assertNull(dataClass); - } - - @Override - public void onFailure(Void e, HttpHeaders responseHeaders) { - failureCalls++; - assertNull(e); - } - } - - /** - * Base class for callback adapters to handle error conversion. - * - * @param The input type - * @param The output type - */ - private abstract static class TestCallbackBaseAdapter implements - BatchCallback { - - protected final BatchCallback callback; - - protected TestCallbackBaseAdapter( - BatchCallback callback) { - this.callback = callback; - } - - @Override - public void onFailure(ErrorOutput.ErrorBody e, HttpHeaders responseHeaders) throws IOException { - GoogleJsonErrorContainer errorContainer = new GoogleJsonErrorContainer(); - - if (e.hasError()) { - ErrorOutput.ErrorProto errorProto = e.getError(); - - GoogleJsonError error = new GoogleJsonError(); - if (errorProto.hasCode()) { - error.setCode(errorProto.getCode()); - } - if (errorProto.hasMessage()) { - error.setMessage(errorProto.getMessage()); - } - - List errorInfos = new ArrayList(errorProto.getErrorsCount()); - for (ErrorOutput.IndividualError individualError : errorProto.getErrorsList()) { - ErrorInfo errorInfo = new ErrorInfo(); - if (individualError.hasDomain()) { - errorInfo.setDomain(individualError.getDomain()); - } - if (individualError.hasMessage()) { - errorInfo.setMessage(individualError.getMessage()); - } - if (individualError.hasReason()) { - errorInfo.setReason(individualError.getReason()); - } - errorInfos.add(errorInfo); - } - error.setErrors(errorInfos); - errorContainer.setError(error); - } - callback.onFailure(errorContainer, responseHeaders); - } - } - - private static class TestCallback1Adapter extends - TestCallbackBaseAdapter { - - public TestCallback1Adapter(TestCallback1 callback) { - super(callback); - } - - @Override - public void onSuccess(MockData.Class1 message, HttpHeaders responseHeaders) throws IOException { - MockDataClass1 dataClass = new MockDataClass1(); - dataClass.id = message.hasId() ? message.getId() : null; - dataClass.kind = message.hasKind() ? message.getKind() : null; - callback.onSuccess(dataClass, responseHeaders); - } - } - - private static class TestCallback2Adapter extends - TestCallbackBaseAdapter { - - public TestCallback2Adapter(TestCallback2 callback) { - super(callback); - } - - @Override - public void onSuccess(MockData.Class2 message, HttpHeaders responseHeaders) throws IOException { - MockDataClass2 dataClass = new MockDataClass2(); - dataClass.name = message.hasName() ? message.getName() : null; - dataClass.number = message.hasNumber() ? message.getNumber() : null; - callback.onSuccess(dataClass, responseHeaders); - } - } - - private static class MockUnsuccessfulResponseHandler implements HttpUnsuccessfulResponseHandler { - - MockTransport transport; - boolean returnSuccessAuthenticatedContent; - - MockUnsuccessfulResponseHandler( - MockTransport transport, boolean returnSuccessAuthenticatedContent) { - this.transport = transport; - this.returnSuccessAuthenticatedContent = returnSuccessAuthenticatedContent; - } - - @Override - public boolean handleResponse( - HttpRequest request, HttpResponse response, boolean supportsRetry) { - if (transport.returnErrorAuthenticatedContent) { - // If transport has already been set to return error content do not handle response. - return false; - } - if (returnSuccessAuthenticatedContent) { - transport.returnSuccessAuthenticatedContent = true; - } else { - transport.returnErrorAuthenticatedContent = true; - } - return true; - } - - } - - @Deprecated - private static class MockExponentialBackOffPolicy extends ExponentialBackOffPolicy { - public MockExponentialBackOffPolicy() { - } - - @Override - public long getNextBackOffMillis() { - return 0; - } - } - - private static class MockTransport extends MockHttpTransport { - - final boolean testServerError; - final boolean testAuthenticationError; - boolean returnSuccessAuthenticatedContent; - boolean returnErrorAuthenticatedContent; - final boolean testExponentialBackOff; - final boolean testRedirect; - final boolean testBinary; - final boolean testMissingLength; - int actualCalls; - int callsBeforeSuccess; - - MockTransport(boolean testServerError, boolean testAuthenticationError, - boolean testExponentialBackOff, boolean testRedirect, boolean testBinary, - boolean testMissingLength) { - this.testServerError = testServerError; - this.testAuthenticationError = testAuthenticationError; - this.testExponentialBackOff = testExponentialBackOff; - this.testRedirect = testRedirect; - this.testBinary = testBinary; - this.testMissingLength = testMissingLength; - } - - @Override - public LowLevelHttpRequest buildRequest(String name, String url) { - actualCalls++; - return new MockLowLevelHttpRequest() { - @Override - public LowLevelHttpResponse execute() throws IOException { - MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); - response.setStatusCode(200); - response.addHeader("Content-Type", "multipart/mixed; boundary=" + RESPONSE_BOUNDARY); - String contentType = - testBinary ? "application/x-protobuf" : "application/json; charset=UTF-8"; - byte[] content1 = testBinary ? MockData.Class1.newBuilder() - .setId(TEST_ID) - .setKind(TEST_KIND) - .build().toByteArray() - : utf8Encode("{\n \"id\": \"" + TEST_ID + "\",\n \"kind\": \"" - + TEST_KIND.replace("\n", "\\n") + "\"\n}"); - byte[] content2 = testBinary ? MockData.Class2.newBuilder() - .setName(TEST_NAME) - .setNumber(TEST_NUM) - .build().toByteArray() - : utf8Encode("{\"name\": \"" + TEST_NAME + "\", \"number\": \"" + TEST_NUM + "\"}"); - byte[] errorContent = testBinary ? ErrorOutput.ErrorBody.newBuilder() - .setError(ErrorOutput.ErrorProto.newBuilder() - .setCode(ERROR_CODE) - .setMessage(ERROR_MSG) - .addErrors(ErrorOutput.IndividualError.newBuilder() - .setDomain(ERROR_DOMAIN) - .setReason(ERROR_REASON) - .setMessage(ERROR_MSG)) - ).build().toByteArray() - : utf8Encode("{\"error\": { \"errors\": [{\"domain\": \"" + ERROR_DOMAIN + "\"," - + "\"reason\": \"" + ERROR_REASON + "\", \"message\": \"" + ERROR_MSG + "\"}]," - + "\"code\": " + ERROR_CODE + ", \"message\": \"" + ERROR_MSG + "\"}}"); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - Writer responseContent = new OutputStreamWriter(outputStream, "ISO-8859-1"); - if (returnSuccessAuthenticatedContent || (testExponentialBackOff && actualCalls > 1) - || (testRedirect && actualCalls > 1)) { - if (returnSuccessAuthenticatedContent || actualCalls == callsBeforeSuccess) { - responseContent.append("--" + RESPONSE_BOUNDARY + "\n") - .append("Content-Type: application/http\n") - .append("Content-Transfer-Encoding: binary\n") - .append("Content-ID: response-1\n\n").append("HTTP/1.1 200 OK\n") - .append("Content-Type: " + contentType + "\n"); - if (!testMissingLength) { - responseContent.append("Content-Length: " + content2.length + "\n"); - } - responseContent.append("\n"); - responseContent.flush(); - outputStream.write(content2); - responseContent.append("\n--" + RESPONSE_BOUNDARY + "--\n\n"); - } else { - responseContent.append("--" + RESPONSE_BOUNDARY + "\n") - .append("Content-Type: application/http\n") - .append("Content-Transfer-Encoding: binary\n") - .append("Content-ID: response-1\n\n") - .append("HTTP/1.1 " + ERROR_CODE + " Not Found\n") - .append("Content-Type: " + contentType + "\n"); - if (!testMissingLength) { - responseContent.append("Content-Length: " + errorContent.length + "\n"); - } - responseContent.append("\n"); - responseContent.flush(); - outputStream.write(errorContent); - responseContent.append("\n--" + RESPONSE_BOUNDARY + "--\n\n"); - } - } else if (returnErrorAuthenticatedContent) { - responseContent.append("Content-Type: application/http\n") - .append("Content-Transfer-Encoding: binary\n").append("Content-ID: response-1\n\n"); - responseContent.append("HTTP/1.1 " + ERROR_CODE + " Not Found\n") - .append("Content-Type: " + contentType + "\n"); - if (!testMissingLength) { - responseContent.append("Content-Length: " + errorContent.length + "\n"); - } - responseContent.append("\n"); - responseContent.flush(); - outputStream.write(errorContent); - responseContent.append("\n--" + RESPONSE_BOUNDARY + "--\n\n"); - } else { - responseContent.append("--" + RESPONSE_BOUNDARY + "\n") - .append("Content-Type: application/http\n") - .append("Content-Transfer-Encoding: binary\n").append("Content-ID: response-1\n\n") - .append("HTTP/1.1 200 OK\n") - .append("Content-Type: " + contentType + "\n"); - if (!testMissingLength) { - responseContent.append("Content-Length: " + content1.length + "\n"); - } - responseContent.append("\n"); - responseContent.flush(); - outputStream.write(content1); - responseContent - .append("\n--" + RESPONSE_BOUNDARY + "\n") - .append("Content-Type: application/http\n") - .append("Content-Transfer-Encoding: binary\n") - .append("Content-ID: response-2\n\n"); - - if (testServerError) { - responseContent.append("HTTP/1.1 " + ERROR_CODE + " Not Found\n") - .append("Content-Type: " + contentType + "\n"); - if (!testMissingLength) { - responseContent.append("Content-Length: " + errorContent.length + "\n"); - } - responseContent.append("\n"); - responseContent.flush(); - outputStream.write(errorContent); - responseContent.append("\n--" + RESPONSE_BOUNDARY + "--\n\n"); - } else if (testAuthenticationError) { - responseContent.append("HTTP/1.1 401 Unauthorized\n") - .append("Content-Type: application/json; charset=UTF-8\n\n") - .append("--" + RESPONSE_BOUNDARY + "--\n\n"); - } else if (testRedirect && actualCalls == 1) { - responseContent.append("HTTP/1.1 301 MovedPermanently\n") - .append("Content-Type: " + contentType + "\n") - .append("Location: http://redirect/location\n\n") - .append("--" + RESPONSE_BOUNDARY + "--\n\n"); - } else { - responseContent.append("HTTP/1.1 200 OK\n") - .append("Content-Type: " + contentType + "\n"); - if (!testMissingLength) { - responseContent.append("Content-Length: " + content2.length + "\n"); - } - responseContent.append("\n"); - responseContent.flush(); - outputStream.write(content2); - responseContent.append("\n--" + RESPONSE_BOUNDARY + "--\n\n"); - } - } - responseContent.flush(); - response.setContent(outputStream.toByteArray()); - return response; - } - - // Short-hand to encode a String as a UTF-8 byte array - private byte[] utf8Encode(String string) { - return Charsets.UTF_8.encode(string).array(); - } - }; - } - } - - private static class MockCredential implements HttpRequestInitializer, HttpExecuteInterceptor { - - boolean initializerCalled = false; - boolean interceptorCalled = false; - - MockCredential() { - } - - @Override - public void initialize(HttpRequest request) { - request.setInterceptor(this); - initializerCalled = true; - } - - @Override - public void intercept(HttpRequest request) { - interceptorCalled = true; - } - - } - - private BatchRequest getBatchPopulatedWithRequests(boolean testServerError, - boolean testAuthenticationError, - boolean returnSuccessAuthenticatedContent, - boolean testExponentialBackOff, - boolean testRedirect, - boolean testBinary, - boolean testMissingLength) throws Exception { - transport = new MockTransport(testServerError, - testAuthenticationError, - testExponentialBackOff, - testRedirect, - testBinary, - testMissingLength); - MockGoogleClient client = new MockGoogleClient.Builder( - transport, ROOT_URL, SERVICE_PATH, null, null).setApplicationName("Test Application") - .build(); - MockGoogleClientRequest jsonHttpRequest1 = - new MockGoogleClientRequest(client, METHOD1, URI_TEMPLATE1, null, String.class); - MockGoogleClientRequest jsonHttpRequest2 = - new MockGoogleClientRequest(client, METHOD2, URI_TEMPLATE2, null, String.class); - credential = new MockCredential(); - - ObjectParser parser = - testBinary ? new ProtoObjectParser() : new JsonObjectParser(new JacksonFactory()); - BatchRequest batchRequest = - new BatchRequest(transport, credential).setBatchUrl(new GenericUrl(TEST_BATCH_URL)); - HttpRequest request1 = jsonHttpRequest1.buildHttpRequest(); - request1.setParser(parser); - HttpRequest request2 = jsonHttpRequest2.buildHttpRequest(); - request2.setParser(parser); - if (testAuthenticationError) { - request2.setUnsuccessfulResponseHandler( - new MockUnsuccessfulResponseHandler(transport, returnSuccessAuthenticatedContent)); - } - if (testExponentialBackOff) { - request2.setBackOffPolicy(new MockExponentialBackOffPolicy()); - } - - if (testBinary) { - batchRequest.queue(request1, MockData.Class1.class, ErrorOutput.ErrorBody.class, - new TestCallback1Adapter(callback1)); - batchRequest.queue(request2, MockData.Class2.class, ErrorOutput.ErrorBody.class, - new TestCallback2Adapter(callback2)); - } else { - batchRequest.queue(request1, MockDataClass1.class, GoogleJsonErrorContainer.class, callback1); - batchRequest.queue(request2, MockDataClass2.class, GoogleJsonErrorContainer.class, callback2); - } - return batchRequest; - } - - public void testQueueDatastructures() throws Exception { - BatchRequest batchRequest = - getBatchPopulatedWithRequests(false, false, false, false, false, false, false); - List> requestInfos = batchRequest.requestInfos; - - // Assert that the expected objects are queued. - assertEquals(2, requestInfos.size()); - assertEquals(MockDataClass1.class, requestInfos.get(0).dataClass); - assertEquals(callback1, requestInfos.get(0).callback); - assertEquals(MockDataClass2.class, requestInfos.get(1).dataClass); - assertEquals(callback2, requestInfos.get(1).callback); - // Assert that the requests in the queue are as expected. - assertEquals( - ROOT_URL + SERVICE_PATH + URI_TEMPLATE1, requestInfos.get(0).request.getUrl().build()); - assertEquals( - ROOT_URL + SERVICE_PATH + URI_TEMPLATE2, requestInfos.get(1).request.getUrl().build()); - assertEquals(METHOD1, requestInfos.get(0).request.getRequestMethod()); - assertEquals(METHOD2, requestInfos.get(1).request.getRequestMethod()); - } - - public void testExecute() throws Exception { - BatchRequest batchRequest = - getBatchPopulatedWithRequests(false, false, false, false, false, false, false); - batchRequest.execute(); - // Assert callbacks have been invoked. - assertEquals(1, callback1.successCalls); - assertEquals(1, callback2.successCalls); - assertEquals(0, callback2.failureCalls); - // Assert requestInfos is empty after execute. - assertTrue(batchRequest.requestInfos.isEmpty()); - } - - public void testExecuteWithError() throws Exception { - BatchRequest batchRequest = - getBatchPopulatedWithRequests(true, false, false, false, false, false, false); - batchRequest.execute(); - // Assert callbacks have been invoked. - assertEquals(1, callback1.successCalls); - assertEquals(0, callback2.successCalls); - assertEquals(1, callback2.failureCalls); - // Assert requestInfos is empty after execute. - assertTrue(batchRequest.requestInfos.isEmpty()); - // Assert transport called expected number of times. - assertEquals(1, transport.actualCalls); - } - - public void testExecuteWithVoidCallback() throws Exception { - subTestExecuteWithVoidCallback(false); - // Assert callbacks have been invoked. - assertEquals(1, callback1.successCalls); - assertEquals(1, callback3.successCalls); - assertEquals(0, callback3.failureCalls); - } - - public void testExecuteWithVoidCallbackError() throws Exception { - subTestExecuteWithVoidCallback(true); - // Assert callbacks have been invoked. - assertEquals(1, callback1.successCalls); - assertEquals(0, callback3.successCalls); - assertEquals(1, callback3.failureCalls); - } - - public void subTestExecuteWithVoidCallback(boolean testServerError) throws Exception { - MockTransport transport = new MockTransport(testServerError, false, false, false, false, false); - MockGoogleClient client = new MockGoogleClient.Builder( - transport, ROOT_URL, SERVICE_PATH, null, null).setApplicationName("Test Application") - .build(); - MockGoogleClientRequest jsonHttpRequest1 = - new MockGoogleClientRequest(client, METHOD1, URI_TEMPLATE1, null, String.class); - MockGoogleClientRequest jsonHttpRequest2 = - new MockGoogleClientRequest(client, METHOD2, URI_TEMPLATE2, null, String.class); - ObjectParser parser = new JsonObjectParser(new JacksonFactory()); - BatchRequest batchRequest = - new BatchRequest(transport, null).setBatchUrl(new GenericUrl(TEST_BATCH_URL)); - HttpRequest request1 = jsonHttpRequest1.buildHttpRequest(); - request1.setParser(parser); - HttpRequest request2 = jsonHttpRequest2.buildHttpRequest(); - request2.setParser(parser); - batchRequest.queue(request1, MockDataClass1.class, GoogleJsonErrorContainer.class, callback1); - batchRequest.queue(request2, Void.class, Void.class, callback3); - batchRequest.execute(); - // Assert transport called expected number of times. - assertEquals(1, transport.actualCalls); - } - - public void testExecuteWithAuthenticationErrorThenSuccessCallback() throws Exception { - BatchRequest batchRequest = - getBatchPopulatedWithRequests(false, true, true, false, false, false, false); - batchRequest.execute(); - // Assert callbacks have been invoked. - assertEquals(1, callback1.successCalls); - assertEquals(1, callback2.successCalls); - assertEquals(0, callback2.failureCalls); - // Assert transport called expected number of times. - assertEquals(2, transport.actualCalls); - // Assert requestInfos is empty after execute. - assertTrue(batchRequest.requestInfos.isEmpty()); - } - - public void testExecuteWithAuthenticationErrorThenErrorCallback() throws Exception { - BatchRequest batchRequest = - getBatchPopulatedWithRequests(false, true, false, false, false, false, false); - batchRequest.execute(); - // Assert callbacks have been invoked. - assertEquals(1, callback1.successCalls); - assertEquals(0, callback2.successCalls); - assertEquals(1, callback2.failureCalls); - // Assert transport called expected number of times. - assertEquals(2, transport.actualCalls); - // Assert requestInfos is empty after execute. - assertTrue(batchRequest.requestInfos.isEmpty()); - } - - public void testExecuteWithExponentialBackoffThenSuccessCallback() throws Exception { - BatchRequest batchRequest = - getBatchPopulatedWithRequests(true, false, false, true, false, false, false); - transport.callsBeforeSuccess = 2; - batchRequest.execute(); - // Assert callbacks have been invoked. - assertEquals(1, callback1.successCalls); - assertEquals(1, callback2.successCalls); - // Assert transport called expected number of times. - assertEquals(2, transport.actualCalls); - // Assert requestInfos is empty after execute. - assertTrue(batchRequest.requestInfos.isEmpty()); - } - - public void testExecuteWithExponentialBackoffThenErrorCallback() throws Exception { - BatchRequest batchRequest = - getBatchPopulatedWithRequests(true, false, false, true, false, false, false); - transport.callsBeforeSuccess = 20; - batchRequest.execute(); - // Assert callbacks have been invoked. - assertEquals(1, callback1.successCalls); - assertEquals(0, callback2.successCalls); - assertEquals(1, callback2.failureCalls); - // Assert transport called expected number of times. - assertEquals(11, transport.actualCalls); - // Assert requestInfos is empty after execute. - assertTrue(batchRequest.requestInfos.isEmpty()); - } - - public void testInterceptor() throws Exception { - BatchRequest batchRequest = - getBatchPopulatedWithRequests(true, false, false, true, false, false, false); - batchRequest.execute(); - // Assert the top-level request initializer is called. - assertTrue(credential.initializerCalled); - assertTrue(credential.interceptorCalled); - } - - public void testRedirect() throws Exception { - BatchRequest batchRequest = - getBatchPopulatedWithRequests(false, false, false, false, true, false, false); - transport.callsBeforeSuccess = 2; - batchRequest.execute(); - // Assert transport called expected number of times. - assertEquals(2, transport.actualCalls); - // Assert requestInfos is empty after execute. - assertTrue(batchRequest.requestInfos.isEmpty()); - } - - public void testExecute_checkWriteTo() throws Exception { - String request1Method = HttpMethods.POST; - String request1Url = "http://test/dummy/url1"; - String request1ContentType = "application/json"; - String request1Content = "{\"data\":{\"foo\":{\"v1\":{}}}}"; - - String request2Method = HttpMethods.GET; - String request2Url = "http://test/dummy/url2"; - - final StringBuilder expectedOutput = new StringBuilder(); - expectedOutput.append("--__END_OF_PART__\r\n"); - expectedOutput.append("Content-Length: 109\r\n"); - expectedOutput.append("Content-Type: application/http\r\n"); - expectedOutput.append("content-id: 1\r\n"); - expectedOutput.append("content-transfer-encoding: binary\r\n"); - expectedOutput.append("\r\n"); - expectedOutput.append("POST http://test/dummy/url1\r\n"); - expectedOutput.append("Content-Length: 26\r\n"); - expectedOutput.append("Content-Type: " + request1ContentType + "\r\n"); - expectedOutput.append("\r\n"); - expectedOutput.append(request1Content + "\r\n"); - expectedOutput.append("--__END_OF_PART__\r\n"); - expectedOutput.append("Content-Length: 28\r\n"); - expectedOutput.append("Content-Type: application/http\r\n"); - expectedOutput.append("content-id: 2\r\n"); - expectedOutput.append("content-transfer-encoding: binary\r\n"); - expectedOutput.append("\r\n"); - expectedOutput.append("GET http://test/dummy/url2\r\n"); - expectedOutput.append("\r\n"); - expectedOutput.append("--__END_OF_PART__--\r\n"); - MockHttpTransport transport = new MockHttpTransport(); - HttpRequest request1 = transport.createRequestFactory().buildRequest( - request1Method, new GenericUrl(request1Url), - new ByteArrayContent(request1ContentType, request1Content.getBytes())); - HttpRequest request2 = transport.createRequestFactory() - .buildRequest(request2Method, new GenericUrl(request2Url), null); - subtestExecute_checkWriteTo(expectedOutput.toString(), request1, request2); - } - - private void subtestExecute_checkWriteTo(final String expectedOutput, HttpRequest... requests) - throws IOException { - - MockHttpTransport transport = new MockHttpTransport() { - - @Override - public LowLevelHttpRequest buildRequest(String method, String url) { - return new MockLowLevelHttpRequest(url) { - - @Override - public LowLevelHttpResponse execute() throws IOException { - assertEquals("multipart/mixed; boundary=__END_OF_PART__", getContentType()); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - getStreamingContent().writeTo(out); - assertEquals(expectedOutput, out.toString("UTF-8")); - MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); - response.setStatusCode(200); - response.addHeader("Content-Type", "multipart/mixed; boundary=" + RESPONSE_BOUNDARY); - String content2 = "{\"name\": \"" + TEST_NAME + "\", \"number\": \"" + TEST_NUM + "\"}"; - StringBuilder responseContent = new StringBuilder(); - responseContent.append("--" + RESPONSE_BOUNDARY + "\n") - .append("Content-Type: application/http\n") - .append("Content-Transfer-Encoding: binary\n").append("Content-ID: response-1\n\n") - .append("HTTP/1.1 200 OK\n") - .append("Content-Type: application/json; charset=UTF-8\n") - .append("Content-Length: " + content2.length() + "\n\n").append(content2 + "\n\n") - .append("--" + RESPONSE_BOUNDARY + "--\n\n"); - response.setContent(responseContent.toString()); - return response; - } - }; - } - }; - - BatchRequest batchRequest = new BatchRequest(transport, null); - BatchCallback callback = new BatchCallback() { - - @Override - public void onSuccess(Void t, HttpHeaders responseHeaders) { - } - - @Override - public void onFailure(Void e, HttpHeaders responseHeaders) { - } - }; - for (HttpRequest request : requests) { - batchRequest.queue(request, Void.class, Void.class, callback); - } - batchRequest.execute(); - } - - public void testExecute_checkWriteToNoHeaders() throws Exception { - MockHttpTransport transport = new MockHttpTransport(); - HttpRequest request1 = transport.createRequestFactory() - .buildPostRequest(HttpTesting.SIMPLE_GENERIC_URL, new HttpContent() { - - @Override - public long getLength() { - return -1; - } - - @Override - public String getType() { - return null; - } - - @Override - public void writeTo(OutputStream out) { - } - - @Override - public boolean retrySupported() { - return true; - } - }); - subtestExecute_checkWriteTo(new StringBuilder().append("--__END_OF_PART__\r\n") - .append("Content-Length: 27\r\n").append("Content-Type: application/http\r\n") - .append("content-id: 1\r\n").append("content-transfer-encoding: binary\r\n").append("\r\n") - .append("POST http://google.com/\r\n").append("\r\n").append("\r\n") - .append("--__END_OF_PART__--\r\n").toString(), request1); - } - - public void testProtoExecute() throws Exception { - BatchRequest batchRequest = - getBatchPopulatedWithRequests(false, false, false, false, false, true, false); - batchRequest.execute(); - // Assert callbacks have been invoked. - assertEquals(1, callback1.successCalls); - assertEquals(1, callback2.successCalls); - assertEquals(0, callback2.failureCalls); - // Assert requestInfos is empty after execute. - assertTrue(batchRequest.requestInfos.isEmpty()); - } - - public void testProtoExecuteWithError() throws Exception { - BatchRequest batchRequest = - getBatchPopulatedWithRequests(true, false, false, false, false, true, false); - batchRequest.execute(); - // Assert callbacks have been invoked. - assertEquals(1, callback1.successCalls); - assertEquals(0, callback2.successCalls); - assertEquals(1, callback2.failureCalls); - // Assert requestInfos is empty after execute. - assertTrue(batchRequest.requestInfos.isEmpty()); - // Assert transport called expected number of times. - assertEquals(1, transport.actualCalls); - } - - public void testProtoExecuteWithoutLength() throws Exception { - BatchRequest batchRequest = - getBatchPopulatedWithRequests(false, false, false, false, false, true, true); - batchRequest.execute(); - // Assert callbacks have been invoked. - assertEquals(1, callback1.successCalls); - assertEquals(1, callback2.successCalls); - assertEquals(0, callback2.failureCalls); - // Assert requestInfos is empty after execute. - assertTrue(batchRequest.requestInfos.isEmpty()); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/batch/error_output.proto b/google-api-client/src/test/java/com/google/api/client/googleapis/batch/error_output.proto deleted file mode 100644 index 7bd21393..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/batch/error_output.proto +++ /dev/null @@ -1,76 +0,0 @@ -// Mock ProtoBuf message on the body of HTTP responses that represent errors. - -syntax = "proto2"; -package api.client.googleapis.batch; -option optimize_for = LITE_RUNTIME; -option java_package = "com.google.api.client.googleapis.batch"; - -// These messages are the protobuf version of the -// com.google.api.client.googleapis.json.GoogleJsonError output -// structure, and have a 1:1 mapping with it. Said structure is: -// { -// error: { -// code: , -// message: , -// errors: [ -// { -// ..., -// }, -// { -// ..., -// }, -// ], -// } -// } - -// Top-level object present in the HTTP body. -message ErrorBody { - optional ErrorProto error = 1; -} - -message ErrorProto { - // HTTP code of the response. Further specified by the first element of the - // "errors" field. Always present. - optional int32 code = 1; - - // Same value as the "message" field of the first element of the "errors" - // field. Always present. - optional string message = 2; - - // Non-empty list of errors found while processing the request. Not all of - // them must be the same type of error, in which case only the first is - // expected to be handled. - repeated IndividualError errors = 3; -} - -message IndividualError { - // Description of this error for human consumption. Always present. - optional string message = 1; - - // Namespace under which the "reason" field is to be interpreted. Always - // present. - optional string domain = 2; - - // Alphanumeric error code, in lowerCamel case, that identifies the error - // with a granularity finer than the HTTP status code. Always present. - optional string reason = 3; - - // For client errors, these two fields point at where in the HTTP request - // lies the problem. E.g. location_type = HEADER, location = "Authorization". - optional LocationType location_type = 5; - optional string location = 6; -} - -enum LocationType { - // Either a query parameter or a URL path parameter. - PARAMETER = 0; - - // An HTTP request header. - HEADER = 1; - - // Some place in the body of the HTTP request. - ENTITY = 2; - - // API-specific location type. - OTHER = 3; -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/batch/mock_data.proto b/google-api-client/src/test/java/com/google/api/client/googleapis/batch/mock_data.proto deleted file mode 100644 index 0b2b717f..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/batch/mock_data.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto2"; -package api.client.googleapis.batch; -option optimize_for = LITE_RUNTIME; -option java_package = "com.google.api.client.googleapis.batch"; - -message Class1 { - optional string id = 1; - optional string kind = 2; -} - -message Class2 { - optional string name = 1; - optional string number = 2; -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/compute/ComputeCredentialTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/compute/ComputeCredentialTest.java deleted file mode 100644 index 14a57556..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/compute/ComputeCredentialTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.compute; - - -import com.google.api.client.googleapis.testing.compute.MockMetadataServerTransport; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.jackson2.JacksonFactory; - -import junit.framework.TestCase; - -/** - * Tests {@link ComputeCredential}. - * - * @author Yaniv Inbar - */ -public class ComputeCredentialTest extends TestCase { - - static final String ACCESS_TOKEN = "ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_QtAS08i85nHq39HE3C2LTrCARA"; - - public void testExecuteRefreshToken() throws Exception { - - HttpTransport transport = new MockMetadataServerTransport(ACCESS_TOKEN); - - ComputeCredential credential = new ComputeCredential(transport, new JacksonFactory()); - - assertTrue(credential.refreshToken()); - assertEquals(ACCESS_TOKEN, credential.getAccessToken()); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonErrorContainerTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonErrorContainerTest.java deleted file mode 100644 index 1a271764..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonErrorContainerTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.json; - -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonParser; -import com.google.api.client.json.jackson2.JacksonFactory; - -import junit.framework.TestCase; - -/** - * Tests {@link GoogleJsonErrorContainer}. - * - * @author rmistry@google.com (Ravi Mistry) - */ -public class GoogleJsonErrorContainerTest extends TestCase { - - static final JsonFactory FACTORY = new JacksonFactory(); - static final String ERROR = "{" + "\"error\":{" + "\"code\":403," + "\"errors\":[{" - + "\"domain\":\"usageLimits\"," + "\"message\":\"Access Not Configured\"," - + "\"reason\":\"accessNotConfigured\"" + "}]," + "\"message\":\"Access Not Configured\"}}"; - - public void test_json() throws Exception { - JsonParser parser = FACTORY.createJsonParser(ERROR); - GoogleJsonErrorContainer e = parser.parse(GoogleJsonErrorContainer.class); - assertEquals(ERROR, FACTORY.toString(e)); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonErrorTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonErrorTest.java deleted file mode 100644 index 8c2ff1af..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonErrorTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.json; - -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpStatusCodes; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.LowLevelHttpRequest; -import com.google.api.client.json.Json; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonParser; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.HttpTesting; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpRequest; -import com.google.api.client.testing.http.MockLowLevelHttpResponse; - -import junit.framework.TestCase; - - -/** - * Tests {@link GoogleJsonError}. - * - * @author Yaniv Inbar - */ -public class GoogleJsonErrorTest extends TestCase { - - static final JsonFactory FACTORY = new JacksonFactory(); - static final String ERROR = "{" + "\"code\":403," + "\"errors\":[{" - + "\"domain\":\"usageLimits\"," + "\"message\":\"Access Not Configured\"," - + "\"reason\":\"accessNotConfigured\"" + "}]," + "\"message\":\"Access Not Configured\"}"; - static final String ERROR_RESPONSE = "{\"error\":" + ERROR + "}"; - - public void test_json() throws Exception { - JsonParser parser = FACTORY.createJsonParser(ERROR); - parser.nextToken(); - GoogleJsonError e = parser.parse(GoogleJsonError.class); - assertEquals(ERROR, FACTORY.toString(e)); - } - - static class ErrorTransport extends MockHttpTransport { - final MockLowLevelHttpResponse response; - - ErrorTransport() { - this(ERROR_RESPONSE, Json.MEDIA_TYPE); - } - - ErrorTransport(String content, String contentType) { - response = new MockLowLevelHttpResponse().setContent(content) - .setContentType(contentType).setStatusCode(HttpStatusCodes.STATUS_CODE_FORBIDDEN); - } - - @Override - public LowLevelHttpRequest buildRequest(String name, String url) { - return new MockLowLevelHttpRequest(url).setResponse(response); - } - } - - public void testParse() throws Exception { - HttpTransport transport = new ErrorTransport(); - HttpRequest request = - transport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); - request.setThrowExceptionOnExecuteError(false); - HttpResponse response = request.execute(); - GoogleJsonError errorResponse = GoogleJsonError.parse(FACTORY, response); - assertEquals(ERROR, FACTORY.toString(errorResponse)); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonResponseExceptionTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonResponseExceptionTest.java deleted file mode 100644 index 19b59abe..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonResponseExceptionTest.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.json; - -import com.google.api.client.googleapis.json.GoogleJsonErrorTest.ErrorTransport; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.json.Json; -import com.google.api.client.testing.http.HttpTesting; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.util.StringUtils; - -import junit.framework.TestCase; - - -/** - * Tests {@link GoogleJsonResponseException}. - * - * @author Yaniv Inbar - */ -public class GoogleJsonResponseExceptionTest extends TestCase { - - public void testFrom_noDetails() throws Exception { - HttpTransport transport = new MockHttpTransport(); - HttpRequest request = - transport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); - request.setThrowExceptionOnExecuteError(false); - HttpResponse response = request.execute(); - GoogleJsonResponseException ge = - GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); - assertNull(ge.getDetails()); - assertEquals("200", ge.getMessage()); - } - - public void testFrom_withDetails() throws Exception { - HttpTransport transport = new ErrorTransport(); - HttpRequest request = - transport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); - request.setThrowExceptionOnExecuteError(false); - HttpResponse response = request.execute(); - GoogleJsonResponseException ge = - GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); - assertEquals(GoogleJsonErrorTest.ERROR, GoogleJsonErrorTest.FACTORY.toString(ge.getDetails())); - assertTrue( - ge.getMessage(), ge.getMessage().startsWith("403" + StringUtils.LINE_SEPARATOR + "{")); - } - - public void testFrom_detailsMissingContent() throws Exception { - HttpTransport transport = new ErrorTransport(null, Json.MEDIA_TYPE); - HttpRequest request = - transport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); - request.setThrowExceptionOnExecuteError(false); - HttpResponse response = request.execute(); - GoogleJsonResponseException ge = - GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); - assertNull(ge.getDetails()); - assertEquals("403", ge.getMessage()); - } - - public void testFrom_detailsArbitraryJsonContent() throws Exception { - HttpTransport transport = new ErrorTransport("{\"foo\":\"bar\"}", Json.MEDIA_TYPE); - HttpRequest request = - transport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); - request.setThrowExceptionOnExecuteError(false); - HttpResponse response = request.execute(); - GoogleJsonResponseException ge = - GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); - assertNull(ge.getDetails()); - assertEquals("403", ge.getMessage()); - } - - public void testFrom_detailsArbitraryXmlContent() throws Exception { - HttpTransport transport = new ErrorTransport("", "application/atom+xml; charset=utf-8"); - HttpRequest request = - transport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); - request.setThrowExceptionOnExecuteError(false); - HttpResponse response = request.execute(); - GoogleJsonResponseException ge = - GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); - assertNull(ge.getDetails()); - assertTrue( - ge.getMessage(), ge.getMessage().startsWith("403" + StringUtils.LINE_SEPARATOR + "<")); - } - - public void testFrom_errorNoContentButWithJsonContentType() throws Exception { - HttpTransport transport = new ErrorTransport("", Json.MEDIA_TYPE); - HttpRequest request = - transport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); - request.setThrowExceptionOnExecuteError(false); - HttpResponse response = request.execute(); - GoogleJsonResponseException ge = - GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); - assertNull(ge.getDetails()); - assertEquals("403", ge.getMessage()); - } - - public void testFrom_errorEmptyContentButWithJsonContentType() throws Exception { - HttpTransport transport = new ErrorTransport(null, Json.MEDIA_TYPE); - HttpRequest request = - transport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); - request.setThrowExceptionOnExecuteError(false); - HttpResponse response = request.execute(); - GoogleJsonResponseException ge = - GoogleJsonResponseException.from(GoogleJsonErrorTest.FACTORY, response); - assertNull(ge.getDetails()); - assertEquals("403", ge.getMessage()); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/media/MediaHttpDownloaderTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/media/MediaHttpDownloaderTest.java deleted file mode 100644 index cd7b6506..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/media/MediaHttpDownloaderTest.java +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.media; - -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpResponseException; -import com.google.api.client.http.LowLevelHttpRequest; -import com.google.api.client.http.LowLevelHttpResponse; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpRequest; -import com.google.api.client.testing.http.MockLowLevelHttpResponse; - -import junit.framework.TestCase; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; - -/** - * Tests {@link MediaHttpDownloader}. - * - * @author rmistry@google.com (Ravi Mistry) - */ -public class MediaHttpDownloaderTest extends TestCase { - - private static final String TEST_REQUEST_URL = "http://www.test.com/request/url?alt=media"; - private static final int TEST_CHUNK_SIZE = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE; - - private static class MediaTransport extends MockHttpTransport { - - int lowLevelExecCalls; - int contentLength; - int bytesDownloaded; - int lastBytePos = -1; - boolean testServerError; - boolean testClientError; - boolean directDownloadEnabled; - - protected MediaTransport(int contentLength) { - this.contentLength = contentLength; - } - - @Override - public LowLevelHttpRequest buildRequest(String name, String url) { - assertEquals(TEST_REQUEST_URL, url); - - return new MockLowLevelHttpRequest() { - @Override - public LowLevelHttpResponse execute() { - lowLevelExecCalls++; - MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); - - if (directDownloadEnabled) { - if (bytesDownloaded != 0) { - if (lastBytePos == -1) { - assertEquals("bytes=" + bytesDownloaded + "-", getFirstHeaderValue("Range")); - } else { - assertEquals( - "bytes=" + bytesDownloaded + "-" + lastBytePos, getFirstHeaderValue("Range")); - } - } - if (testServerError && lowLevelExecCalls == 1) { - // send a server error in the 1st request - response.setStatusCode(500); - return response; - } - response.setStatusCode(200); - response.addHeader("Content-Length", String.valueOf(contentLength)); - response.setContent( - new ByteArrayInputStream(new byte[contentLength - bytesDownloaded])); - return response; - } - - // Assert that the required headers are set. - long currentRequestLastBytePos = bytesDownloaded + TEST_CHUNK_SIZE - 1; - if (lastBytePos != -1) { - currentRequestLastBytePos = Math.min(lastBytePos, currentRequestLastBytePos); - } - assertEquals("bytes=" + bytesDownloaded + "-" + currentRequestLastBytePos, - getFirstHeaderValue("Range")); - - if (testServerError && lowLevelExecCalls == 2) { - // Send a server error in the 2nd request. - response.setStatusCode(500); - return response; - } - if (testClientError) { - // Return a 404. - response.setStatusCode(404); - return response; - } - - response.setStatusCode(206); - int upper = Math.min(bytesDownloaded + TEST_CHUNK_SIZE, contentLength) - 1; - response.addHeader( - "Content-Range", "bytes " + bytesDownloaded + "-" + upper + "/" + contentLength); - int bytesDownloadedCur = upper - bytesDownloaded + 1; - response.setContent(new ByteArrayInputStream(new byte[bytesDownloadedCur])); - bytesDownloaded += bytesDownloadedCur; - return response; - } - }; - } - } - - private static class ProgressListenerWithTwoDownloadCalls - implements - MediaHttpDownloaderProgressListener { - - int progressListenerCalls; - - public ProgressListenerWithTwoDownloadCalls() { - } - - public void progressChanged(MediaHttpDownloader downloader) { - progressListenerCalls++; - - switch (downloader.getDownloadState()) { - case MEDIA_IN_PROGRESS: - // Assert that the 1st call is media in progress and check the progress percent. - assertTrue(progressListenerCalls == 1); - assertEquals(0.5, downloader.getProgress()); - break; - case MEDIA_COMPLETE: - // Assert that the 2nd call is media complete. - assertEquals(2, progressListenerCalls); - assertEquals(1.0, downloader.getProgress()); - break; - } - } - } - - public void testDownloadOneCallHalfChunkSize() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE / 2; - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - MediaTransport fakeTransport = new MediaTransport(contentLength); - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - assertEquals(contentLength, outputStream.size()); - - // There should be 1 download call made. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testDownloadOneCallMaxChunkSize() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - try { - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - assertEquals(TEST_CHUNK_SIZE, outputStream.size()); - } finally { - outputStream.close(); - } - - // There should be 1 download call made. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testSetBytesDownloaded() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.bytesDownloaded = contentLength - 10000; - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - downloader.setBytesDownloaded(contentLength - 10000); - - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - assertEquals(10000, outputStream.size()); - - // There should be 1 download call made. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testDownloadMultipleCallsMaxChunkSize() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE * 3; - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - MediaTransport fakeTransport = new MediaTransport(contentLength); - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - assertEquals(contentLength, outputStream.size()); - - // There should be 3 download calls made. - assertEquals(3, fakeTransport.lowLevelExecCalls); - } - - public void testDownloadProgressListener() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE * 2; - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - MediaTransport fakeTransport = new MediaTransport(contentLength); - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - downloader.setProgressListener(new ProgressListenerWithTwoDownloadCalls()); - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - } - - public void testDownloadServerErrorWithBackOffEnabled() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE * 2; - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.testServerError = true; - MediaHttpDownloader downloader = new MediaHttpDownloader( - fakeTransport, new MediaHttpUploaderTest.ZeroBackOffRequestInitializer()); - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - - // There should be 3 calls made: 1 download request with server error and 2 successful download - // requests. - assertEquals(3, fakeTransport.lowLevelExecCalls); - } - - public void testDownloadServerErrorWithBackOffDisabled() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE * 2; - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.testServerError = true; - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - try { - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - fail("Expected " + HttpResponseException.class); - } catch (HttpResponseException e) { - // Expected - } - - // There should be 2 calls made: 1 successful download request and 1 download request with - // server error. - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testDownloadClientError() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE * 2; - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.testClientError = true; - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - try { - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - fail("Expected " + HttpResponseException.class); - } catch (HttpResponseException e) { - // Expected - } - - // There should be only 1 call made: 1 download request that returned a 404. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testDirectMediaDownload() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE; - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.directDownloadEnabled = true; - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - downloader.setDirectDownloadEnabled(true); - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - assertEquals(TEST_CHUNK_SIZE, outputStream.size()); - - // There should be 1 download call made. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testSetBytesDownloadedWithIllegalArguments() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - try { - downloader.setBytesDownloaded(-1); - fail("Expected " + IllegalArgumentException.class); - } catch (IllegalArgumentException e) { - // Expected. - } - - // Anything >= 0 should be accepted. - downloader.setBytesDownloaded(0); - downloader.setBytesDownloaded(1); - } - - public void testSetContentRangeWithIllegalArguments() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - - try { - downloader.setContentRange(-1, 0); - fail("Expected " + IllegalArgumentException.class); - } catch (IllegalArgumentException e) { - // Expected. - } - - try { - downloader.setContentRange(1, 0); - fail("Expected " + IllegalArgumentException.class); - } catch (IllegalArgumentException e) { - // Expected. - } - - try { - downloader.setContentRange(200, 199); - fail("Expected " + IllegalArgumentException.class); - } catch (IllegalArgumentException e) { - // Expected. - } - - // The following should be accepted - downloader.setContentRange(0, 0); - downloader.setContentRange(0, 1); - downloader.setContentRange(1, 1); - downloader.setContentRange(199, 200); - downloader.setContentRange(200, 200); - } - - public void testSetBytesDownloadedWithDirectDownload() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.directDownloadEnabled = true; - fakeTransport.bytesDownloaded = contentLength - 10000; - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - downloader.setDirectDownloadEnabled(true); - downloader.setBytesDownloaded(contentLength - 10000); - - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - assertEquals(10000, outputStream.size()); - - // There should be 1 download call made. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testSetContentRangeWithResumableDownload() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.bytesDownloaded = contentLength - 10000; - fakeTransport.lastBytePos = contentLength; - - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - downloader.setContentRange(contentLength - 10000, contentLength); - - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - assertEquals(10000, outputStream.size()); - - // There should be 1 download call made. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testSetContentRangeWithDirectDownload() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.directDownloadEnabled = true; - fakeTransport.bytesDownloaded = contentLength - 10000; - fakeTransport.lastBytePos = contentLength; - - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - downloader.setDirectDownloadEnabled(true); - downloader.setContentRange(contentLength - 10000, contentLength); - - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - assertEquals(10000, outputStream.size()); - - // There should be 1 download call made. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testDirectDownloadServerErrorWithBackOffEnabled() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE * 2; - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.directDownloadEnabled = true; - fakeTransport.testServerError = true; - MediaHttpDownloader downloader = new MediaHttpDownloader( - fakeTransport, new MediaHttpUploaderTest.ZeroBackOffRequestInitializer()); - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - - // should be 2 calls made: 1 download request w/server error and 1 successful download request - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testDirectDownloadServerErrorWithBackOffDisabled() throws Exception { - int contentLength = MediaHttpDownloader.MAXIMUM_CHUNK_SIZE * 2; - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.directDownloadEnabled = true; - fakeTransport.testServerError = true; - MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null); - try { - downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream); - fail("Expected " + HttpResponseException.class); - } catch (HttpResponseException e) { - // Expected - } - - // should be 1 call made: 1 download request with server error - assertEquals(1, fakeTransport.lowLevelExecCalls); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/media/MediaHttpUploaderTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/media/MediaHttpUploaderTest.java deleted file mode 100644 index cd51172f..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/media/MediaHttpUploaderTest.java +++ /dev/null @@ -1,1028 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.media; - -import com.google.api.client.http.AbstractHttpContent; -import com.google.api.client.http.ByteArrayContent; -import com.google.api.client.http.EmptyContent; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpBackOffIOExceptionHandler; -import com.google.api.client.http.HttpBackOffUnsuccessfulResponseHandler; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.InputStreamContent; -import com.google.api.client.http.LowLevelHttpRequest; -import com.google.api.client.http.LowLevelHttpResponse; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpRequest; -import com.google.api.client.testing.http.MockLowLevelHttpResponse; -import com.google.api.client.testing.util.TestableByteArrayInputStream; -import com.google.api.client.util.BackOff; - -import junit.framework.TestCase; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Arrays; -import java.util.Random; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Tests {@link MediaHttpUploader}. - * - * @author rmistry@google.com (Ravi Mistry) - */ -public class MediaHttpUploaderTest extends TestCase { - - private static final String TEST_RESUMABLE_REQUEST_URL = - "http://www.test.com/request/url?uploadType=resumable"; - private static final String TEST_DIRECT_REQUEST_URL = - "http://www.test.com/request/url?uploadType=media"; - private static final String TEST_MULTIPART_REQUEST_URL = - "http://www.test.com/request/url?uploadType=multipart"; - private static final String TEST_UPLOAD_URL = "http://www.test.com/media/upload/location"; - private static final String TEST_CONTENT_TYPE = "image/jpeg"; - - private static Logger LOGGER = Logger.getLogger(HttpTransport.class.getName()); - private Level oldLevel; - - @Override - public void setUp() { - // suppress logging warnings to the console - oldLevel = LOGGER.getLevel(); - LOGGER.setLevel(Level.SEVERE); - } - - @Override - public void tearDown() { - // back to the standard logging level for console - LOGGER.setLevel(oldLevel); - } - - private static class MockHttpContent extends AbstractHttpContent { - - public MockHttpContent() { - super("mock/type"); - } - - public void writeTo(OutputStream out) { - } - } - - static class MediaTransport extends MockHttpTransport { - - int lowLevelExecCalls; - int bytesUploaded; - final int contentLength; - boolean testServerError; - boolean testClientError; - boolean testAuthenticationError; - boolean directUploadEnabled; - boolean directUploadWithMetadata; - boolean contentLengthNotSpecified; - boolean assertTestHeaders; - boolean testIOException; - int maxByteIndexUploadedOnError = MediaHttpUploader.DEFAULT_CHUNK_SIZE - 1; - - /** - * Bytes received by this server or {@code null} for none. To enable test content use the - * following constructor {@link #MediaTransport(int, boolean)}. - */ - byte[] bytesReceived; - - MediaTransport(int contentLength) { - this.contentLength = contentLength; - } - - MediaTransport(int contentLength, boolean testContent) { - this(contentLength); - if (testContent) { - bytesReceived = new byte[contentLength]; - } - } - - @Override - public LowLevelHttpRequest buildRequest(String name, String url) { - if (name.equals("POST")) { - if (directUploadEnabled) { - if (directUploadWithMetadata) { - assertEquals(TEST_MULTIPART_REQUEST_URL, url); - } else { - assertEquals(TEST_DIRECT_REQUEST_URL, url); - } - } else { - assertEquals(TEST_RESUMABLE_REQUEST_URL, url); - } - - return new MockLowLevelHttpRequest() { - @Override - public LowLevelHttpResponse execute() { - lowLevelExecCalls++; - if (!directUploadEnabled) { - // Assert that the required headers are set. - if (!contentLengthNotSpecified) { - assertEquals(Integer.toString(contentLength), - getFirstHeaderValue("x-upload-content-length")); - } - assertEquals(TEST_CONTENT_TYPE, getFirstHeaderValue("x-upload-content-type")); - } - if (assertTestHeaders) { - assertEquals("test-header-value", getFirstHeaderValue("test-header-name")); - } - // This is the initiation call. - MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); - assertFalse(directUploadEnabled && testIOException); - if (directUploadEnabled && testServerError && lowLevelExecCalls == 1) { - // send a server error in the 1st request of a direct upload - response.setStatusCode(500); - } else if (testAuthenticationError) { - // Return 404. - response.setStatusCode(404); - } else { - // Return 200 with the upload URI. - response.setStatusCode(200); - if (!directUploadEnabled) { - response.addHeader("Location", TEST_UPLOAD_URL); - } - } - return response; - } - }; - } - assertEquals(TEST_UPLOAD_URL, url); - assertEquals("PUT", name); - return new MockLowLevelHttpRequest() { - @Override - public LowLevelHttpResponse execute() throws IOException { - lowLevelExecCalls++; - MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); - String contentRangeHeader = getFirstHeaderValue("Content-Range"); - if (testServerError || testIOException) { - // TODO(peleyal): add test with two different failures in a row - switch (lowLevelExecCalls) { - case 3: - int bytesToRead = maxByteIndexUploadedOnError + 1 - bytesUploaded; - copyBytesToBytesReceivedArray(bytesToRead); - bytesUploaded += bytesToRead; - // Send a server error or throw IOException in the 3rd request - if (testIOException) { - throw new IOException(); - } - response.setStatusCode(500); - return response; - case 4: - // Assert that the 4th request is a range query request. - if (contentLengthNotSpecified) { - assertEquals("bytes */*", contentRangeHeader); - } else { - assertEquals("bytes */" + contentLength, contentRangeHeader); - } - // Return 308 in case there are more bytes to upload, otherwise return 200. - // set the Range header with the bytes uploaded so far. - response.setStatusCode( - contentLength == maxByteIndexUploadedOnError + 1 ? 200 : 308); - bytesUploaded = maxByteIndexUploadedOnError + 1; - response.addHeader("Range", "bytes=0-" + maxByteIndexUploadedOnError); - return response; - default: - break; - } - } else if (testClientError) { - // Return a 411. - response.setStatusCode(411); - return response; - } - - String bytesRange; - if (bytesUploaded + MediaHttpUploader.DEFAULT_CHUNK_SIZE > contentLength) { - bytesRange = bytesUploaded + "-" + (contentLength - 1); - } else { - bytesRange = - bytesUploaded + "-" + (bytesUploaded + MediaHttpUploader.DEFAULT_CHUNK_SIZE - 1); - } - String expectedContentRange; - if (contentLength == 0) { - expectedContentRange = "bytes */0"; - } else if (contentLengthNotSpecified - && ((bytesUploaded + MediaHttpUploader.DEFAULT_CHUNK_SIZE) < contentLength)) { - expectedContentRange = "bytes " + bytesRange + "/*"; - } else { - expectedContentRange = "bytes " + bytesRange + "/" + contentLength; - } - - assertEquals(expectedContentRange, contentRangeHeader); - - copyBytesToBytesReceivedArray(-1); - - bytesUploaded += MediaHttpUploader.DEFAULT_CHUNK_SIZE; - - if (bytesUploaded >= contentLength) { - // Return 200 since the upload is complete. - response.setStatusCode(200); - } else { - // Return 308 and the range since the upload is incomplete. - response.setStatusCode(308); - response.addHeader("Range", "bytes=" + bytesRange); - } - return response; - } - - void copyBytesToBytesReceivedArray(int length) throws IOException { - if (bytesReceived == null || length == 0) { - return; - } - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - this.getStreamingContent().writeTo(stream); - byte[] currentRequest = stream.toByteArray(); - System.arraycopy(currentRequest, 0, bytesReceived, bytesUploaded, - length == -1 ? currentRequest.length : length); - } - }; - } - } - - private static class ResumableProgressListenerWithTwoUploadCalls - implements - MediaHttpUploaderProgressListener { - - int progressListenerCalls; - boolean contentLengthNotSpecified; - - public ResumableProgressListenerWithTwoUploadCalls() { - } - - public void progressChanged(MediaHttpUploader uploader) throws IOException { - progressListenerCalls++; - - switch (uploader.getUploadState()) { - case INITIATION_STARTED: - // Assert that the first call is initiation started. - assertEquals(1, progressListenerCalls); - break; - case INITIATION_COMPLETE: - // Assert that the 2nd call is initiation complete. - assertEquals(2, progressListenerCalls); - break; - case MEDIA_IN_PROGRESS: - // Assert that the 3rd call is media in progress and check the progress percent. - assertTrue(progressListenerCalls == 3); - if (contentLengthNotSpecified) { - try { - uploader.getProgress(); - fail("Expected " + IllegalArgumentException.class); - } catch (IllegalArgumentException iae) { - // Expected. - } - } else { - assertEquals(0.5, uploader.getProgress()); - } - break; - case MEDIA_COMPLETE: - // Assert that the 4th call is media complete. - assertEquals(4, progressListenerCalls); - if (contentLengthNotSpecified) { - try { - uploader.getProgress(); - fail("Expected " + IllegalArgumentException.class); - } catch (IllegalArgumentException iae) { - // Expected. - } - } else { - assertEquals(1.0, uploader.getProgress()); - } - break; - } - } - } - - private static class DirectProgressListener implements MediaHttpUploaderProgressListener { - - int progressListenerCalls; - boolean contentLengthNotSpecified; - - public DirectProgressListener() { - } - - public void progressChanged(MediaHttpUploader uploader) throws IOException { - progressListenerCalls++; - - switch (uploader.getUploadState()) { - case MEDIA_IN_PROGRESS: - // Assert that the first call is media in progress. - assertEquals(1, progressListenerCalls); - if (contentLengthNotSpecified) { - try { - uploader.getProgress(); - fail("Expected " + IllegalArgumentException.class); - } catch (IllegalArgumentException iae) { - // Expected. - } - } else { - assertEquals(0.0, uploader.getProgress()); - } - break; - case MEDIA_COMPLETE: - // Assert that the 2nd call is media complete. - assertEquals(2, progressListenerCalls); - if (contentLengthNotSpecified) { - try { - uploader.getProgress(); - fail("Expected " + IllegalArgumentException.class); - } catch (IllegalArgumentException iae) { - // Expected. - } - } else { - assertEquals(1.0, uploader.getProgress()); - } - break; - } - } - } - - private static class GZipCheckerInitializer implements HttpRequestInitializer { - - private boolean gzipDisabled; - - public GZipCheckerInitializer(boolean gzipDisabled) { - this.gzipDisabled = gzipDisabled; - } - - public void initialize(HttpRequest request) { - request.setInterceptor(new GZipCheckerInterceptor(gzipDisabled)); - } - } - - private static class GZipCheckerInterceptor implements HttpExecuteInterceptor { - - private boolean gzipDisabled; - - public GZipCheckerInterceptor(boolean gzipDisabled) { - this.gzipDisabled = gzipDisabled; - } - - public void intercept(HttpRequest request) { - assertEquals(!gzipDisabled && !(request.getContent() instanceof EmptyContent), - request.getEncoding() != null); - } - } - - // TODO(peleyal): ZeroBackOffRequestInitializer can go into http testing package? - - static class ZeroBackOffRequestInitializer implements HttpRequestInitializer { - public void initialize(HttpRequest request) { - request.setIOExceptionHandler(new HttpBackOffIOExceptionHandler(BackOff.ZERO_BACKOFF)); - request.setUnsuccessfulResponseHandler( - new HttpBackOffUnsuccessfulResponseHandler(BackOff.ZERO_BACKOFF)); - } - } - - public void testUploadOneCall() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(contentLength); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - - // There should be 2 calls made. 1 initiation request and 1 upload request. - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testUploadOneCall_WithGZipDisabled() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - fakeTransport.contentLengthNotSpecified = true; - - // Disable GZip content. - MediaHttpUploader uploader = - new MediaHttpUploader(mediaContent, fakeTransport, new GZipCheckerInitializer(true)); - uploader.setDisableGZipContent(true); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - // There should be 2 calls made. 1 initiation request and 1 upload request. - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testUploadOneCall_WithGZipEnabled() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - fakeTransport.contentLengthNotSpecified = true; - - // Enable GZip content. - MediaHttpUploader uploader = - new MediaHttpUploader(mediaContent, fakeTransport, new GZipCheckerInitializer(false)); - uploader.setDisableGZipContent(false); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - // There should be 2 calls made. 1 initiation request and 1 upload request. - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testUploadOneCall_WithDefaultGzip() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - fakeTransport.contentLengthNotSpecified = true; - - // GZip content must be disabled by default. - MediaHttpUploader uploader = - new MediaHttpUploader(mediaContent, fakeTransport, new GZipCheckerInitializer(false)); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - // There should be 2 calls made. 1 initiation request and 1 upload request. - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testUploadOneCall_WithNoContentSizeProvided() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.contentLengthNotSpecified = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - - // There should be 2 calls made. 1 initiation request and 1 upload request. - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testUploadOneCall_WithContentSizeProvided() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE; - MediaTransport fakeTransport = new MediaTransport(contentLength); - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(contentLength); - MediaHttpUploader uploader = - new MediaHttpUploader(mediaContent, fakeTransport, new GZipCheckerInitializer(true)); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - - // There should be 2 calls made. 1 initiation request and 1 upload request. - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testUploadMultipleCalls() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 5; - MediaTransport fakeTransport = new MediaTransport(contentLength); - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(contentLength); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - - // There should be 6 calls made. 1 initiation request and 5 upload requests. - assertEquals(6, fakeTransport.lowLevelExecCalls); - } - - public void testUploadMultipleCalls_WithSpecifiedHeader() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 5; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.assertTestHeaders = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(contentLength); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.getInitiationHeaders().set("test-header-name", "test-header-value"); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - - // There should be 6 calls made. 1 initiation request and 5 upload requests. - assertEquals(6, fakeTransport.lowLevelExecCalls); - } - - public void testUploadMultipleCalls_WithNoContentSizeProvided() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 5; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.contentLengthNotSpecified = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - - // There should be 6 calls made. 1 initiation request and 5 upload requests. - assertEquals(6, fakeTransport.lowLevelExecCalls); - } - - public void testUploadMultipleCalls_WithNoContentSizeProvidedChunkedInput() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 5; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.contentLengthNotSpecified = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]) { - @Override - public synchronized int read(byte[] b, int off, int len) { - return super.read(b, off, Math.min(len, MediaHttpUploader.DEFAULT_CHUNK_SIZE / 10)); - } - }; - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - - // There should be 6 calls made. 1 initiation request and 5 upload requests. - assertEquals(6, fakeTransport.lowLevelExecCalls); - } - - public void testUploadMultipleCalls_WithNoContentSizeProvided_WithExtraByte() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 5 + 1; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.contentLengthNotSpecified = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - - // There should be 7 calls made. 1 initiation request and 6 upload requests. - assertEquals(7, fakeTransport.lowLevelExecCalls); - } - - public void testUploadProgressListener() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(contentLength); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.setProgressListener(new ResumableProgressListenerWithTwoUploadCalls()); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - } - - public void testUploadProgressListener_WithNoContentSizeProvided() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.contentLengthNotSpecified = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - ResumableProgressListenerWithTwoUploadCalls listener = - new ResumableProgressListenerWithTwoUploadCalls(); - listener.contentLengthNotSpecified = true; - uploader.setProgressListener(listener); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - } - - public void testUploadServerError_WithoutUnsuccessfulHandler() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.testServerError = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(contentLength); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - - HttpResponse response = uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - assertEquals(500, response.getStatusCode()); - - // There should be 3 calls made. 1 initiation request, 1 successful upload request and 1 upload - // request with server error - assertEquals(3, fakeTransport.lowLevelExecCalls); - } - - public void testUpload_ResumableIOException_WithIOExceptionHandler() throws Exception { - subtestUpload_ResumableWithError(ErrorType.IO_EXCEPTION); - } - - public void testUpload_ResumableServerError_WithoutUnsuccessfulHandler() throws Exception { - subtestUpload_ResumableWithError(ErrorType.SERVER_UNAVAILABLE); - } - - private void subtestUpload_ResumableWithError(ErrorType error) throws Exception { - // no bytes were uploaded on the 2nd chunk. Client sends the following 3 media chunks: - // 0-[DEFAULT-1], DEFAULT-[2*DEFAULT-1], DEFAULT-[2*DEFAULT-1] - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2, false, - MediaHttpUploader.DEFAULT_CHUNK_SIZE - 1, 3); - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2, true, - MediaHttpUploader.DEFAULT_CHUNK_SIZE - 1, 3); - - // no bytes were uploaded on the 2nd chunk. Client sends the following 4 media chunks: - // 0-[DEFAULT-1], DEFAULT-[2*DEFAULT-1], DEFAULT-[2*DEFAULT-1], 2*DEFAULT-[3*DEFAULT-1] - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 3, false, - MediaHttpUploader.DEFAULT_CHUNK_SIZE - 1, 4); - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 3, true, - MediaHttpUploader.DEFAULT_CHUNK_SIZE - 1, 4); - - // all bytes were uploaded in the 2nd chunk. Client sends the following 2 media chunks: - // 0-[DEFAULT-1], DEFAULT-[2*DEFAULT-1] - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2, false, - MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2 - 1, 2); - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2, true, - MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2 - 1, 2); - - // all bytes were uploaded in the 2nd chunk. Client sends the following 3 media chunks: - // 0-[DEFAULT-1], DEFAULT-[2*DEFAULT-1], 2*DEFAULT-[3*DEFAULT-1] - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 3, false, - MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2 - 1, 3); - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 3, true, - MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2 - 1, 3); - - // part of the bytes were uploaded in the 2nd chunk. Client sends the following 3 media chunks: - // 0-[DEFAULT-1], DEFAULT-[2*DEFAULT-1], DEFAULT*4/3-[2*DEFAULT-1] - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2, false, - MediaHttpUploader.DEFAULT_CHUNK_SIZE * 4 / 3, 3); - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2, true, - MediaHttpUploader.DEFAULT_CHUNK_SIZE * 4 / 3, 3); - - // part of the bytes were uploaded in the 2nd chunk. Client sends the following 3 media chunks: - // 0-[DEFAULT-1], DEFAULT-[2*DEFAULT-1], DEFAULT+5/[2*DEFAULT+2] - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2 + 3, false, - MediaHttpUploader.DEFAULT_CHUNK_SIZE + 4, 3); - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2 + 3, true, - MediaHttpUploader.DEFAULT_CHUNK_SIZE + 4, 3); - - // only 1 byte were uploaded in the 2nd chunk. Client sends the following 3 media chunks: - // 0-[DEFAULT-1], DEFAULT-[2*DEFAULT-1], [DEFAULT+1]-[2*DEFAULT-1] - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2, false, - MediaHttpUploader.DEFAULT_CHUNK_SIZE, 3); - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2, true, - MediaHttpUploader.DEFAULT_CHUNK_SIZE, 3); - - // only 1 byte were uploaded in the 2nd chunk. Client sends the following 5 media chunks: - // 0-[DEFAULT-1], DEFAULT-[2*DEFAULT-1], [DEFAULT+1]-[2*DEFAULT], [2*DEFAULT+1]-[3*DEFAULT], - // [3*DEFAULT+1]-[3*DEFAULT+1] - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 3 + 2, false, - MediaHttpUploader.DEFAULT_CHUNK_SIZE, 5); - subtestUpload_ResumableWithError(error, MediaHttpUploader.DEFAULT_CHUNK_SIZE * 3 + 2, true, - MediaHttpUploader.DEFAULT_CHUNK_SIZE, 5); - } - - /** - * Error type represents an error (I/O exception or server unavailable error) which will be raise - * when uploading media to the server. - */ - enum ErrorType { - IO_EXCEPTION, SERVER_UNAVAILABLE - } - - public void subtestUpload_ResumableWithError(ErrorType error, int contentLength, - boolean contentLengthKnown, int maxByteIndexUploadedOnError, int chunks) throws Exception { - MediaTransport fakeTransport = new MediaTransport(contentLength, true); - if (error == ErrorType.IO_EXCEPTION) { - fakeTransport.testIOException = true; - } else if (error == ErrorType.SERVER_UNAVAILABLE) { - fakeTransport.testServerError = true; - } - fakeTransport.contentLengthNotSpecified = !contentLengthKnown; - fakeTransport.maxByteIndexUploadedOnError = maxByteIndexUploadedOnError; - byte[] testedData = new byte[contentLength]; - new Random().nextBytes(testedData); - InputStream is = new ByteArrayInputStream(testedData); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - if (contentLengthKnown) { - mediaContent.setLength(contentLength); - } - MediaHttpUploader uploader = - new MediaHttpUploader(mediaContent, fakeTransport, new ZeroBackOffRequestInitializer()); - - // disable GZip - so we would be able to test byte received by server. - uploader.setDisableGZipContent(true); - HttpResponse response = uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - assertEquals(200, response.getStatusCode()); - - // There should be the following number of calls made: - // 1 initiation request + 1 call to query the range + chunks - int calls = 2 + chunks; - assertEquals(calls, fakeTransport.lowLevelExecCalls); - - assertTrue(Arrays.equals(testedData, fakeTransport.bytesReceived)); - } - - public void testUploadIOException_WithoutIOExceptionHandler() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.testIOException = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(contentLength); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - - try { - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - fail("expected " + IOException.class); - } catch (IOException e) { - // There should be 3 calls made. 1 initiation request, 1 successful upload request, - // and 1 upload request with server error - assertEquals(3, fakeTransport.lowLevelExecCalls); - } - } - - public void testUploadServerErrorWithBackOffDisabled_WithNoContentSizeProvided() - throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.testServerError = true; - fakeTransport.contentLengthNotSpecified = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - - HttpResponse response = uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - assertEquals(500, response.getStatusCode()); - - // There should be 3 calls made. 1 initiation request, 1 successful upload request and 1 upload - // request with server error - assertEquals(3, fakeTransport.lowLevelExecCalls); - } - - public void testUploadAuthenticationError() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.testAuthenticationError = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(contentLength); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - - HttpResponse response = uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - assertEquals(404, response.getStatusCode()); - - // There should be only 1 initiation request made with a 404. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testUploadClientErrorInUploadCalls() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.testClientError = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(contentLength); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - - HttpResponse response = uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - assertEquals(411, response.getStatusCode()); - - // There should be 2 calls made. 1 initiation request and 1 upload request that returned a 411. - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testUploadClientErrorInUploadCalls_WithNoContentSizeProvided() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.testClientError = true; - fakeTransport.contentLengthNotSpecified = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - - HttpResponse response = uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - assertEquals(411, response.getStatusCode()); - - // There should be 2 calls made. 1 initiation request and 1 upload request that returned a 411. - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testDirectMediaUpload() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.directUploadEnabled = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(contentLength); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.setProgressListener(new DirectProgressListener()); - // Enable direct media upload. - uploader.setDirectUploadEnabled(true); - - HttpResponse response = uploader.upload(new GenericUrl(TEST_DIRECT_REQUEST_URL)); - assertEquals(200, response.getStatusCode()); - - // There should be only 1 call made for direct media upload. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testDirectMediaUpload_WithSpecifiedHeader() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.directUploadEnabled = true; - fakeTransport.assertTestHeaders = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(contentLength); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.getInitiationHeaders().set("test-header-name", "test-header-value"); - uploader.setProgressListener(new DirectProgressListener()); - // Enable direct media upload. - uploader.setDirectUploadEnabled(true); - - HttpResponse response = uploader.upload(new GenericUrl(TEST_DIRECT_REQUEST_URL)); - assertEquals(200, response.getStatusCode()); - - // There should be only 1 call made for direct media upload. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testDirectMediaUpload_WithNoContentSizeProvided() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.directUploadEnabled = true; - fakeTransport.contentLengthNotSpecified = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - DirectProgressListener listener = new DirectProgressListener(); - listener.contentLengthNotSpecified = true; - uploader.setProgressListener(listener); - // Enable direct media upload. - uploader.setDirectUploadEnabled(true); - - HttpResponse response = uploader.upload(new GenericUrl(TEST_DIRECT_REQUEST_URL)); - assertEquals(200, response.getStatusCode()); - - // There should be only 1 call made for direct media upload. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testDirectMediaUploadWithMetadata() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.directUploadEnabled = true; - fakeTransport.directUploadWithMetadata = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(contentLength); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.setProgressListener(new DirectProgressListener()); - // Enable direct media upload. - uploader.setDirectUploadEnabled(true); - // Set Metadata - uploader.setMetadata(new MockHttpContent()); - - HttpResponse response = uploader.upload(new GenericUrl(TEST_MULTIPART_REQUEST_URL)); - assertEquals(200, response.getStatusCode()); - - // There should be only 1 call made for direct media upload. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testDirectMediaUploadWithMetadata_WithNoContentSizeProvided() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.directUploadEnabled = true; - fakeTransport.contentLengthNotSpecified = true; - fakeTransport.directUploadWithMetadata = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - DirectProgressListener listener = new DirectProgressListener(); - listener.contentLengthNotSpecified = true; - uploader.setProgressListener(listener); - // Enable direct media upload. - uploader.setDirectUploadEnabled(true); - // Set Metadata - uploader.setMetadata(new MockHttpContent()); - - HttpResponse response = uploader.upload(new GenericUrl(TEST_MULTIPART_REQUEST_URL)); - assertEquals(200, response.getStatusCode()); - - // There should be only 1 call made for direct media upload. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testSetChunkSize() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.directUploadEnabled = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - - // None of the below should throw Exceptions. - uploader.setChunkSize(MediaHttpUploader.DEFAULT_CHUNK_SIZE); - uploader.setChunkSize(MediaHttpUploader.MINIMUM_CHUNK_SIZE); - uploader.setChunkSize(MediaHttpUploader.MINIMUM_CHUNK_SIZE * 2); - uploader.setChunkSize(MediaHttpUploader.MINIMUM_CHUNK_SIZE * 3); - uploader.setChunkSize(MediaHttpUploader.MINIMUM_CHUNK_SIZE * 100); - - // Assert that specifying invalid chunk sizes throws an Exception. - try { - uploader.setChunkSize(MediaHttpUploader.MINIMUM_CHUNK_SIZE - 1); - fail("Expected " + IllegalArgumentException.class); - } catch (IllegalArgumentException iae) { - // Expected. - } - try { - uploader.setChunkSize(MediaHttpUploader.MINIMUM_CHUNK_SIZE + 1); - fail("Expected " + IllegalArgumentException.class); - } catch (IllegalArgumentException iae) { - // Expected. - } - try { - uploader.setChunkSize((int) (MediaHttpUploader.MINIMUM_CHUNK_SIZE * 2.5)); - fail("Expected " + IllegalArgumentException.class); - } catch (IllegalArgumentException iae) { - // Expected. - } - } - - public void testDirectUploadServerErrorWithBackOffEnabled() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.testServerError = true; - fakeTransport.directUploadEnabled = true; - ByteArrayContent mediaContent = - new ByteArrayContent(TEST_CONTENT_TYPE, new byte[contentLength]); - MediaHttpUploader uploader = - new MediaHttpUploader(mediaContent, fakeTransport, new ZeroBackOffRequestInitializer()); - uploader.setDirectUploadEnabled(true); - uploader.upload(new GenericUrl(TEST_DIRECT_REQUEST_URL)); - - // should be 2 calls made: 1 upload request with server error, 1 successful upload request - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testDirectUploadServerErrorWithBackOffDisabled() throws Exception { - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE * 2; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.testServerError = true; - fakeTransport.directUploadEnabled = true; - ByteArrayContent mediaContent = - new ByteArrayContent(TEST_CONTENT_TYPE, new byte[contentLength]); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.setDirectUploadEnabled(true); - uploader.upload(new GenericUrl(TEST_DIRECT_REQUEST_URL)); - - // should be 1 call made: 1 upload request with server error - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testDirectMediaUploadWithZeroContent() throws Exception { - int contentLength = 0; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.directUploadEnabled = true; - ByteArrayContent mediaContent = - new ByteArrayContent(TEST_CONTENT_TYPE, new byte[contentLength]); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.setDirectUploadEnabled(true); - uploader.upload(new GenericUrl(TEST_DIRECT_REQUEST_URL)); - - // There should be only 1 call made for direct media upload. - assertEquals(1, fakeTransport.lowLevelExecCalls); - } - - public void testResumableMediaUploadWithZeroContent() throws Exception { - int contentLength = 0; - MediaTransport fakeTransport = new MediaTransport(contentLength); - ByteArrayContent mediaContent = - new ByteArrayContent(TEST_CONTENT_TYPE, new byte[contentLength]); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - - // There should be 2 calls made. 1 initiation request and 1 upload request. - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testResumableMediaUploadWithZeroContentOfUnknownLength() throws Exception { - int contentLength = 0; - MediaTransport fakeTransport = new MediaTransport(contentLength); - fakeTransport.contentLengthNotSpecified = true; - InputStream is = new ByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - - // There should be 2 calls made. 1 initiation request and 1 upload request. - assertEquals(2, fakeTransport.lowLevelExecCalls); - } - - public void testResumableMediaUploadWithContentClose() throws Exception { - int contentLength = 0; - MediaTransport fakeTransport = new MediaTransport(contentLength); - TestableByteArrayInputStream inputStream = - new TestableByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = - new InputStreamContent(TEST_CONTENT_TYPE, inputStream).setLength(contentLength); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - assertTrue(inputStream.isClosed()); - } - - public void testResumableMediaUploadWithoutContentClose() throws Exception { - int contentLength = 0; - MediaTransport fakeTransport = new MediaTransport(contentLength); - TestableByteArrayInputStream inputStream = - new TestableByteArrayInputStream(new byte[contentLength]); - InputStreamContent mediaContent = new InputStreamContent( - TEST_CONTENT_TYPE, inputStream).setLength(contentLength).setCloseInputStream(false); - MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null); - uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL)); - assertFalse(inputStream.isClosed()); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequestTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequestTest.java deleted file mode 100644 index b620ae7e..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequestTest.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services; - -import com.google.api.client.googleapis.testing.services.MockGoogleClient; -import com.google.api.client.googleapis.testing.services.MockGoogleClientRequest; -import com.google.api.client.http.EmptyContent; -import com.google.api.client.http.HttpMethods; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpResponseException; -import com.google.api.client.http.HttpStatusCodes; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.LowLevelHttpRequest; -import com.google.api.client.http.LowLevelHttpResponse; -import com.google.api.client.json.Json; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonObjectParser; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpRequest; -import com.google.api.client.testing.http.MockLowLevelHttpResponse; -import com.google.api.client.util.StringUtils; - -import junit.framework.TestCase; - -import java.io.IOException; -import java.util.Arrays; - -/** - * Tests {@link AbstractGoogleClientRequest}. - * - * @author Yaniv Inbar - */ -public class AbstractGoogleClientRequestTest extends TestCase { - - private static final String ROOT_URL = "https://www.googleapis.com/test/"; - private static final String SERVICE_PATH = "path/v1/"; - private static final String URI_TEMPLATE = "tests/{testId}"; - private static final JsonFactory JSON_FACTORY = new JacksonFactory(); - private static final JsonObjectParser JSON_OBJECT_PARSER = new JsonObjectParser(JSON_FACTORY); - private static final String ERROR_CONTENT = - "{\"error\":{\"code\":401,\"errors\":[{\"domain\":\"global\"," - + "\"location\":\"Authorization\",\"locationType\":\"header\"," - + "\"message\":\"me\",\"reason\":\"authError\"}],\"message\":\"me\"}}"; - - public void testExecuteUnparsed_error() throws Exception { - HttpTransport transport = new MockHttpTransport() { - @Override - public LowLevelHttpRequest buildRequest(final String method, final String url) { - return new MockLowLevelHttpRequest() { - @Override - public LowLevelHttpResponse execute() { - assertEquals("GET", method); - assertEquals("https://www.googleapis.com/test/path/v1/tests/foo", url); - MockLowLevelHttpResponse result = new MockLowLevelHttpResponse(); - result.setStatusCode(HttpStatusCodes.STATUS_CODE_UNAUTHORIZED); - result.setContentType(Json.MEDIA_TYPE); - result.setContent(ERROR_CONTENT); - return result; - } - }; - } - }; - MockGoogleClient client = new MockGoogleClient.Builder( - transport, ROOT_URL, SERVICE_PATH, JSON_OBJECT_PARSER, null).setApplicationName( - "Test Application").build(); - MockGoogleClientRequest request = new MockGoogleClientRequest( - client, HttpMethods.GET, URI_TEMPLATE, null, String.class); - try { - request.put("testId", "foo"); - request.executeUnparsed(); - fail("expected " + HttpResponseException.class); - } catch (HttpResponseException e) { - // expected - assertEquals("401" + StringUtils.LINE_SEPARATOR + ERROR_CONTENT, e.getMessage()); - } - } - - public void testExecuteUsingHead() throws Exception { - HttpTransport transport = new MockHttpTransport() { - @Override - public LowLevelHttpRequest buildRequest(final String method, final String url) { - return new MockLowLevelHttpRequest() { - @Override - public LowLevelHttpResponse execute() { - assertEquals("HEAD", method); - assertEquals("https://www.googleapis.com/test/path/v1/tests/foo", url); - return new MockLowLevelHttpResponse(); - } - }; - } - }; - MockGoogleClient client = new MockGoogleClient.Builder( - transport, ROOT_URL, SERVICE_PATH, JSON_OBJECT_PARSER, null).setApplicationName( - "Test Application").build(); - MockGoogleClientRequest request = new MockGoogleClientRequest( - client, HttpMethods.GET, URI_TEMPLATE, null, String.class); - request.put("testId", "foo"); - request.executeUsingHead(); - } - - public void testBuildHttpRequest_emptyContent() throws Exception { - for (String method : Arrays.asList("GET", "HEAD", "DELETE", "FOO")) { - subtestBuildHttpRequest_emptyContent(method, false); - } - for (String method : Arrays.asList("POST", "PUT", "PATCH")) { - subtestBuildHttpRequest_emptyContent(method, true); - } - } - - private void subtestBuildHttpRequest_emptyContent(String method, boolean expectEmptyContent) - throws Exception { - HttpTransport transport = new MockHttpTransport(); - MockGoogleClient client = new MockGoogleClient.Builder( - transport, ROOT_URL, SERVICE_PATH, JSON_OBJECT_PARSER, null).setApplicationName( - "Test Application").build(); - MockGoogleClientRequest request = - new MockGoogleClientRequest(client, method, URI_TEMPLATE, null, String.class); - HttpRequest httpRequest = request.buildHttpRequest(); - if (expectEmptyContent) { - assertTrue(httpRequest.getContent() instanceof EmptyContent); - } else { - assertNull(httpRequest.getContent()); - } - } - - public void testCheckRequiredParameter() throws Exception { - HttpTransport transport = new MockHttpTransport(); - MockGoogleClient client = new MockGoogleClient.Builder( - transport, ROOT_URL, SERVICE_PATH, JSON_OBJECT_PARSER, null).setApplicationName( - "Test Application").build(); - MockGoogleClientRequest request = new MockGoogleClientRequest( - client, HttpMethods.GET, URI_TEMPLATE, null, String.class); - - // Should not throw an Exception. - request.checkRequiredParameter("Not Null", "notNull()"); - - try { - request.checkRequiredParameter(null, "content.getTest().getAnotherTest()"); - fail("Expected " + IllegalArgumentException.class); - } catch (IllegalArgumentException iae) { - // Expected. - } - } - - public void testExecute_void() throws Exception { - HttpTransport transport = new MockHttpTransport() { - @Override - public LowLevelHttpRequest buildRequest(final String method, final String url) { - return new MockLowLevelHttpRequest() { - @Override - public LowLevelHttpResponse execute() { - return new MockLowLevelHttpResponse().setContent("{\"a\":\"ignored\"}") - .setContentType(Json.MEDIA_TYPE); - } - }; - } - }; - MockGoogleClient client = new MockGoogleClient.Builder( - transport, ROOT_URL, SERVICE_PATH, JSON_OBJECT_PARSER, null).setApplicationName( - "Test Application").build(); - MockGoogleClientRequest request = - new MockGoogleClientRequest(client, HttpMethods.GET, URI_TEMPLATE, null, Void.class); - Void v = request.execute(); - assertNull(v); - } - - public void testUserAgentSuffix() throws Exception { - AssertUserAgentTransport transport = new AssertUserAgentTransport(); - - // Specify an Application Name. - String applicationName = "Test Application"; - transport.expectedUserAgent = applicationName + " " - + AbstractGoogleClientRequest.USER_AGENT_SUFFIX + " " - + HttpRequest.USER_AGENT_SUFFIX; - MockGoogleClient client = new MockGoogleClient.Builder( - transport, ROOT_URL, SERVICE_PATH, JSON_OBJECT_PARSER, null).setApplicationName( - applicationName).build(); - MockGoogleClientRequest request = - new MockGoogleClientRequest(client, HttpMethods.GET, URI_TEMPLATE, null, Void.class); - request.executeUnparsed(); - - // Don't specify an Application Name. - transport.expectedUserAgent = AbstractGoogleClientRequest.USER_AGENT_SUFFIX + " " - + HttpRequest.USER_AGENT_SUFFIX; - client = new MockGoogleClient.Builder( - transport, ROOT_URL, SERVICE_PATH, JSON_OBJECT_PARSER, null).build(); - request = - new MockGoogleClientRequest(client, HttpMethods.GET, URI_TEMPLATE, null, Void.class); - request.executeUnparsed(); - } - - private class AssertUserAgentTransport extends MockHttpTransport { - String expectedUserAgent; - - @Override - public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { - return new MockLowLevelHttpRequest() { - @Override - public LowLevelHttpResponse execute() throws IOException { - assertEquals(expectedUserAgent, getFirstHeaderValue("User-Agent")); - return new MockLowLevelHttpResponse(); - } - }; - } - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/services/AbstractGoogleClientTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/services/AbstractGoogleClientTest.java deleted file mode 100644 index 2918e532..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/services/AbstractGoogleClientTest.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services; - -import com.google.api.client.googleapis.media.MediaHttpUploader; -import com.google.api.client.googleapis.testing.services.MockGoogleClient; -import com.google.api.client.googleapis.testing.services.MockGoogleClientRequest; -import com.google.api.client.http.EmptyContent; -import com.google.api.client.http.HttpExecuteInterceptor; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestInitializer; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.InputStreamContent; -import com.google.api.client.http.LowLevelHttpRequest; -import com.google.api.client.http.LowLevelHttpResponse; -import com.google.api.client.json.Json; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonObjectParser; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpRequest; -import com.google.api.client.testing.http.MockLowLevelHttpResponse; -import com.google.api.client.util.Key; - -import junit.framework.TestCase; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; - -/** - * Tests {@link AbstractGoogleClient}. - * - * @author Yaniv Inbar - */ -public class AbstractGoogleClientTest extends TestCase { - - private static final JsonFactory JSON_FACTORY = new JacksonFactory(); - private static final JsonObjectParser JSON_OBJECT_PARSER = new JsonObjectParser(JSON_FACTORY); - private static final HttpTransport TRANSPORT = new MockHttpTransport(); - - static private class TestRemoteRequestInitializer implements GoogleClientRequestInitializer { - - boolean isCalled; - - TestRemoteRequestInitializer() { - } - - public void initialize(AbstractGoogleClientRequest request) { - isCalled = true; - } - } - - public void testGoogleClientBuilder() { - String rootUrl = "http://www.testgoogleapis.com/test/"; - String servicePath = "path/v1/"; - GoogleClientRequestInitializer jsonHttpRequestInitializer = new TestRemoteRequestInitializer(); - String applicationName = "Test Application"; - - AbstractGoogleClient.Builder setApplicationName = new MockGoogleClient.Builder( - TRANSPORT, rootUrl, servicePath, JSON_OBJECT_PARSER, null).setApplicationName( - applicationName).setGoogleClientRequestInitializer(jsonHttpRequestInitializer) - .setSuppressAllChecks(true); - AbstractGoogleClient client = setApplicationName.build(); - - assertEquals(rootUrl + servicePath, client.getBaseUrl()); - assertEquals(rootUrl, client.getRootUrl()); - assertEquals(servicePath, client.getServicePath()); - assertEquals(applicationName, client.getApplicationName()); - assertEquals(jsonHttpRequestInitializer, client.getGoogleClientRequestInitializer()); - assertTrue(client.getSuppressPatternChecks()); - assertTrue(client.getSuppressRequiredParameterChecks()); - } - - public void testGoogleClientSuppressionDefaults() { - String rootUrl = "http://www.testgoogleapis.com/test/"; - String servicePath = "path/v1/"; - - // Assert suppression defaults. - AbstractGoogleClient.Builder googleClientBuilder = new MockGoogleClient.Builder( - TRANSPORT, rootUrl, servicePath, JSON_OBJECT_PARSER, null); - assertFalse(googleClientBuilder.getSuppressPatternChecks()); - assertFalse(googleClientBuilder.getSuppressRequiredParameterChecks()); - - AbstractGoogleClient googleClient = googleClientBuilder.build(); - assertFalse(googleClient.getSuppressPatternChecks()); - assertFalse(googleClient.getSuppressRequiredParameterChecks()); - } - - public void testBaseServerAndBasePathBuilder() { - AbstractGoogleClient client = new MockGoogleClient.Builder( - TRANSPORT, "http://www.testgoogleapis.com/test/", "path/v1/", JSON_OBJECT_PARSER, - null).setApplicationName("Test Application") - .setRootUrl("http://www.googleapis.com/test/").setServicePath("path/v2/").build(); - - assertEquals("http://www.googleapis.com/test/path/v2/", client.getBaseUrl()); - } - - public void testInitialize() throws Exception { - TestRemoteRequestInitializer remoteRequestInitializer = new TestRemoteRequestInitializer(); - AbstractGoogleClient client = new MockGoogleClient.Builder( - TRANSPORT, "http://www.test.com/", "", JSON_OBJECT_PARSER, null).setApplicationName( - "Test Application").setGoogleClientRequestInitializer(remoteRequestInitializer).build(); - client.initialize(null); - assertTrue(remoteRequestInitializer.isCalled); - } - - private static final String TEST_RESUMABLE_REQUEST_URL = - "http://www.test.com/request/url?uploadType=resumable"; - private static final String TEST_UPLOAD_URL = "http://www.test.com/media/upload/location"; - private static final String TEST_CONTENT_TYPE = "image/jpeg"; - - private static class MediaTransport extends MockHttpTransport { - - int bytesUploaded; - int contentLength = MediaHttpUploader.DEFAULT_CHUNK_SIZE; - boolean contentLengthNotSpecified; - - protected MediaTransport() { - } - - @Override - public LowLevelHttpRequest buildRequest(String name, String url) { - if (name.equals("POST")) { - assertEquals(TEST_RESUMABLE_REQUEST_URL, url); - - return new MockLowLevelHttpRequest() { - @Override - public LowLevelHttpResponse execute() { - // Assert that the required headers are set. - if (!contentLengthNotSpecified) { - assertEquals( - Integer.toString(contentLength), getFirstHeaderValue("x-upload-content-length")); - } - assertEquals(TEST_CONTENT_TYPE, getFirstHeaderValue("x-upload-content-type")); - // This is the initiation call. Return 200 with the upload URI. - MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); - response.setStatusCode(200); - response.addHeader("Location", TEST_UPLOAD_URL); - return response; - } - }; - } - assertEquals(TEST_UPLOAD_URL, url); - - return new MockLowLevelHttpRequest() { - @Override - public LowLevelHttpResponse execute() { - MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); - - String bytesRange = - bytesUploaded + "-" + (bytesUploaded + MediaHttpUploader.DEFAULT_CHUNK_SIZE - 1); - String expectedContentRange = "bytes " + bytesRange + "/" + contentLength; - assertEquals(expectedContentRange, getFirstHeaderValue("Content-Range")); - bytesUploaded += MediaHttpUploader.DEFAULT_CHUNK_SIZE; - - if (bytesUploaded == contentLength) { - // Return 200 since the upload is complete. - response.setStatusCode(200); - response.setContent("{\"foo\":\"somevalue\"}"); - response.setContentType(Json.MEDIA_TYPE); - } else { - // Return 308 and the range since the upload is incomplete. - response.setStatusCode(308); - response.addHeader("Range", bytesRange); - } - return response; - } - }; - } - } - - public static class A { - @Key - String foo; - } - - public void testMediaUpload() throws Exception { - MediaTransport transport = new MediaTransport(); - AbstractGoogleClient client = new MockGoogleClient.Builder( - transport, TEST_RESUMABLE_REQUEST_URL, "", JSON_OBJECT_PARSER, null).setApplicationName( - "Test Application").build(); - InputStream is = new ByteArrayInputStream(new byte[MediaHttpUploader.DEFAULT_CHUNK_SIZE]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - mediaContent.setLength(MediaHttpUploader.DEFAULT_CHUNK_SIZE); - MockGoogleClientRequest rq = - new MockGoogleClientRequest(client, "POST", "", null, A.class); - rq.initializeMediaUpload(mediaContent); - A result = rq.execute(); - assertEquals("somevalue", result.foo); - } - - private static class GZipCheckerInitializer implements HttpRequestInitializer { - - private boolean gzipDisabled; - - public GZipCheckerInitializer(boolean gzipDisabled) { - this.gzipDisabled = gzipDisabled; - } - - public void initialize(HttpRequest request) { - request.setInterceptor(new GZipCheckerInterceptor(gzipDisabled)); - } - } - - private static class GZipCheckerInterceptor implements HttpExecuteInterceptor { - - private boolean gzipDisabled; - - public GZipCheckerInterceptor(boolean gzipDisabled) { - this.gzipDisabled = gzipDisabled; - } - - public void intercept(HttpRequest request) { - assertEquals(!gzipDisabled && !(request.getContent() instanceof EmptyContent), - request.getEncoding() != null); - } - } - - public void testMediaUpload_disableGZip() throws Exception { - MediaTransport transport = new MediaTransport(); - transport.contentLengthNotSpecified = true; - AbstractGoogleClient client = new MockGoogleClient.Builder( - transport, TEST_RESUMABLE_REQUEST_URL, "", JSON_OBJECT_PARSER, - new GZipCheckerInitializer(true)).setApplicationName("Test Application").build(); - InputStream is = new ByteArrayInputStream(new byte[MediaHttpUploader.DEFAULT_CHUNK_SIZE]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MockGoogleClientRequest rq = - new MockGoogleClientRequest(client, "POST", "", null, A.class); - rq.initializeMediaUpload(mediaContent); - rq.setDisableGZipContent(true); - A result = rq.execute(); - assertEquals("somevalue", result.foo); - } - - public void testMediaUpload_enableGZip() throws Exception { - MediaTransport transport = new MediaTransport(); - transport.contentLengthNotSpecified = true; - AbstractGoogleClient client = new MockGoogleClient.Builder( - transport, TEST_RESUMABLE_REQUEST_URL, "", JSON_OBJECT_PARSER, - new GZipCheckerInitializer(false)).setApplicationName("Test Application").build(); - InputStream is = new ByteArrayInputStream(new byte[MediaHttpUploader.DEFAULT_CHUNK_SIZE]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MockGoogleClientRequest rq = - new MockGoogleClientRequest(client, "POST", "", null, A.class); - rq.initializeMediaUpload(mediaContent); - rq.setDisableGZipContent(false); - A result = rq.execute(); - assertEquals("somevalue", result.foo); - } - - public void testMediaUpload_defaultGZip() throws Exception { - MediaTransport transport = new MediaTransport(); - transport.contentLengthNotSpecified = true; - AbstractGoogleClient client = new MockGoogleClient.Builder( - transport, TEST_RESUMABLE_REQUEST_URL, "", JSON_OBJECT_PARSER, - new GZipCheckerInitializer(false)).setApplicationName("Test Application").build(); - InputStream is = new ByteArrayInputStream(new byte[MediaHttpUploader.DEFAULT_CHUNK_SIZE]); - InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is); - MockGoogleClientRequest rq = - new MockGoogleClientRequest(client, "POST", "", null, A.class); - rq.initializeMediaUpload(mediaContent); - A result = rq.execute(); - assertEquals("somevalue", result.foo); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/services/CommonGoogleClientRequestInitializerTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/services/CommonGoogleClientRequestInitializerTest.java deleted file mode 100644 index 8c73a0e3..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/services/CommonGoogleClientRequestInitializerTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services; - -import com.google.api.client.googleapis.testing.services.MockGoogleClient; -import com.google.api.client.http.HttpContent; -import com.google.api.client.testing.http.HttpTesting; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.util.Key; - -import junit.framework.TestCase; - -/** - * Tests {@link CommonGoogleClientRequestInitializer}. - * - * @author Yaniv Inbar - */ -public class CommonGoogleClientRequestInitializerTest extends TestCase { - - public static class MyRequest extends AbstractGoogleClientRequest { - @Key - String key; - - protected MyRequest(MockGoogleClient client, String method, String uriTemplate, - HttpContent content, Class responseClass) { - super(client, method, uriTemplate, content, responseClass); - } - } - - public void testInitialize() throws Exception { - CommonGoogleClientRequestInitializer key = new CommonGoogleClientRequestInitializer("foo"); - MockGoogleClient client = new MockGoogleClient.Builder(new MockHttpTransport(), - HttpTesting.SIMPLE_URL, "test/", null, null).setApplicationName("Test Application").build(); - MyRequest request = new MyRequest(client, "GET", "", null, String.class); - assertNull(request.key); - key.initialize(request); - assertEquals("foo", request.key); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/services/json/AbstractGoogleJsonClientTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/services/json/AbstractGoogleJsonClientTest.java deleted file mode 100644 index 4ec6a856..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/services/json/AbstractGoogleJsonClientTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services.json; - -import com.google.api.client.googleapis.json.GoogleJsonError; -import com.google.api.client.googleapis.json.GoogleJsonResponseException; -import com.google.api.client.googleapis.testing.services.json.MockGoogleJsonClient; -import com.google.api.client.googleapis.testing.services.json.MockGoogleJsonClientRequest; -import com.google.api.client.http.HttpStatusCodes; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.LowLevelHttpRequest; -import com.google.api.client.http.LowLevelHttpResponse; -import com.google.api.client.json.Json; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.HttpTesting; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.testing.http.MockLowLevelHttpRequest; -import com.google.api.client.testing.http.MockLowLevelHttpResponse; - -import junit.framework.TestCase; - -/** - * Tests {@link AbstractGoogleJsonClient}. - * - * @author Yaniv Inbar - */ -public class AbstractGoogleJsonClientTest extends TestCase { - - public void testExecuteUnparsed_error() throws Exception { - HttpTransport transport = new MockHttpTransport() { - @Override - public LowLevelHttpRequest buildRequest(String name, String url) { - return new MockLowLevelHttpRequest() { - @Override - public LowLevelHttpResponse execute() { - MockLowLevelHttpResponse result = new MockLowLevelHttpResponse(); - result.setStatusCode(HttpStatusCodes.STATUS_CODE_UNAUTHORIZED); - result.setContentType(Json.MEDIA_TYPE); - result.setContent("{\"error\":{\"code\":401,\"errors\":[{\"domain\":\"global\"," - + "\"location\":\"Authorization\",\"locationType\":\"header\"," - + "\"message\":\"me\",\"reason\":\"authError\"}],\"message\":\"me\"}}"); - return result; - } - }; - } - }; - JsonFactory jsonFactory = new JacksonFactory(); - MockGoogleJsonClient client = new MockGoogleJsonClient.Builder( - transport, jsonFactory, HttpTesting.SIMPLE_URL, "", null, false).setApplicationName( - "Test Application").build(); - MockGoogleJsonClientRequest request = - new MockGoogleJsonClientRequest(client, "GET", "foo", null, String.class); - try { - request.executeUnparsed(); - fail("expected " + GoogleJsonResponseException.class); - } catch (GoogleJsonResponseException e) { - // expected - GoogleJsonError details = e.getDetails(); - assertEquals("me", details.getMessage()); - assertEquals("me", details.getErrors().get(0).getMessage()); - } - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/services/json/CommonGoogleJsonClientRequestInitializerTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/services/json/CommonGoogleJsonClientRequestInitializerTest.java deleted file mode 100644 index ac7d31fa..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/services/json/CommonGoogleJsonClientRequestInitializerTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.services.json; - -import com.google.api.client.googleapis.testing.services.json.MockGoogleJsonClient; -import com.google.api.client.http.HttpContent; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.client.testing.http.HttpTesting; -import com.google.api.client.testing.http.MockHttpTransport; -import com.google.api.client.util.Key; - -import junit.framework.TestCase; - -/** - * Tests {@link CommonGoogleJsonClientRequestInitializer}. - * - * @author Yaniv Inbar - */ -public class CommonGoogleJsonClientRequestInitializerTest extends TestCase { - - public static class MyRequest extends AbstractGoogleJsonClientRequest { - @Key - String key; - - protected MyRequest(MockGoogleJsonClient client, String method, String uriTemplate, - HttpContent content, Class responseClass) { - super(client, method, uriTemplate, content, responseClass); - } - } - - public void testInitialize() throws Exception { - CommonGoogleJsonClientRequestInitializer key = - new CommonGoogleJsonClientRequestInitializer("foo"); - MockGoogleJsonClient client = new MockGoogleJsonClient.Builder( - new MockHttpTransport(), new JacksonFactory(), HttpTesting.SIMPLE_URL, "test/", null, - false).setApplicationName("Test Application").build(); - MyRequest request = new MyRequest(client, "GET", "", null, String.class); - assertNull(request.key); - key.initialize(request); - assertEquals("foo", request.key); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/testing/json/GoogleJsonResponseExceptionFactoryTestingTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/testing/json/GoogleJsonResponseExceptionFactoryTestingTest.java deleted file mode 100644 index 7958da3d..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/testing/json/GoogleJsonResponseExceptionFactoryTestingTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.testing.json; - -import com.google.api.client.googleapis.json.GoogleJsonResponseException; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; - -import junit.framework.TestCase; - -import java.io.IOException; - -/** - * Tests {@link GoogleJsonResponseExceptionFactoryTesting} - * - * @author Eric Mintz - */ -public class GoogleJsonResponseExceptionFactoryTestingTest extends TestCase { - - private static final JsonFactory JSON_FACTORY = new JacksonFactory(); - private static final int HTTP_CODE_NOT_FOUND = 404; - private static final String REASON_PHRASE_NOT_FOUND = "NOT FOUND"; - - public void testCreateException() throws IOException { - GoogleJsonResponseException exception = - GoogleJsonResponseExceptionFactoryTesting.newMock( - JSON_FACTORY, HTTP_CODE_NOT_FOUND, REASON_PHRASE_NOT_FOUND); - assertEquals(HTTP_CODE_NOT_FOUND, exception.getStatusCode()); - assertEquals(REASON_PHRASE_NOT_FOUND, exception.getStatusMessage()); - } -} diff --git a/google-api-client/src/test/java/com/google/api/client/googleapis/util/UtilsTest.java b/google-api-client/src/test/java/com/google/api/client/googleapis/util/UtilsTest.java deleted file mode 100644 index c0a5ab89..00000000 --- a/google-api-client/src/test/java/com/google/api/client/googleapis/util/UtilsTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.googleapis.util; - -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.javanet.NetHttpTransport; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; - -import junit.framework.TestCase; - -import java.io.IOException; -import java.net.URLDecoder; -import java.util.HashMap; -import java.util.Map; - -/** - * Tests {@link Utils}. - * - * @author Yaniv Inbar - */ -public class UtilsTest extends TestCase { - - public void testGetDefaultJsonFactory() { - JsonFactory jsonFactory = Utils.getDefaultJsonFactory(); - assertNotNull(jsonFactory); - assertTrue(jsonFactory instanceof JacksonFactory); - JsonFactory secondCall = Utils.getDefaultJsonFactory(); - assertSame(jsonFactory, secondCall); - } - - public void testGetDefaultTransport() { - HttpTransport transport = Utils.getDefaultTransport(); - assertNotNull(transport); - assertTrue(transport instanceof NetHttpTransport); - HttpTransport secondCall = Utils.getDefaultTransport(); - assertSame(transport, secondCall); - } - - public static Map parseQuery(String query) throws IOException { - Map map = new HashMap(); - String[] entries = query.split("&"); - for (String entry : entries) { - String[] sides = entry.split("="); - if (sides.length != 2) { - throw new IOException("Invalid Query String"); - } - String key = URLDecoder.decode(sides[0], "UTF-8"); - String value = URLDecoder.decode(sides[1], "UTF-8"); - map.put(key, value); - } - return map; - } -} diff --git a/instructions.html b/instructions.html deleted file mode 100644 index 52a65eb1..00000000 --- a/instructions.html +++ /dev/null @@ -1,73 +0,0 @@ - -Setup Instructions for the Google API Client Library for Java - -

Setup Instructions for the Google API Client Library for Java

- -

Browse Online

- -
- -

Checkout Instructions

- -

Prerequisites: install Java 6, Mercurial and Maven. You may need to set -your JAVA_HOME.

- -
hg clone https://google-api-java-client.googlecode.com/hg/ google-api-java-client
-cd google-api-java-client
-mvn install
- -There are two named branches: -
    -
  • The "default" branch has the stable 1.4 library. This is the default - branch that is checked out with the instructions above.
  • -
  • The "dev" branch has the development 1.5 library. To switch to this - branch, run:
    hg update dev
    -mvn clean install
  • -
- -

Setup Project in Eclipse 3.5

- -

Prerequisites: install Eclipse, -the Mercurial plugin, the Maven -plugin, and the Android -plugin.

- -
    -
  • Setup Eclipse Preferences -
      -
    • Window > Preferences... (or on Mac, Eclipse > Preferences...)
    • -
    • Select Maven -
        -
      • check on "Download Artifact Sources"
      • -
      • check on "Download Artifact JavaDoc"
      • -
      -
    • -
    • Select Android -
        -
      • setup SDK location
      • -
      -
    • -
    -
  • -
  • Import projects -
      -
    • File > Import...
    • -
    • Select "General > Existing Project into Workspace" and click - "Next"
    • -
    • Click "Browse" next to "Select root directory", find [someDirectory]/google-api-java-client - and click OK
    • -
    • Click "Next" and "Finish"
    • -
    -
  • -
- - - diff --git a/overview.html b/overview.html deleted file mode 100644 index a4274fa2..00000000 --- a/overview.html +++ /dev/null @@ -1,17 +0,0 @@ - - - Written by Google, the - google-api-java-client library is an easy-to-use and efficient Java client library for - accessing Google APIs using JSON and OAuth 2.0. - -

- This library is built on top of two common libraries, also built by Google, but designed to - work with any HTTP service on the web: the Google HTTP Client Library for Java and the Google - OAuth Client Library for Java. - @see - Google HTTP Java Client Library Javadoc - @see - Google OAuth Java Client Library Javadoc -

- - diff --git a/pom.xml b/pom.xml deleted file mode 100644 index a1db4268..00000000 --- a/pom.xml +++ /dev/null @@ -1,595 +0,0 @@ - - - 4.0.0 - - org.sonatype.oss - oss-parent - 7 - - com.google.api-client - google-api-client-parent - 1.20.0-SNAPSHOT - pom - Parent for the Google API Client Library for Java - - http://code.google.com/p/google-api-java-client/ - - - code.google.com - http://code.google.com/p/google-api-java-client/issues/list - - - 2010 - - - 2.0.9 - - - - scm:hg:https://code.google.com/p/google-api-java-client/ - scm:hg:https://code.google.com/p/google-api-java-client/ - http://code.google.com/p/google-api-java-client/source/browse/ - - - - Google - http://www.google.com/ - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - yanivi - Yaniv Inbar - yanivi@google.com - Google - http://www.google.com - - owner - developer - - -5 - - - - - - google-api-client - google-api-client-servlet - google-api-client-android - google-api-client-appengine - google-api-client-assembly - google-api-client-gson - google-api-client-jackson2 - google-api-client-java6 - google-api-client-protobuf - google-api-client-xml - - - - - - junit - junit - 4.8.2 - - - com.google.appengine - appengine-api-1.0-sdk - ${project.appengine.version} - - - com.google.appengine - appengine-testing - ${project.appengine.version} - - - com.google.appengine - appengine-api-labs - ${project.appengine.version} - - - com.google.appengine - appengine-api-stubs - ${project.appengine.version} - - - xpp3 - xpp3 - ${project.xpp3.version} - - - org.apache.httpcomponents - httpclient - ${project.httpclient.version} - - - com.google.guava - guava-jdk5 - ${project.guava.version} - - - com.google.code.findbugs - jsr305 - ${project.jsr305.version} - - - javax.jdo - jdo2-api - ${project.jdo2-api.version} - - - javax.servlet - servlet-api - 2.5 - - - com.google.http-client - google-http-client - ${project.http.version} - - - com.google.http-client - google-http-client-assembly - ${project.http.version} - pom - - - com.google.http-client - google-http-client-android - ${project.http.version} - - - com.google.http-client - google-http-client-appengine - ${project.http.version} - - - com.google.http-client - google-http-client-gson - ${project.http.version} - - - com.google.http-client - google-http-client-jackson2 - ${project.http.version} - - - com.google.http-client - google-http-client-protobuf - ${project.http.version} - - - com.google.http-client - google-http-client-jackson - ${project.http.version} - - - com.google.http-client - google-http-client-xml - ${project.version} - - - com.google.oauth-client - google-oauth-client - ${project.oauth.version} - - - com.google.oauth-client - google-oauth-client-assembly - ${project.oauth.version} - pom - - - com.google.oauth-client - google-oauth-client-appengine - ${project.oauth.version} - - - com.google.oauth-client - google-oauth-client-java6 - ${project.oauth.version} - - - com.google.oauth-client - google-oauth-client-java7 - ${project.oauth.version} - - - com.google.oauth-client - google-oauth-client-servlet - ${project.oauth.version} - - - com.google.api-client - google-api-client - ${project.version} - - - com.google.api-client - google-api-client-appengine - ${project.version} - - - com.google.api-client - google-api-client-servlet - ${project.version} - - - com.google.api-client - google-api-client-android - ${project.version} - - - com.google.api-client - google-api-client-java6 - ${project.version} - - - com.google.api-client - google-api-client-gson - ${project.version} - - - com.google.api-client - google-api-client-jackson2 - ${project.version} - - - com.google.api-client - google-api-client-protobuf - ${project.version} - - - com.google.api-client - google-api-client-xml - ${project.version} - - - - com.google.android.google-play-services - google-play-services - 1 - - - - - - - - - - maven-antrun-plugin - 1.6 - - - maven-assembly-plugin - 2.2 - - - maven-clean-plugin - 2.4.1 - - - maven-compiler-plugin - 2.3.2 - - 1.5 - 1.5 - - - - maven-dependency-plugin - 2.1 - - - maven-deploy-plugin - 2.5 - - - maven-ear-plugin - 2.4.2 - - - maven-ejb-plugin - 2.3 - - - maven-install-plugin - 2.3.1 - - - maven-jar-plugin - 2.3.1 - - - false - - - - - maven-javadoc-plugin - 2.7 - - - maven-plugin-plugin - 2.6 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.1 - - - maven-resources-plugin - 2.4.3 - - - maven-site-plugin - 2.1.1 - - - maven-source-plugin - 2.1.2 - - - maven-surefire-plugin - 2.12.4 - - -Xmx1024m - - - - maven-war-plugin - 2.1 - - - maven-checkstyle-plugin - 2.6 - - - org.codehaus.mojo - findbugs-maven-plugin - 2.5.2 - - - org.codehaus.mojo - clirr-maven-plugin - 2.6 - - - org.codehaus.mojo - animal-sniffer-maven-plugin - 1.9 - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.7 - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.maven.plugins - maven-jar-plugin - [2.3.1,) - - jar - - - - - - - - - org.datanucleus - maven-datanucleus-plugin - [2.2.1,) - - enhance - - - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - [1.0,) - - enforce - - - - - - - - - - - - - - - maven-javadoc-plugin - - - aggregate - - aggregate - - site - - - http://download.oracle.com/javase/6/docs/api/ - http://code.google.com/appengine/docs/java/javadoc - http://javadoc.google-http-java-client.googlecode.com/hg/${project.http.version} - http://javadoc.google-oauth-java-client.googlecode.com/hg/${project.oauth.version} - - Google API Client Library for Java ${project.version} - ${basedir}/overview.html - - - google-api-client - com.google.api.client.googleapis* - - - google-api-client-android - com.google.api.client.googleapis.extensions.android.* - - - google-api-client-appengine - com.google.api.client.googleapis.extensions.appengine* - - - google-api-client-gson - com.google.api.client.googleapis.notifications.json.gson.* - - - google-api-client-jackson2 - com.google.api.client.googleapis.notifications.json.jackson2.* - - - google-api-client-java6 - com.google.api.client.googleapis.extensions.java6.* - - - google-api-client-protobuf - com.google.api.client.googleapis.services.protobuf*:com.google.api.client.googleapis.testing.services.protobuf* - - - google-api-client-servlet - com.google.api.client.googleapis.extensions.servlet* - - - google-api-client-xml - com.google.api.client.googleapis.xml.* - - - google-api-java-client ${project.version} - - - - - - maven-checkstyle-plugin - - checkstyle.xml - true - ${basedir}/../checkstyle-suppressions.xml - - - - - check - - - - - - org.codehaus.mojo - findbugs-maven-plugin - - ${basedir}/../findbugs-exclude.xml - - - com.google.http-client - google-http-client-findbugs - ${project.http.version} - - - - - - org.codehaus.mojo - clirr-maven-plugin - - 1.19.0 - ${basedir}/../clirr-ignored-differences.xml - true - - - - - check - - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - org.codehaus.mojo.signature - java15 - 1.0 - - - - - - check - - - - - - - - UTF-8 - 1.20.0-SNAPSHOT - 1.20.0-SNAPSHOT - 1.3.9 - 2.1 - 1.9.11 - 2.1.3 - 2.4.1 - 13.0 - 1.7.7 - 1.1.4c - 1.1.1 - 4.0.1 - 4.0.1 - 2.3-eb - 1.1 - -