Giter Club home page Giter Club logo

google-http-java-client's Introduction

Google HTTP Client Library for Java

Maven Stability CI Status

Description

Written by Google, the Google HTTP Client Library for Java is a flexible, efficient, and powerful Java library for accessing any resource on the web via HTTP. The library has the following features:

  • Pluggable HTTP transport abstraction that allows you to use any low-level library such as java.net.HttpURLConnection, Apache HTTP Client, or URL Fetch on Google App Engine.
  • Efficient JSON and XML data models for parsing and serialization of HTTP response and request content. The JSON and XML libraries are also fully pluggable, and they include support for Jackson and Android's GSON libraries for JSON.

The library supports the following Java environments:

  • Java 7 or higher
    • The google-http-client-jackson2 and google-http-client-appengine modules require Java 8 or higher due to their dependencies.
  • Android 4.4 (Kit Kat)
  • GoogleAppEngine Google App Engine

The following related projects are built on the Google HTTP Client Library for Java:

This is an open-source library, and contributions are welcome.

Beta Features

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

Deprecated Features

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.

Documentation

google-http-java-client's People

Contributors

ajaaym avatar andrey-qlogic avatar arithmetic1728 avatar benwhitehead avatar chingor13 avatar codyoss avatar danthe1st avatar dependabot[bot] avatar eaball35 avatar ejona86 avatar elharo avatar gcf-owl-bot[bot] avatar geri-m avatar gk5885 avatar hailongwen avatar jeanbza avatar kolea2 avatar mattwhisenhunt avatar medb avatar mpeddada1 avatar neenu1995 avatar ngmiceli-g avatar pawelz avatar peleyal avatar release-please[bot] avatar renovate-bot avatar rmistry avatar suztomo avatar wonderfly avatar yoshi-automation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-http-java-client's Issues

FindBugs found: Synchronization issue in api.client.util.Data

From [email protected] on August 16, 2011 07:23:53

Version of google-http-java-client (e.g. 1.5.0-beta)? 1.5.0-beta Java environment (e.g. Java 6, Android 2.3, App Engine 1.4.3)? All Describe the problem. This class is synchronizing on the monitor of a ConcurrentHashMap instance. Concurrent objects have their own concurrency controls that are distinct form and incompatible with the keyword synchronized. The following function will not prevent other threads from making changes to NULL_CHANGE because it uses the NULL_CHANGE monitor, while other threads may be using the built-in concurrency provided by the collection:

public static T nullOf(Class objClass) { Object result = NULL_CACHE.get(objClass); if (result == null) { synchronized (NULL_CACHE) { result = NULL_CACHE.get(objClass); if (result == null) { if (objClass.isArray()) { // arrays are special because we need to compute both the dimension and component type int dims = 0; Class componentType = objClass;
do {
componentType = componentType.getComponentType();
dims++;
} while (componentType.isArray());
result = Array.newInstance(componentType, new int[dims]);
} else if (objClass.isEnum()) {
// enum requires look for constant with @NullValue
FieldInfo fieldInfo = ClassInfo.of(objClass).getFieldInfo(null);
Preconditions.checkNotNull(
fieldInfo, "enum missing constant with @NullValue annotation: %s", objClass);
@SuppressWarnings({"unchecked", "rawtypes"})
Enum e = fieldInfo.enumValue();
result = e;
} else {
// other classes are simpler
result = Types.newInstance(objClass);
}
NULL_CACHE.put(objClass, result);
}
}
}
@SuppressWarnings("unchecked")
T tResult = (T) result;
return tResult;
}

FindBugs Output:

Synchronization performed on util.concurrent instance
This method performs synchronization an object that is an instance of a class from the java.util.concurrent package (or its subclasses). Instances of these classes have there own concurrency control mechanisms that are distinct from and incompatible with the use of the keyword synchronized. How would you expect it to be fixed?

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=24

downloaded content zero length without Logging

From [email protected] on October 19, 2011 19:49:17

Version of google-http-java-client (e.g. 1.5.0-beta)? 1.5.0-beta Java environment (e.g. Java 6, Android 2.3, App Engine)? Android 2.2 emulator on Fedora 16
jdk1.6.0_27 Describe the problem. With logging disabled,downloaded content has zero bytes.
With logging enabled, downloaded content is correct.

