title: GData Java Client not working because Google redirects to localized site
body: <p>I'm following the documentation at <a href="http://code.google.com/apis/analytics/docs/gdata/1.0/gdataJava.html" rel="nofollow noreferrer">Google Analytics Data API - Java</a> 
  and am getting the <code>RedirectRequiredException</code> exception, because Google 
  is redirecting me to a local version of the site (www.google.si). </p>
  
  <p>The code:</p>
  
  <pre><code>AnalyticsService as = new AnalyticsService("me-myapp-1.0"); 
  as.setUserCredentials(username, password); 
  AccountFeed accountFeed = as.getFeed( 
      new URL("https://www.google.com/analytics/accounts/default"), 
      AccountFeed.class); 
  </code></pre>
  
  <p>The last method call throws: </p>
  
  <pre><code>Exception in thread "main" com.google.gdata.util.RedirectRequiredException: Found 
  &lt;HTML&gt;&lt;HEAD&gt;&lt;meta http-equiv="content-type" content="text/ 
  html;charset=utf-8"&gt; 
  &lt;TITLE&gt;302 Moved&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt; 
  &lt;H1&gt;302 Moved&lt;/H1&gt; 
  The document has moved 
  &lt;A HREF="http://www.google.si/"&gt;here&lt;/A&gt;. 
  &lt;/BODY&gt;&lt;/HTML&gt; 
          at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse (GoogleGDataRequest.java:541) 
          at com.google.gdata.client.http.HttpGDataRequest.checkResponse (HttpGDataRequest.java:535) 
          at com.google.gdata.client.http.HttpGDataRequest.execute (HttpGDataRequest.java:514) 
          at com.google.gdata.client.http.GoogleGDataRequest.execute (GoogleGDataRequest.java:515) 
          at com.google.gdata.client.Service.getFeed(Service.java:1016) 
          at com.google.gdata.client.Service.getFeed(Service.java:879) 
          at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:638) 
          at com.google.gdata.client.Service.getFeed(Service.java:898) 
          at org.kubje.jaka.gapump.App.main(App.java:42) 
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>I've also posted this question to the Analytics API's Google Group, <a href="http://groups.google.com/group/google-analytics-data-export-api/browse_thread/thread/8b4dc0860af1a030#" rel="nofollow noreferrer">here</a>.</p>