Cloned from http://code.google.com/p/google-http-java-client and http://code.google.com/p/google-oauth-java-client