因此,对于我为 friend 编写的应用程序,我需要与 google drive 和 google data api 交互,以便在 google 电子表格中创建文件夹和操作数据。
现在提前查看 API,一切似乎都非常简单。 直到您真正开始并发现您可能在 Internet 上找到的所有文档都已被弃用。
最终我在互联网上花了一段时间后弄清楚了大部分内容(比如身份验证和创建新文件夹/复制文件等) 到目前为止一切顺利。
但现在我遇到了以下问题: 我正在尝试操作单个单元格(实际上是多个单元格,但 1 乘 1),在浏览了 2 天的谷歌残暴文档后,我转向了你们。
我已经对我的用户进行了身份验证,甚至从电子表格中读取了值,但我似乎无法写入。
CellEntry newEntry = new CellEntry(row,col, "value");
service.insert(cellFeedUrl, newEntry);
System.out.println("Added!");
这是我从他们的代码示例中得到的,但是 service.insert() 返回错误
Exception in thread "main" com.google.gdata.util.ServiceException: Internal Server Error
Internal Error
at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:632)
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:564)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:536)
at com.google.gdata.client.Service.insert(Service.java:1409)
at com.google.gdata.client.GoogleService.insert(GoogleService.java:613)
我真的希望这里有人能帮助我,我非常绝望,谷歌在这方面不是我的 friend (也没有谷歌自己的文档)
- A.E.
最佳答案
我自己想出来的,
正如我在其中一条评论中所说,我将值 0 传递给变量 col,将其传递给谷歌服务器后返回错误。
改变调用的循环:
new CellEntry(row,col, "value");
从 1 而不是 0 开始修复它。
- AE
关于java - 操纵谷歌电子表格中的单个单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24854887/