문서 및 폴더를 만들고 삭제하는 데 필요한 거의 완전한 API를 얻었습니다. 하지만 문서를 업데이트하는 데 실패합니다. gdata를 사용할 때는 매우 쉽지만이 코드는 모든 안드로이드 장치에서 작동해야하므로 google api java 클라이언트를 사용해야합니다. 무엇 발생하는 난 그냥 (새 문서가 완벽하게 작동 만들기, 주어진 내용으로) 새 문서를 만들 것입니다google api java 클라이언트로 Google 문서 도구 업데이트하기
public void updateTest() throws IOException {
InputStreamContent isContent = new InputStreamContent();
isContent.inputStream = new ByteArrayInputStream("NEW CONTENT".getBytes("UTF-8"));
isContent.type = "text/plain";
HttpRequest request = transport.buildPostRequest();
request.setUrl("https://docs.google.com/feeds/default/media/document:0A[snip]3Y");
request.content = isContent;
// request.headers.set("If-Match", "*");
try {
request.execute().parseAs(DocumentListEntry.class);
} catch (HttpResponseException e) {
if (Constant.DEBUG) Log.d(TAG, "error: " + e.response.parseAsString());
throw e;
} catch (ClientProtocolException e) {
if (Constant.DEBUG) Log.d(TAG, "error: " + e.getMessage());
throw e;
}
}
: 여기 업데이트를 테스트하는 방법입니다. 내가 추가 할 경우 "경우-경기 : *"- :
11-19 11:17:16.536: DEBUG/DocsAPI(32195): error: <errors xmlns='http://schemas.google.com/g/2005'>
11-19 11:17:16.536: DEBUG/DocsAPI(32195): <error>
11-19 11:17:16.536: DEBUG/DocsAPI(32195): <domain>GData</domain>
11-19 11:17:16.536: DEBUG/DocsAPI(32195): <code>noPostConcurrency</code>
11-19 11:17:16.536: DEBUG/DocsAPI(32195): <internalReason>POST method does not support concurrency</internalReason>
11-19 11:17:16.536: DEBUG/DocsAPI(32195): </error>
11-19 11:17:16.536: DEBUG/DocsAPI(32195): </errors>
11-19 11:17:16.536: WARN/System.err(32195): com.google.api.client.http.HttpResponseException: 501 Not Implemented
11-19 11:17:16.540: WARN/System.err(32195): at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:209)
...
당신은 나를 약 8 % 더 행복했다, 감사합니다! – pgsandstrom
아, 10 %를 목표로 삼았습니다. Bummer;) –
당신은 나를 3 % 더 행복하게 만들었습니다. 그래서 당신이 지금 당신의 목표를 초과했다고 생각합니다. ;) –