Google 문서 API를 사용하여 xml 문서를 업로드하려고합니다. 하지만이 문서는Google docs api - XML 문서 업로드
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)
나는 모든 종류의 문서의 업로드입니다 알고있다 얻을 예외입니다 업로드 불법 인수 예외
코드의 예외가 프리미어 계정에서만 사용할 수 있지만 내 질문은이 문제에 대한 해결 방법이 있는지 확인하는 것입니다.
감사합니다. 사나.
이것은 내 XML 파일을 원하지 않는 .doc 형식으로 변환합니다. – Sana
예. 알아. Google App에 대한 최고의 계정이있는 경우 URL 옵션의 "? convert = false"를 사용하여 업로드 할 수 있습니다. 그러나 나는 그것을 시험해 볼 수 없다. –
불행히도 최고의 계정이 없습니다. :-( – Sana