DocsService client = new DocsService(“Gdata Test”);
client.setUserCredentials(“your_id@gmail.com”,”your_password”);
String filepath = “C:/sample/php/test.txt”;
String title = “TitleToUse”;
File file = new File(filepath);
DocumentListEntry newDocument = new DocumentListEntry();
String mimeType = DocumentListEntry.MediaType.fromFileName(file.getName()).getMimeType();
newDocument.setFile(new File(filepath), mimeType);
newDocument.setTitle(new PlainTextConstruct(title));
client.insert(new URL(“http://docs.google.com/feeds/documents/private/full/”), newDocument);
こういうコードでエラーが出てしまう場合
com.google.gdata.util.ResourceNotFoundException: OK
Not Found
Error 404
アクセスするURLを変更してみる
http://docs.google.com/feeds/default/private/fullThank you for reading this post, don't forget to subscribe!