SilverHoodCorp / gdata-java-client

Automatically exported from code.google.com/p/gdata-java-client
Apache License 2.0
0 stars 0 forks source link

Unable to anonymously access spreadsheet #259

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. try to access
http://spreadsheets.google.com/ccc?key=0Al6xypNIQWOddC1BV0RHN2o4dDRtXzJBcE9TXzg3
Ymc&hl=en
in a web browser. it should work
2. now try to access it via the java gdata API

I should be able to access the data in a spread sheet that is read only and
shared publicly via gdata

I am using the 1.41.1 version of the java gdata client library, the
following code does not work, unless i provide credentials. 

import com.google.gdata.client.spreadsheet.SpreadsheetService;
import com.google.gdata.data.spreadsheet.SpreadsheetEntry;
import java.net.URL;

public class Spreadsheet {

    public static void main(String[] args) {

      try {

        // Create a new Spreadsheet service
        SpreadsheetService myService = new SpreadsheetService("STOP Data
Import");
        //myService.setUserCredentials({user}, {pass});
        // trying to read the spread sheet at
http://spreadsheets.google.com/ccc?key=0Al6xypNIQWOddC1BV0RHN2o4dDRtXzJBcE9TXzg3
Ymc&hl=en
        //URL entryUrl = new
URL("http://spreadsheets.google.com/feeds/spreadsheets/0Al6xypNIQWOddC1BV0RHN2o4
dDRtXzJBcE9TXzg3Ymc");
        // maybe with the publish as html key?
        URL entryUrl = new
URL("http://spreadsheets.google.com/feeds/spreadsheets/t-AWDG7j8t4m_2ApOS_87bg")
;
        SpreadsheetEntry spreadsheet = myService.getEntry(entryUrl,
SpreadsheetEntry.class);
        System.out.println("Title : " + spreadsheet.getTitle().getPlainText());
      }
      catch(Throwable t) {
        t.printStackTrace();
      }
    }
  }

Original issue reported on code.google.com by otakuvi...@gmail.com on 11 Apr 2010 at 9:49

GoogleCodeExporter commented 9 years ago
Please report your issue at the Spreadsheets API Forum:
http://www.google.com/support/forum/p/apps-apis/label?lid=18118739cdcf1a08&hl=en

Original comment by yanivin...@gmail.com on 28 Apr 2010 at 4:27