我試圖在driveOperations()實現中使用Spring社交谷歌庫。每當我嘗試下載文件時,都會出現錯誤。我甚至試圖下載沒有成功的公共共享文件。認證正在工作。如何用spring社交谷歌下載文件?
我已經試過以下變化:
Resource resource = google.driveOperations().downloadFile("uniquedocidhere");
// another approach, no error, but getDownloadUrl() is null
DriveFile driveFile = google.driveOperations().getFile("uniqeidhere");
google.driveOperations().downloadFile(driveFile); // 404
// finally trying it with a file drive v2 url gives an invalid URI error
我添加的車程範圍內,所以我知道這是不是一個問題。當我最初使用應用程序進行身份驗證時,系統會提示我輸入驅動器。
有問題的文件是谷歌電子表格,但我希望有他們下載爲Excel文件。有了股票谷歌SDK,這可以通過獲取exportLinks然後從該URL獲取。而彈簧社會谷歌圖書館有
final Map<String, String> links = driveFile.getExportLinks();
的導出鏈接無法使用,因爲downloadFile似乎並不在這裏與網址的工作(或者他們同樣爲空)。
有誰知道如何獲得一個文件下載與春季社交谷歌和驅動器?我還沒有找到涵蓋驅動器的示例代碼,只有谷歌加和任務。
目前使用Spring 1.3.3啓動/彈簧4.2.5與Spring社會谷歌1.0.0發佈
我很驚訝春季社交Google不需要訪問令牌來使用API。我猜是有公共和私人API? – DavidS
在您提到它之後,API中提供了一個google.getAccessToken()。 –