Code fragment to isolate fault.......
----------- code start -------------------
private void doDtest() {
String url = " https://docs.google.com/feeds/download/documents/export/Export?id=12DquFymgKDTeIKkHa-OQuO5V-pHz-1v5EKAxaQPwQm0&exportFormat=html&format=html"; byte[] content1 = da.fetchDocumentContent(url, "xls");
System.out.println("===========1 "+content1.length);
Logger.getLogger("com.google.api.client").setLevel(Level.INFO);
Logger.getLogger("com.google.api.client.http").setLevel(Level.ALL);
byte[] content2 = da.fetchDocumentContent(url, "xls");
System.out.println("===========2 "+content2.length;
Logger.getLogger("com.google.api.client").setLevel(Level.INFO);
Logger.getLogger("com.google.api.client.http").setLevel(Level.OFF);
byte[] content3 = da.fetchDocumentContent(url, "xls");
System.out.println("===========3 "+content3.length;
}

byte[] da.fetchDocumentContent(String url, String type) {
HttpRequest request = requestFactory.buildGetRequest(url);
request.setDisableContentLogging(true);
l("[DA733] fdc url=" + request.getUrl() + " type=" + type);
HttpResponse response = null;
response = request401(request);
response.setDisableContentLogging(true);
InputStream is = response.getContent();
content = new byte[is.available()];
is.read(content);
return content
}
------------ code end ---------------------

------------ log start --------------------
I/System.out( 4134): Tue Oct 18 21:32:31 GMT+00.00 2011) [DA733] fdc url= https://docs.google.com/feeds/download/documents/export/Export?id=12DquFymgKDTeIKkHa-OQuO5V-pHz-1v5EKAxaQPwQm0&exportFormat=xls&format=xls type=xls
D/dalvikvm( 59): GC_EXTERNAL_ALLOC freed 16768 objects / 830328 bytes in 126ms
I/System.out( 4134): ===========1 0
I/System.out( 4134): Tue Oct 18 21:32:32 GMT+00.00 2011) [DA733] fdc url= https://docs.google.com/feeds/download/documents/export/Export?id=12DquFymgKDTeIKkHa-OQuO5V-pHz-1v5EKAxaQPwQm0&exportFormat=xls&format=xls type=xls
D/dalvikvm( 4134): GC_FOR_MALLOC freed 11184 objects / 571448 bytes in 58ms
I/System.out( 4134): ===========2 4096
I/System.out( 4134): Tue Oct 18 21:32:33 GMT+00.00 2011) [DA733] fdc url= https://docs.google.com/feeds/download/documents/export/Export?id=12DquFymgKDTeIKkHa-OQuO5V-pHz-1v5EKAxaQPwQm0&exportFormat=xls&format=xls type=xls
I/System.out( 4134): ===========3 0
------------- log end ------------------------- How would you expect it to be fixed? The results should be identical regardless of logging

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=45

Constructors for required parameters, document thread-safety, use getters/setters

From [email protected] on May 11, 2011 08:27:43

External references, such as a standards document, or specification? N/A Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All Please describe the feature requested. This feature cuts across all areas of the library. Currently most classes have only default parameters. Any required parameters must be set before calling any methods, at which point if any of the required parameters are null we throw a NullPointerException.

Instead, we could provide a constructor that has parameters for the required fields. This introduces compile-time checking of those required fields. We might also want constructors that also take optional fields. Finally, we should consider the option to not even provide the default constructor. A big motivation for the switch is thread safety and immutability, and consistency throughout the library.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=1

Support for alternative "HTTP parser detector"

From [email protected] on June 07, 2011 04:29:01

External references, such as a standards document, or specification? N/A Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All Please describe the feature requested. Currently HttpRequest has a built-in map from content type string to HttpParser. In HttpResponse.getParser(), it calls HttpRequest.getParser(contentType) which normalizes the content type (removes any parameters) and then returns the HttpParser mapped by the normalized content type.

This may not necessarily be the only possible useful algorithm. This feature request attempts to abstract out the way the HttpParser is chosen. For example:

public interface HttpParserDetector {
HttpParser detect(HttpResponse response);
}

We could provide a simple implementation like this:

public class DefaultParserDetector implements HttpParserDetector {
private final HttpParser parser;
public DefaultParserDetector(HttpParser parser) {
this.parser = parser;
}
public HttpParser detect(HttpResponse response) {
return parser;
}
}

As well as one that matches the existing behavior:

public class ContentTypeParserDetector implements HttpParserDetector {
/** Map from content type to HTTP parser. */
private final Map<String, HttpParser> contentTypeToParserMap = new HashMap<String, HttpParser>();
...
}

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=14

Remove deprecated classes/methods/fields from version 1.5 [BACKWARDS INCOMPATIBLE]

From [email protected] on June 28, 2011 14:12:03

External references, such as a standards document, or specification? http://javadoc.google-api-java-client.googlecode.com/hg/1.5.0-beta/deprecated-list.html Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All Please describe the feature requested. See link above for advice on how to upgrade.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=19

XPath support for @Key

From [email protected] on June 04, 2011 09:08:33

External references, such as a standards document, or specification? http://www.w3.org/TR/xpath/ Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All Please describe the feature requested. https://code.google.com/p/google-api-java-client/issues/detail?id=225 Reported by [email protected], Jun 4, 2011

Not sure how feasible this is, but instead of supporting only this type of mapping:

@key(atom:link)
public List links;

I would like to see syntax that would allow for something like this:

