Google api 使用Google文档列表数据API v3.0重命名文件夹/集合
我正在尝试重命名集合,但出现错误,但 com.google.gdata.util.InvalidEntryException:无效的请求URI ,这是我的代码 DocsService客户端=新的DocsService(“TestTestApp v1”) 这就是这样做的方法或我的错误所在?重命名集合(或文档条目)类似于从API检索条目、更改标题并向文档条目的编辑URL发送更新(PUT)请求。 您可以使用此代码段在Java中实现这一点:Google api 使用Google文档列表数据API v3.0重命名文件夹/集合,google-api,google-docs-api,google-data-api,google-data,Google Api,Google Docs Api,Google Data Api,Google Data,我正在尝试重命名集合,但出现错误,但 com.google.gdata.util.InvalidEntryException:无效的请求URI ,这是我的代码 DocsService客户端=新的DocsService(“TestTestApp v1”) 这就是这样做的方法或我的错误所在?重命名集合(或文档条目)类似于从API检索条目、更改标题并向文档条目的编辑URL发送更新(PUT)请求。 您可以使用此代码段在Java中实现这一点: static DocumentListEntry rename
static DocumentListEntry renameDocument(DocsService client, String resourceUrl,
String newTitle) throws MalformedURLException, IOException,
ServiceException {
DocumentListEntry entry = client.getEntry(
new URL(resourceUrl), DocumentListEntry.class);
entry.setTitle(new PlainTextConstruct(newTitle));
DocumentListEntry updatedEntry = client.update(
new URL(entry.getEditLink().getHref()), entry);
// Check that updatedEntry has the new title.
return updatedEntry;
}
请停止使用google app engine标记这些问题。我实际上使用了最简单的XML:%s,这似乎成功地重命名了文件/文件夹。
static DocumentListEntry renameDocument(DocsService client, String resourceUrl,
String newTitle) throws MalformedURLException, IOException,
ServiceException {
DocumentListEntry entry = client.getEntry(
new URL(resourceUrl), DocumentListEntry.class);
entry.setTitle(new PlainTextConstruct(newTitle));
DocumentListEntry updatedEntry = client.update(
new URL(entry.getEditLink().getHref()), entry);
// Check that updatedEntry has the new title.
return updatedEntry;
}