-1

我刚刚下载了 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>
4

1 回答 1

1

Your URI is incorrect:

https://docs.google.com/feeds/defaults/private/full/

Should be

https://docs.google.com/feeds/default/private/full/

(with no s)

于 2012-04-27T04:26:09.440 回答