@key(atom:link[@rel='next])
public Link nextLink;

Or, even better something like this:

@key(atom:link[@rel='next']/@value)
public String nextLinkValue; https://code.google.com/p/google-api-java-client/issues/detail?id=72 Reported by [email protected], Dec 6, 2010

The @key("param") annotation does not support nested tags per Partial Response idioms. For example: @key("gf:symbol/@symbol") should return the symbol attribute from the symbol element within the element being parsed, without requiring the user to create a new class as an intermediary. 1.2.1-alpha fails to parse and returns null. Support for nested elements would be of great help in parsing as some of the Google APIs nest rather deeply and it would be useful to be able to flatten the structure somewhat. Another example is @key("gf:positionData/gf:marketValue/gf:money/@amount" -- Does that really need three nested classes to parse?

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=11

Detect Unicode encoding for GSON library

From [email protected] on June 04, 2011 09:12:26

External references, such as a standards document, or specification? http://blog.publicobject.com/2010/08/handling-byte-order-mark-in-java.html copied here (in case that blog goes away):

public Reader inputStreamToReader(InputStream in) throws IOException {
in.mark(3);
int byte1 = in.read();
int byte2 = in.read();
if (byte1 == 0xFF && byte2 == 0xFE) {
return new InputStreamReader(in, "UTF-16LE");
} else if (byte1 == 0xFF && byte2 == 0xFF) {
return new InputStreamReader(in, "UTF-16BE");
} else {
int byte3 = in.read();
if (byte1 == 0xEF && byte2 == 0xBB && byte3 == 0xBF) {
return new InputStreamReader(in, "UTF-8");
} else {
in.reset();
return new InputStreamReader(in);
}
}
} Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All Please describe the feature requested. Currently the GSON library implementation only supports UTF-8. The algorithm above could potentially be used for supporting the other 3 Unicode encodings supported by the JSON specifications.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=12

Detect Unicode encoding for GSON library

From [email protected] on May 11, 2011 11:05:38

External references, such as a standards document, or specification? http://blog.publicobject.com/2010/08/handling-byte-order-mark-in-java.html copied here (in case that blog goes away):

public Reader inputStreamToReader(InputStream in) throws IOException {
in.mark(3);
int byte1 = in.read();
int byte2 = in.read();
if (byte1 == 0xFF && byte2 == 0xFE) {
return new InputStreamReader(in, "UTF-16LE");
} else if (byte1 == 0xFF && byte2 == 0xFF) {
return new InputStreamReader(in, "UTF-16BE");
} else {
int byte3 = in.read();
if (byte1 == 0xEF && byte2 == 0xBB && byte3 == 0xBF) {
return new InputStreamReader(in, "UTF-8");
} else {
in.reset();
return new InputStreamReader(in);
}
}
} Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All. Please describe the feature requested. Currently the GSON library implementation only supports UTF-8. The algorithm above could potentially be used for supporting the other 3 Unicode encodings supported by the JSON specifications.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=6

When a subclass with a field annotated with @Key hides a superclass field annotated with @Key, prefer the definition from the subclass.

From [email protected] on June 22, 2011 08:06:43

Version of google-http-java-client

The one that's embedded in google-api-java-client 1.4.1-beta

Java environment (e.g. Java 6, Android 2.3, App Engine 1.4.3)?
All

Describe the problem.

package my.pkg;

class A {
@key
String foo;
}

class B extends A {
@key
Integer foo;
}

When attempting to anHttpResponse.parseAs(B.class), google-java-api-client complains like this:

java.lang.IllegalArgumentException: two fields have the same name : public java.lang.String my.pkg.A.foo and public java.lang.Integer my.pkg.B.foo
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:115) ... etc.

How would you expect it to be fixed?

Because the intent of B.foo is to hide A.foo, google-http-java-client should only consider B.foo to be of interest for parsing, even though the java.lang.reflection API does give it complete information about the definitions of foo, and both classes use the @key annotation.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=17

HttpResponse.parseAsString() should respect charset Content-Type parameter

From [email protected] on October 12, 2011 19:17:05

Version of google-http-java-client (e.g. 1.5.0-beta)? 1.5.0-beta Java environment (e.g. Java 6, Android 2.3, App Engine)? All Describe the problem. HttpResponse.parseAsString() uses the platform's default charset when parsing the content, even if the Content-Type header looks like this:

Content-Type: application/json; charset=UTF-8

Reference: https://code.google.com/p/google-http-java-client/source/browse/google-http-client/src/main/java/com/google/api/client/http/HttpResponse.java#420 How would you expect it to be fixed? I would expect parseAsString() to read the charset parameter from the Content-Type header to determine the character set to use to parse. Typically this will be UTF-8, which will typically be different from the platform's default encoding.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=41

javadocs for HttpRequestFactory use deprecated HttpRequest.headers field

From [email protected] on August 15, 2011 08:27:32

Version of google-http-java-client (e.g. 1.5.0-beta)? 1.5.0-beta Java environment (e.g. Java 6, Android 2.3, App Engine 1.4.3)? All Describe the problem. JavaDocs for HttpRequestFactory in 1.5.0 ( http://javadoc.google-http-java-client.googlecode.com/hg/1.5.0-beta/com/google/api/client/http/HttpRequestFactory.html ) reference the now-deprecated HttpRequest.headers field in the example code:

public static HttpRequestFactory createRequestFactory(HttpTransport transport) {
return transport.createRequestFactory(new HttpRequestInitializer() {
public void handle(HttpRequest request) {
request.headers.authorization = "...";
}
});
} How would you expect it to be fixed? Change the example to:

request.getHeaders().authorization = "...";

Thanks to [email protected] for reporting!

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=22

Deprecate GenericJson.jsonFactory

From [email protected] on September 09, 2011 15:01:57

External references, such as a standards document, or specification? http://javadoc.google-http-java-client.googlecode.com/hg/1.5.0-beta/com/google/api/client/json/GenericJson.html#jsonFactory Java environments (e.g. Java 6, Android 2.3, App Engine, or All)? All Please describe the feature requested. The new style is to not declare public fields and instead use a private field and use getters and setters. GenericJson.jsonFactory field does no follow this style. We should fix it to fit it with the consistent getter/setter style.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=31

NullPointerException when response has no content

From [email protected] on October 26, 2011 07:44:22

Version of google-http-java-client (e.g. 1.5.0-beta)? 1.5.3-beta Java environment (e.g. Java 6, Android 2.3, App Engine)? App Engine Describe the problem. We got the following user report:

I get the exception below though the operation succeeded (person got removed from circle). It seems because the response is empty, which is expected according to the docs. I.e., the client library should handle this case gracefully.

java.lang.NullPointerException
at java.io.ByteArrayInputStream.(ByteArrayInputStream.java:106)
at com.google.api.client.extensions.appengine.http.urlfetch.UrlFetchResponse.getContent(UrlFetchResponse.java:67)
at com.google.api.client.http.HttpResponse.getContent(HttpResponse.java:211)
at com.google.api.client.http.HttpResponse.ignore(HttpResponse.java:253)
at com.google.api.services.plusone.Plusone$People$RemoveFromCircle.execute(Plusone.java:2559)

See: https://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/urlfetch/HTTPResponse.html#getContent() How would you expect it to be fixed? UrlFetchResponse.getContent() in this case should return null, not throw a NPE

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=47

Should have a limit to the amount of content to log

From [email protected] on October 18, 2011 07:20:47

Version of google-http-java-client (e.g. 1.5.0-beta)? 1.6.0-beta Java environment (e.g. Java 6, Android 2.3, App Engine)? All, but especially limited memory Describe the problem. When logging is enabled, we log the content of the HTTP request and HTTP response. There is currently no limit to the size of content that we will log. To implement this, the whole content is stored in memory as a String. For large content, this will result in an OutOfMemoryException.

See: https://code.google.com/p/google-http-java-client/source/browse/google-http-client/src/main/java/com/google/api/client/http/LogContent.java https://code.google.com/p/google-http-java-client/source/browse/google-http-client/src/main/java/com/google/api/client/http/HttpResponse.java How would you expect it to be fixed? We should either set a hard-coded limit -- like 100KB -- or make it configurable by having a logging limit variable with a reasonable default, possibly allowing to set it to -1 to indicate no limit.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=43

Remove deprecated classes/methods/fields from version 1.4 [BACKWARDS INCOMPATIBLE]

From [email protected] on May 20, 2011 08:14:44

External references, such as a standards document, or specification? http://javadoc.google-api-java-client.googlecode.com/hg/1.4.1-beta/deprecated-list.html Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.2, or All)?

All Please describe the feature requested. See link above for advice on how to upgrade.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=8

Allow annotation to specify a value-converter in tandem with @Key

From [email protected] on August 16, 2011 07:47:02

External references, such as a standards document, or specification? None that I am aware of. Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All. Please describe the feature requested. // framework

/**

  • Specifies a conversion.
    */
    interface Converter {
    String toString(T obj);
    T valueOf(String value) throws ParseException;
    }

/**

  • Tell google-api-java-client to apply the specified conversion.
    */
    @retention(RetentionPolicy.RUNTIME)
    @target(ElementType.FIELD)
    public @interface Convert {
    Class<? extends Converter> value();
    // this is better than abusing @key
    }

// application example

import java.awt.Color;

class ColorConverter implements Converter {
// has parameterless default constructor

@OverRide
public String toString(Color obj) {
// format
}

@OverRide
public Color valueOf(String value) throws ParseException {
// parse
}
}

class Calendar {
@key("gCal:color")
@convert(ColorConverter.class)
public Color color;
}

Design notes:
The framework could inspect a Converter's method annotation to decide whether to invoke the method if the input is null. This could spare Converter implementors from having to deal with null input.

A framework-provided "abstract Class DefaultConverter implements Converter" could be useful.

Parse errors should not stop reading input, but there probably needs to be a way to callback the caller of the parseAs() method.

The use-case anticipated here doesn't need control over collections (eg. @key("entry") List entries;) ... this case can probably be excluded from the design of the Converter.

This converter doesn't solve more annoying issues like when the of a calendar event feed specialises the gd:comments/ element from the Event kind such that the gd:feedLink/ points to a feed containing s of the Message kind, and shouldn't try to.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=25

Extension of GenericData to support handling Protobufs

From [email protected] on June 06, 2011 06:30:35

External references, such as a standards document, or specification? https://code.google.com/apis/protocolbuffers/docs/overview.html Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All Please describe the feature requested. Reported by [email protected], Feb 28, 2011

The GenericData concept is great, and provides a simple way to consume, handle, and feed out data in XML/Json formats. As protobuf usage increases as the way to pass messages in/out of Java binaries, it would be nice to provide a parser/serializer to support translation between protos and GenericData (GenericProto?)

I'm not sure how nicely protobufs support this sort of treatment, but at least a few of the ideas are the same, e.g.

class Person extends GenericProto {
@key
String name;
@key
long id;
@key
Address address;
}

could be used to automatically load protobufs of the form:

message Address { ... }
message Person {
required string name = 1;
required int64 id = 2;
optional Address address = 3;
}

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=13

Support CSV

From [email protected] on May 20, 2011 05:13:14

External references, such as a standards document, or specification? http://en.wikipedia.org/wiki/Comma-separated_values https://code.google.com/apis/fusiontables/ http://opencsv.sourceforge.net/ http://stackoverflow.com/questions/101100/csv-api-for-java Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All Please describe the feature requested. Comma-separated values (CSV) is a common format with a fairly long history. The Google Fusion Tables API returns CSV in its response format. Opencsv seems to be a popular choice, but we can evaluate others as well.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=7

Provide a way to customize SSL certificate validation

From [email protected] on May 11, 2011 08:36:01

External references, such as a standards document, or specification? N/A Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All Please describe the feature requested. By default we should enable SSL certificate validation. But we should also provide a way to disable SSL certificate validation as a temporary work-around for example in case an SSL certificate has expired on a local service I'm working on.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=3

Ability to parse a JSON HttpResult containing an Array of objects

From [email protected] on May 23, 2011 04:19:41

External references, such as a standards document, or specification? Discussion Thread http://groups.google.com/group/google-api-java-client/browse_thread/thread/73945dc17855052e Example API http://dev.twitter.com/doc/get/users/search Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All Please describe the feature requested. Currently the api client cannot parse an HttpResponse formatted as a JSON array of objects.

ie: [{"prop1":"val1","prop2":"val2"},{"prop1":"val1","prop2":"val2"}]

Attempting to parse using parseAs(class) generates an IllegalArgumentException:

Exception in thread "main" java.lang.IllegalArgumentException: START_ARRAY at
com.google.common.base.Preconditions.checkArgument(Preconditions.java:
88)

Note that parseAsString() does work properly but the call
Feed resp = response.parseAs(Feed.class);
Should properly parse and return a feed object.

[Copied from https://code.google.com/p/google-api-java-client/issues/detail?id=218 ]

Reported by [email protected], May 21 (41 hours ago)

Comment 1 by project member [email protected], Today (9 hours ago)
I'm not sure that Feed resp = response.parseAs(Feed.class) should be expected to work because Feed would be an object, and the response is really an array of objects. I wouldn't mind a syntax like:
List response = response.parseAs(Item.class);
We should be able to make that work, and would be the obvious thing if you had used parseAs() before. OTOH, I'm not looking at the code right now. The use of templating may require a different name, so the signature might be template List parseAsArray( class T);

Comment 2 by project member [email protected], Today (7 hours ago)
An alternative is
List items = new ArrayList();
Status status = response.parseInto(items);

This eliminates the need for a template method, so it may result in less code size.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=9

Asynchronous requests

From [email protected] on May 11, 2011 08:33:21

Copied from previous project from: https://code.google.com/p/google-api-java-client/issues/detail?id=151 Please describe the feature requested. It would be nice to provide an executeAsync method in HttpRequest that started a new thread to execute the request and when it got the final response would call an implementation of an HttpAsyncCallback interface similar to the one in GWT: http://google-web-toolkit.googlecode.com/svn/javadoc/2.2/com/google/gwt/user/client/rpc/AsyncCallback.html Sample usage:

public static void run(HttpRequest request) {
request.executeAsync(new HttpAsyncCallback() {
public void onSuccess(HttpResponse response) {
if (response.isSuccessStatusCode) {
// server sent a success response
} else {
// server sent an error response
}
}

   public void onFailure(Throwable caught) {
     // Convenient way to find out which exception was thrown.
     try {
       throw caught;
     } catch (IOException e) {
       // some networking problem?
     } catch (Throwable e) {
       // last resort -- a very unexpected exception
     }
   }
});

}

Comment 1 by [email protected], Mar 19, 2011

+1 on the feature, I think it would be nice to provide this.

A couple comments on the sample usage as it is:

1.) onSuccess() gives you a response, which you then have to check for whether or not it was actually a success? Maybe it should be called onResponse() if it's not actually going to be a sign of success.

2.) I would argue that re-throwing the Throwable and catching it to find out what it was is not very convenient. Try/catch blocks should not be a control flow mechanism, they should be an error handling mechanism. It might be better to have instanceof check, but even that feels a little gross.

Also, for brevity, it might be nice to provide an abstract class, DefaultCallback, that implements onFailure() in a default way, so that developers don't have to write both branches for every request. This may be a recommendation for samples more than a recommendation for the library itself, since "the default way" might depend a lot on the environment, but either way I thought I'd mention it.

Also (also), for App Engine, since you can't spawn threads, you could use an asynchronous urlfetch as described here: http://ikaisays.com/2010/06/29/using-asynchronous-urlfetch-on-java-app-engine/ Comment 2 by project member [email protected], Mar 19, 2011

Thanks for the feedback!

I agree with the onResponse() name. That makes more sense.

The most interesting question is what to do about this for App Engine. executeAsync as outlined here just wouldn't work with fetchAsync since that uses a Future. I suppose we could still have executeAsync but throw an exception on App Engine.

Alternatively, we could use a Future-style interface like App Engine has, e.g.:

public class HttpRequest {
public Future fetchAsync();
}

and provide a way to override the behavior in the HttpTransport such that UrlFetchTransport would use URLFetchService.fetchAsync().

Comment 3 by project member [email protected], Mar 20, 2011

while we're doing this reconfiguration, maybe it's time to think about streaming
as well. The async callbacks would be

OnFailure - called immediately if you get an error return
OnHeaders(HttpResponse response) - called with all the header data
OnData(HttpRespose response, byte [] data, length) - on each successive chunk of data.
OnSuccess(HttpResposne response) - when we are finally done.

An app could get away with just OnFailure and OnSuccess, but an app that
did streaming responses could start parsing the JSON as it arrives.

-tony

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=2

problem downloading files >= 2gb from google storage. Get connection timeout after file transferred

From [email protected] on October 02, 2011 17:54:08

Version of google-http-java-client (e.g. 1.5.0-beta)? 1.6.0-beta-SNAPSHOT
latest from default branch Java environment (e.g. Java 6, Android 2.3, App Engine)? Java 6. Describe the problem. No issue with files less than 2 gb in size. But for files equal or greater than 2gb on last read I would expect to receive a -1 to indicate EOF, but instead I get a socket timeout. How would you expect it to be fixed? -1 retrieved from read instead of socket timeout exception.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=38

XML: handle empty string for numeric value

From [email protected] on May 11, 2011 10:02:57

Copied from: https://code.google.com/p/google-api-java-client/issues/detail?id=178 Reported by [email protected], Apr 13, 2011
I have a class that maps an XML attribue to a BigDecimal.

public class SalesTaxRate
{
@key("@Rate")
public BigDecimal totalRate;
}

I don't have any control over the web service that I'm calling, but I noticed that they sometimes send an empty attribute value for "rate" and when google-api-java-client tries to map the empty string to a BigDecimal, a NumberFormatException is thrown.

Partial stacktrace:

java.lang.NumberFormatException
at java.math.BigDecimal.(BigDecimal.java:457)
at java.math.BigDecimal.(BigDecimal.java:647)
at com.google.api.client.util.FieldInfo.parsePrimitiveValue(FieldInfo.java:240)...

Is there a way around this problem without resorting to using String instead of BigDecimal?

If not, I would like to request that empty attribute values be mapped to null, as though the attribute wasn't present at all. Perhaps there could be an annotation to achieve this, if this could not be a global behavior.

Comment 1 by project member [email protected], Apr 13, 2011

Good question.

The only problem I see with setting it to null is that if you later serialize the XML you would get:

Another option is to set it to 0, but again on serialization you get:

An annotation like @AllowEmptyXMLAttribtue would mean that then there is no way to say that this attribute is missing, so if we see this:

We will serialize it as:

On the other hand, String deals with all of these cases correctly, but it requires you to then convert to/from BigDecimal everywhere in your application.

So it seems like no option is really ideal, though I tend to think just setting it null might be the most practical option.

By the way, in the case of the web service you are using, how are you supposed to interpret rate=""? Does it mean that the rate is 0, or that the rate is not known? Do you know why they return rate="" instead of the more straight-forward choices?

Comment 2 by [email protected], Apr 19, 2011

Thanks for the response. The key issue here for me is that right now, the way it works, deserialization can break for an empty XML attribute. I think that no matter what a long term solution is, a short term solution should be provided so that the NumberFormatException is not thrown, and the BigDecimal (or other objects like BigInteger) are deserialized to null.

For a long term solution, we should probably think in terms of how XML schemas (or similar mechanisms) define attributes as either "required" or "optional". There could be an annotation specifying whether or not an attribute is "required" explicitly, so that a required attribute that is null will be serialized to an empty attribute value. For the case of BigDecimal, you would still need to deserialize to null, even if the XML attribute is empty.

It wouldn't be easy to determine that the original attribute was empty in the first place. I guess you could have an annotation that defines a value to set the BigDecimal to when the original attribute is empty (e.g., set to minimum possible BigDecimal value). To be honest, I'm not sure it is worth it.

To answer your last few questions, the web service interprets rate="" as meaning that they can not determine the rate. I think it's just a bad design decision on their part (and probably too late to change for them, because I'm sure thousands of applications already use their web service).

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=5

Missing JavaDoc link

From [email protected] on September 22, 2011 13:43:38

Version of google-http-java-client (e.g. 1.5.0-beta)? 1.5.0-beta Java environment (e.g. Java 6, Android 2.3, App Engine)? All. Describe the problem. See for example: http://javadoc.google-http-java-client.googlecode.com/hg/1.5.0-beta/com/google/api/client/util/GenericData.html click on Object and you get a broken page link to: http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true How would you expect it to be fixed? It should instead point to: http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=35

Key/Value Pair parser support for Really Simple Syndication (RSS)?

From [email protected] on September 10, 2011 02:33:55

External references, such as a standards document, or specification? http://en.wikipedia.org/wiki/RSS Java environments (e.g. Java 6, Android 2.3, App Engine, or All)? Any Please describe the feature requested. Would it be possible to extend the key/value pairing parser to support RSS? RSS holds a very closely related structure to Atom. The only variation is the lack of a default namespace.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=32

Automatically follow redirects

From [email protected] on September 12, 2011 16:32:36

External references, such as a standards document, or specification? http://tools.ietf.org/html/rfc2616#section-10.3 http://tools.ietf.org/html/rfc2616#section-14.30 Java environments (e.g. Java 6, Android 2.3, App Engine, or All)? All Please describe the feature requested. By default the http library should automatically follow redirects, as specified in the Location header for a 3xx response. See HTTP specification above. We should add a setFollowRedirects method to disable this functionality.

NOTE: we need to be careful about the HttpUnsuccessfulResponseHandler in this case. One option is that we should only follow the redirect if handleResponse returns false.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=33

Simplify Staging process with Nexus Maven Plugin?

From [email protected] on July 29, 2011 16:40:27

External references, such as a standards document, or specification? http://www.sonatype.com/books/nexus-book/reference/staging-sect-managing-plugin.html Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? N/A Please describe the feature requested. This might simplify the process by making it possible to close and release the staged artifact from the command line rather than having to do it from the UI.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=21

Support for text-based protocol buffer format

From [email protected] on June 01, 2011 07:48:19

External references, such as a standards document, or specification? https://code.google.com/p/protobuf/ Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All. Please describe the feature requested. Similar to the binary protocol buffer format support we are adding in Issue 4 , we can also add support for a text-based protocol buffer format. Typical content type is "text/x-protobuf", and we can use TextFormat for parsing/serialization.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=10

DailyMotion API command-line sample

From [email protected] on September 15, 2011 08:30:43

Which API and version (e.g. Google Calendar Data API version 2)? Dailymotion API What format (e.g. JSON, XML)? JSON Java environment (e.g. Java 6, Android 2.3, App Engine)? Java 6 command-line External references, such as API reference guide? http://www.dailymotion.com/doc/api/rest-api-reference.html#get-videos Please provide any additional information below.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=34

Allow GenericUrl.build() to be overridden

From [email protected] on August 16, 2011 08:11:27

Thanks to [email protected] for reporting the problem!

version: 1.4.1-beta on App Engine 1.5.0.1

As an example of this issue, according to Google's documentation to retrieve the ACL Feed for a Google Docs List Entry, the link specified requires the form: https://docs.google.com/feeds/default/private/full/document&#37;3Adocument_id/acl The %3A is critical as the following url (with %3A replaced by a colon) returns a 404 for us: https://docs.google.com/feeds/default/private/full/document:document_id/acl That automatic decoding from %3A to : happens within the internals of the GenericUrl class.

As an attempt to work around this, I replaced the "%" with a "%25" with the hopes that GoogleUrl would properly escape the "%25" back to a "%" and all would be well: https://docs.google.com/feeds/default/private/full/document&#37;253Adocument_id/acl However, this only resulted in the GenericUrl building an unchanged, incorrect url: https://docs.google.com/feeds/default/private/full/document&#37;253Adocument_id/acl Since the methods that encode and decode within GenericUrl are final/private, there does not appear to be a way to properly construct a url to access the Google Docs ACL Feed using the class.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=26

HttpContent.getLength() implementation for JSON, XML, URL-encoding, etc.

From [email protected] on June 24, 2011 07:16:32

External references, such as a standards document, or specification? http://tools.ietf.org/html/rfc2616#section-14.13 "14.13 Content-Length
...
Applications SHOULD use this field to indicate the transfer-length of
the message-body, unless this is prohibited by the rules in section
4.4.
...
In HTTP, it
SHOULD be sent whenever the message's length can be determined prior
to being transferred, unless this is prohibited by the rules in
section 4.4." Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All Please describe the feature requested. We need to be able to compute the content length before we send the content, so the getLength() needs to be able to compute the length beforehand. We will provide an AbstractHttpContent that has a default implementation that calls writeTo(OutputStream) with a fake output stream that just counts the bytes.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=18

Add a static compile method to UriTemplate.java

From [email protected] on October 14, 2011 09:59:45

Code review comment from Yaniv in http://codereview.appspot.com/5152047/ :

Design question: should we use a similar design pattern for UriTemplate as for regular expressions in Java, i.e. Pattern? The idea with Pattern is that you can pre-compile it and reuse to more efficiently match against multiple string inputs. The parallel here is that UriTemplates will typically be reused often on multiple parameter inputs. So it would be great to have a static compile(String template) method that returns a new compiled UriTemplate instance with an expand(Object parameters) method that performed the expansion. We could still keep the existing expand(String template, Object parameters) method, but its implementation would simply be UriTemplate.compile(template).expand(parameters).

But given that this design pattern is just a performance optimization and a significant re-work of your implementation, I'm happy to just leave it with a TODO and/or a feature request on the public Issue tracker to do in the future. It is relatively low priority.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=42

CustomizeJsonParser needs work

From [email protected] on June 07, 2011 06:12:38

External references, such as a standards document, or specification? N/A Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All Please describe the feature requested. CustomizeJsonParser needs some improvements. context should now be a List instead of just an Object. There are also other variables the methods should accept like "Type valueType" for the newInstance methods now that we support Java generics and other complex types.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=15

Pretty-printing JSON

From [email protected] on November 01, 2011 08:41:21

External references, such as a standards document, or specification? N/A Java environments (e.g. Java 6, Android 2.3, App Engine, or All)? All Please describe the feature requested. Currently JSON serialization is a compact form, which is not ideal for debugging or other human-consumption. Would be nice to allow a way to serialize JSON in pretty-printed form for this purpose. An example use case is to pretty-print the JSON error response from Google APIs.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=48

Allow users to provide custom HttpClient to ApacheHttpTransport

From [email protected] on September 28, 2011 13:55:13

It is sometimes useful to wrap Apache's DefaultHttpClient with a wrapper for some app specific functionality.

Once such example is Android:
Android has such a wrapper that does several things such as:

  • Auto URL substitution - To divert requests through a Proxy for example.
  • curl debugging : printing curl commands that allow developers to execute requests on a desktop

As is, the ApacheHttpTransport hard codes a DefaultHttpClient in the ctro. It would be very helpful to be able to provide a user created HttpClient.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=37

Bug in parseAs when NetHttpTransport is used

From [email protected] on September 24, 2011 02:14:47

public T parseAs(Class dataClass) throws IOException {
HttpParser parser = getParser();
if (parser == null) {
InputStream content = getContent(); <-- !!!!!!!! THIS WON"T BE NULL FOR EMPTY RESPONSE WHEN NetHttpTransport is USED. WORKS FINE FOR ApacheHttpTransport !!!!!!!
if (contentType == null) {
if (content != null) {
throw new IllegalArgumentException(
"Missing Content-Type header in response: " + parseAsString());
}
return null;
}
throw new IllegalArgumentException("No parser defined for Content-Type: " + contentType);
}
return parser.parse(this, dataClass);
}

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=36

JsonHttpClient.buildHttpRequest should be able to handle different values of baseUrl and uriTemplate

From [email protected] on October 21, 2011 10:10:11

Currently JsonHttpClient.buildHttpRequest has very strict requirements on what the baseUrl and uriTemplate can look like:
baseUrl must end with "/"
uriTemplate cannot start with "/".

JsonHttpClient.buildHttpRequest should be changed to handle baseUrl and uriTemplate regardless if they end with or start with "/".

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=46

NullPointerException when non-top-level element declares a new namespace and uses it

From [email protected] on August 16, 2011 07:20:56

Version of google-http-java-client (e.g. 1.5.0-beta)? 1.5.0-beta Java environment (e.g. Java 6, Android 2.3, App Engine 1.4.3)? All Describe the problem. NullPointerException when namespace is defined on a non-top-level element

Google Document List Feed produces an interior element
<app:edited xmlns:app=' http://www.w3.org/2007/app'>2011-08-09T04:38:14.017Z/app:edited The xmlns:app definition only occurs on this element, not the top-level element. When this is parsed:

java.lang.NullPointerException
at com.google.api.client.xml.Xml.getFieldName(Xml.java:513)
at com.google.api.client.xml.Xml.parseElementInternal(Xml.java:317)
at com.google.api.client.xml.Xml.parseElementInternal(Xml.java:454)
at com.google.api.client.xml.Xml.parseElement(Xml.java:198)
at com.google.api.client.http.xml.XmlHttpParser.parse(XmlHttpParser.java:72)
at com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:298)
at org.springhaven.testing.GdataTest1.main(GdataTest1.java:166) How would you expect it to be fixed? Use a namespace stack and duplicate the namespace-addition code in Xml.java lines 228-247 at the start of each element (around line 317) to populate the stack.

