这是我的代码:
SpreadsheetService spreadsheet= new SpreadsheetService("v1");
spreadsheet.setProtocolVersion(SpreadsheetService.Versions.V3);
try {
spreadsheet.setUserCredentials("username", "password");
URL metafeedUrl = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full");
SpreadsheetFeed feed = spreadsheet.getFeed(metafeedUrl, SpreadsheetFeed.class);
List<SpreadsheetEntry> spreadsheets = feed.getEntries();
for (SpreadsheetEntry service : spreadsheets) {
System.out.println(service.getTitle().getPlainText());
}
} catch (AuthenticationException e) {
e.printStackTrace();
}
但这似乎不起作用。它总是在电子表格的构造函数中崩溃。我正在使用这些库:
- gdata-client-1.0
- gdata-client-meta-1.0
- gdata-core-1.0
- gdata-电子表格-3.0
- gdata-电子表格-meta-3.0
- 番石榴-13.0.1
谁能告诉我可能出了什么问题?