久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Google Drive SDK - Java 示例不工作

Google Drive SDK - Java sample not working(Google Drive SDK - Java 示例不工作)
本文介紹了Google Drive SDK - Java 示例不工作的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試使用官方 Java 示例熟悉 Google Drive API.但是,在浪費了幾個小時并嘗試設置了兩次示例之后,我仍然無法按預期使用它.

I'm trying to get familiar with the Google Drive API using the official Java sample. However, after wasting a few hours and attempting to set the sample up two times, I'm still not able to use it as expected.

它不會顯示文件的內容,而是在 FileServlet(/svc 路徑)中引發 404 錯誤.更具體地說, service.files().get(fileId).execute(); 似乎返回 null.我已經直接從 Google Drive 以及使用 Google File Picker 嘗試了不同的文件、不同的 MIME 類型.

Instead of displaying a file's content it throws a 404 error in the FileServlet (/svc path). More specifically, service.files().get(fileId).execute(); seems to return null. I've tried it with different files, different MIME types, directly from Google Drive as well as using the Google File Picker.

我已按照 https://developers.google.com/drive 中描述的步驟進行操作/examples/java 盡可能接近.

I've followed the steps described over at https://developers.google.com/drive/examples/java as closely as possible.

有人能夠讓示例運行嗎?

Has anyone been able to get the sample running?

這是請求 URL /svc?file_id=0B08R9MrOE-ejZTY2M2I5MjAtYmVjZS00OTkyLWI4ZTEtOTg4OGM3YTIxMWEw 時 FileServlet 的日志輸出(第 78 行拋出 404 錯誤):

edit: Here's the log output of the FileServlet when requesting the URL /svc?file_id=0B08R9MrOE-ejZTY2M2I5MjAtYmVjZS00OTkyLWI4ZTEtOTg4OGM3YTIxMWEw (the 404 error is thrown at line 78):

2012-04-26 08:21:36.077
com.google.api.client.http.HttpRequest execute: -------------- REQUEST  --------------
GET https://www.googleapis.com/drive/v1/files/0B08R9MrOE-ejZTY2M2I5MjAtYmVjZS00OTkyLWI4ZTEtOTg4OGM3YTIxMWEw
Accept-Encoding: gzip
User-Agent: Google-HTTP-Java-Client/1.8.3-beta (gzip)

D 2012-04-26 08:21:36.263
com.google.api.client.http.HttpResponse <init>: -------------- RESPONSE --------------
403 OK
content-type: application/json; charset=UTF-8
content-encoding: gzip
date: Thu
date: 26 Apr 2012 06:21:36 GMT
expires: Thu
expires: 26 Apr 2012 06:21:36 GMT
cache-control: private
cache-control: max-age=0
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
content-length: 188
server: GSE
x-google-cache-control: remote-fetch
via: HTTP/1.1 GWA

D 2012-04-26 08:21:36.265
com.google.api.client.http.HttpResponse getContent: Response size: 188 bytes
D 2012-04-26 08:21:36.271
com.google.api.client.http.HttpResponse getContent: {
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "dailyLimitExceededUnreg",
    "message": "Daily Limit Exceeded. Please sign up",
    "extendedHelp": "https://code.google.com/apis/console"
   }
  ],
  "code": 403,
  "message": "Daily Limit Exceeded. Please sign up"
 }
}

這聽起來很像我不認識你",所以我再次查看了我的客戶端 ID 和客戶端密碼:我注意到有兩個客戶端 ID 和客戶端密碼顯示在API 控制臺,一個Web 應用程序的客戶端 ID"和另一個Drive SDK 的客戶端 ID".我以前用過那個用于 Web 應用程序,所以我嘗試切換到用于 Drive SDK 的那個.不幸的是,這并沒有改變任何東西.同樣的錯誤...:/

This sounds a lot like "I don't know you" to me, so I have taken another look at my Client ID and Client Secret: I've noticed that there are two Client IDs and Client Secrets being displayed in the API Console, one "Client ID for web applications" and another "Client ID for Drive SDK". I've used the one for web applications previously, so I tried to switch to the one for the Drive SDK. Unfortunately, this doesn't change anything. Same error... :/

推薦答案

我最終設法讓它工作.我不確定之前的問題是什么,但這里有一些提示給那些面臨類似問題的人:

I eventually managed to get it working. I'm not sure what was the problem before, but here are some tips for those who are facing similar problems:

  • Web 應用程序的客戶端 ID"和Drive SDK 的客戶端 ID"讓我感到困惑.不幸的是,文檔沒有告訴您在哪個地方使用哪一個,但您似乎只需要Web 應用程序的客戶端 ID".

  • The "Client ID for web applications" and the "Client ID for Drive SDK" confused me. Unfortunately the documentation doesn't tell you which one to use at which place, but it seems like you only need the "Client ID for web applications".

如果您更新 Chrome 擴展程序或 API 控制臺,可能需要一些時間才能讓云端硬盤識別這些更改.例如,在 API 控制臺中更改 OAuth 客戶端 ID 可能需要一些時間才能生效,因為每個人都在緩存.如果您正在測試您的應用程序,刪除緩存和 cookie 有助于加快該過程.

If you update your Chrome extension or the API console it could take some time until Drive recognizes those changes. For example, changing the OAuth Client ID in the API console could take some time until it takes effect, since everybody's caching. If you are testing your application, deleting cache and cookies helps speed up the process.

祝你申請順利,感謝所有幫助過我的人!

Good luck with your applications, and thanks to everybody who helped me!

這篇關于Google Drive SDK - Java 示例不工作的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Upload progress listener not fired (Google drive API)(上傳進度偵聽器未觸發(Google 驅動器 API))
Save file in specific folder with Google Drive SDK(使用 Google Drive SDK 將文件保存在特定文件夾中)
Google Drive Android API - Invalid DriveId and Null ResourceId(Google Drive Android API - 無效的 DriveId 和 Null ResourceId)
Google drive api services account view uploaded files to google drive using java(谷歌驅動api服務賬戶查看上傳文件到谷歌驅動使用java)
Google Drive service account returns 403 usageLimits(Google Drive 服務帳號返回 403 usageLimits)
com.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example(com.google.api.client.json.jackson.JacksonFactory;Google Drive 示例中缺少)
主站蜘蛛池模板: 99精品久久99久久久久 | 91精品国产综合久久久久 | 亚洲一区二区视频 | 成人免费视频在线观看 | 欧美精品成人一区二区三区四区 | 欧美精品一区二区三区在线播放 | 国产精品久久久久久久久久 | 欧美成人免费在线视频 | 久草网站| 亚洲黄色片免费观看 | 玖玖视频网 | 红桃视频一区二区三区免费 | 国产在线一区二区三区 | 亚洲精品一二三区 | 国产高清一二三区 | 欧美国产精品一区二区三区 | 国产精品美女 | 一级片免费视频 | 久久久精品一区 | 亚洲一级毛片 | 真人女人一级毛片免费播放 | 欧美精品在线免费 | 国产乱码精品1区2区3区 | 国产精品久久国产精品 | 一区二区三区网站 | 天天躁天天操 | 亚洲欧美精品在线 | 成人午夜在线 | 久久久久国产一级毛片 | 成人国产精品色哟哟 | 小h片免费观看久久久久 | 欧美日韩成人在线 | 色婷婷狠狠 | 日韩欧美专区 | 伊人狠狠操 | 99久久精品国产毛片 | 亚洲精品乱码久久久久久蜜桃91 | 日韩国产中文字幕 | 91精品一区二区 | 精品国产区 | 久久一热 |