Thanks to [email protected] for reporting!

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=23

Move code from generated libraries into the base library

From [email protected] on November 07, 2011 08:57:20

Implement the design proposal here: http://codereview.appspot.com/5080054/ 1. Add JsonHttpRequestInitializer that will be used to initialize requests. E.g for setting global parameters.

SampleUsage:

class BooksRequestInitializer implements JsonHttpRequestInitializer {

public void initialize(GoogleRequest request) {
BooksRequest booksRequest = (BooksRequest)request;
booksRequest.setPrettyPrint(true);
booksRequest.setKey(ClientCredentials.KEY);
}
}

  1. Move as much as possible of the reusable code across the generated
    libraries.
    Specifically includes the common parts of ApiClient and RemoteRequest.

Example:

final Books books = new Books(new NetHttpTransport(), jsonFactory);
books.setApplicationName("Google-BooksSample/1.0");
books.setKey(ClientCredentials.KEY);

Now becomes:

final Books books = Books.builder(new NetHttpTransport(), jsonFactory)
.setApplicationName("Google-BooksSample/1.0")
.setJsonHttpRequestInitializer(new BooksRequestInitializer())
.build();

  1. Follow our thread-safety style guidelines.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=49

Support for HTTP services based on protocol buffers

From [email protected] on May 11, 2011 08:37:30

