我刚刚下载了newsest doc list api,并试一试。我的代码如下:
DocsService client = new DocsService("testappv3");
client.setUserCredentials("username", "password");
File file = new File("c:/test.txt");
URL url = new URL("https://docs.google.com/feeds/defaults/private/full/");
String mimeType = DocumentListEntry.MediaType.fromFileName(file.getName()).getMimeType();
DocumentEntry newDocument = new DocumentEntry();
newDocument.setTitle(new PlainTextConstruct("test"));
//newDocument.setMediaSource(new MediaFileSource(file, mimeType));
newDocument.setFile(file, mimeType);
newDocument = client.insert(url, newDocument);
错误如下:
com.google.gdata.util.ResourceNotFoundException: Not Found
<HTML>
<HEAD>
<TITLE>Not Found</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Not Found</H1>
<H2>Error 404</H2>
</BODY>
</HTML>
答案 0 :(得分:1)
您的URI不正确:
https://docs.google.com/feeds/defaults/private/full/
应该是
https://docs.google.com/feeds/default/private/full/
(没有s)