1

below is my code

DocsService client = new DocsService("testappv1");
client.setUserCredentials(username, password);
client.setProtocolVersion(DocsService.Versions.V2);
File file = new File("C:/test.jpg");
DocumentEntry newDocument = new DocumentEntry();
newDocument.setTitle(new PlainTextConstruct("test"));
String mimeType = DocumentListEntry.MediaType.fromFileName(file.getName()).getMimeType();
newDocument.setMediaSource(new MediaFileSource(file, mimeType));
newDocument = client.insert(destFolderUrl, newDocument);

the document was created successful, but it did not contain anything.

4

1 回答 1

3

尝试以下

client.insert(new URL("https://docs.google.com/feeds/documents/private/full/?convert=false"), newDocument);

我认为这?convert=false一点很重要,不知道没有网址你是怎么做到的

client.insert(new URL(destFolderUrl+ "?convert=false"), newDocument);

希望能在你的情况下工作

于 2012-04-16T09:11:57.700 回答