External references, such as a standards document, or specification? https://code.google.com/p/protobuf/ Java environments (e.g. Java 6, Android 2.3, App Engine 1.4.3, or All)? All Please describe the feature requested. HttpProtocolBufferContent and HttpProtocolBufferTextContent would be used for sending protocol buffer Message of binary content type "application/x-protobuf" or text content type "text/x-protobuf" (respectively).

Similarly HttpProtocolBufferParser and HttpProtocolBufferTextParser would be used for parsing protobuf response from server.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=4

Write Python scripts to automate some parts of the release process

From [email protected] on October 07, 2011 09:25:41

External references, such as a standards document, or specification? http://google-http-java-client.googlecode.com/hg/release.html Java environments (e.g. Java 6, Android 2.3, App Engine, or All)? N/A Please describe the feature requested. Some parts of our release process could be automated better, e.g.:

  • Forking before release.
  • Maven release
  • JavaDoc and JDiff generation.

We could use this script (or a copy of it) for our sister projects google-oauth-java-client and google-api-java-client.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=40

Parsing directly into a List

From [email protected] on August 29, 2011 10:23:26

Java environments (e.g. Java 6, Android 2.3, App Engine, or All)? All Please describe the feature requested. JsonParser.parse() can parse in a serialized Map but it cannot parse a List. It seems that it's possible to do this by adding simmilar List handling to to what it does for Map:

