Google docs api を使用して xml ドキュメントをアップロードしようとしています。しかし、 Illegal Argument Exception の例外が発生します
ドキュメントをアップロードするコードは
File file = new File("/Users/Sana/Downloads/Sana_Upload_test.xml");
DocumentEntry newDocument = new DocumentEntry();
newDocument.setFile(file, "xml");
newDocument.setTitle(new PlainTextConstruct("Sana.xml"));
client.insert(new URL("https://docs.google.com/feeds/default/private/full/"), newDocument);
私が得る例外は
Exception in thread "main" java.lang.IllegalArgumentException: Invalid media type:xml
at com.google.gdata.util.ContentType.<init>(ContentType.java:323)
at com.google.gdata.data.docs.DocumentListEntry.setFile(DocumentListEntry.java:298)
at Documents.main(Documents.java:74)
どのような種類のドキュメントのアップロードもプレミア アカウントでしか利用できないことはわかっていますが、この問題の回避策があるかどうかを知りたいのですが?
ありがとう、サナ。