1
最近,我正在嘗試使用scribe-java(https://github.com/fernandezpablo85/scribe-java)將Google Drive集成到我的應用程序中。 和通過Id方法列出文件/獲取文件正常工作。但我無法插入新的File方法正常工作。 這裏是我的代碼(插入):如何使用scribe-java將新文件插入Google Drive
OAuthService service = new ServiceBuilder()
.provider(GoogleApi.class)
.apiKey("[my api key]")
.apiSecret("[my api secret]")
.scope(SCOPE)
.callback("[my callback]")
.build();
Token token = new Token(accessToken, accessSecret);
OAuthRequest request = new OAuthRequest(Verb.POST, "https://www.googleapis.com/drive/v2/files");
service.signRequest(token, request);
Response response = request.send();
這將在我的谷歌驅動器中的「無題」命名的文件,我的問題是如何從本地文件系統上傳我的文件,並指定一個名字嗎?因爲我嘗試添加添加主體參數,添加標題,他們都不工作。非常感謝
文檔要求你做什麼?你應該以什麼格式發送文件內容到谷歌驅動器? – 2012-07-09 18:48:10