JsonParser.java does this:
if (!isGenericData && Map.class.isAssignableFrom(destinationClass))

It can also do the same for List objects.

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=30

JsonFactory#toString() depends on default charset

From [email protected] on August 24, 2011 05:33:08

Version of google-http-java-client (e.g. 1.5.0-beta)? 1.5.0-beta Java environment (e.g. Java 6, Android 2.3, App Engine 1.4.3)? Java 6
App Engine 1.5.2 Describe the problem. Result of method com.google.api.client.json.JsonFactory#toString() depends on Java VM default charset. So multi-byte characters in model are serialized as invalid mark if default charset is not UTF-8 (e.g. App Engine production).

Example:
com.google.api.services.tasks.model.Tasks tasks = ...; // model
String json = tasks.toString(); // GenericJson#toString() calls JsonFactory#toString()

This code will work if default charset is UTF-8, but not work correctly if US-ASCII. How would you expect it to be fixed? Use ByteArrayOutputStream#toString(charset) instead.

Patch: https://code.google.com/p/google-http-java-client/source/browse/google-http-client/src/main/java/com/google/api/client/json/JsonFactory.java line 91
public final String toString(Object item) {
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
try {
JsonGenerator generator = createJsonGenerator(byteStream, JsonEncoding.UTF8);
generator.serialize(item);
generator.flush();
} catch (IOException e) {
throw new RuntimeException(e);
}

  • return byteStream.toString();
  • try {
  •  return byteStream.toString("UTF-8");
    
  • }
  • catch (UnsupportedEncodingException e) {
  •  throw new RuntimeException(e);
    
  • }
    }

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=28

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.