1

使用 api 时在 Google 驱动器文件上随机获取 ResourceNotFoundException。他们工作了好几天,一段时间后就拒绝通过 API 下载。我仍然可以从 UI 访问它们,并且所有权限设置都正常,但是 API 访问被破坏。有任何想法吗?

com.google.gdata.util.ResourceNotFoundException: OK
<!DOCTYPE html><html lang="en" ><head><meta name="description" content="Web word processing, presentations and spreadsheets"><link rel="shortcut icon" href="https://ssl.gstatic.com/docs/documents/images/kix-favicon5.ico"><title>Google Docs -- Page Not Found</title><link href="//fonts.googleapis.com/css?family=Open+Sans:300" rel="stylesheet" type="text/css"><style>/* Copyright 2012 Google Inc. All Rights Reserved. */
.goog-inline-block{position:relative;display:-moz-inline-box;display:inline-block}* html .goog-inline-block{display:inline}*:first-child+html .goog-inline-block{display:inline}#drive-logo{color:#91959c;font-family:"Open Sans",Arial,sans-serif;font-size:27px;font-weight:300;position:absolute;text-shadow:0 1px 1px white;white-space:nowrap}#drive-logo img{padding:0 0.4em 0 0;position:relative;top:2px;vertical-align:middle}#drive-logo a{color:#91959c;text-decoration:none}#drive-logo span.goog-inline-block{margin-top:3px;vertical-align:top}</style><style type="text/css">body {background-color: #fff; font-family: Arial,sans-serif; font-size: 13px; margin: 0; padding: 0;}a, a: link, a: visited {color: #112ABB;}</style><style type="text/css">.errorMessage {font-size: 12pt; font-weight: bold; line-height: 150%;}</style></head><body><div style="margin: auto; max-width: 750px;"><div style="margin: 80px 40px 20px 40px; position:relative; "><div style="position: absolute; top: -80px;"><h1 id="drive-logo"><a href="/"><img src="//www.google.com/images/logos/google_logo_41.png" width="116" height="41" alt="Google logo" ><span class="goog-inline-block">Drive</span></a></h1></div><div align="center"><p class="errorMessage" style="padding-top: 50px">Sorry, the page (or document) you have requested does not exist.</p><p>Make sure that you have the correct URL and that the owner of the document hasn&#39;t deleted it.</p><div style="background: #F0F6FF; border: 1px solid black; margin-top: 35px; padding: 10px 125px; width: 300px;"><p><strong>Want to create your own online docs?</strong></p><p>Google Docs makes it easy to create, store and share online documents, spreadsheets and presentations.</p><p>Learn more at <a href="https://docs.google.com">docs.google.com</a>.</p></div></div></div></div></body></html>

    at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:599)
    at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:564)
    at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)
    at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)
    at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:536)
    at com.google.gdata.client.media.MediaService.getMediaResource(MediaService.java:234)
    at com.google.gdata.client.media.MediaService.getMedia(MediaService.java:286)
    at com.google.gdata.client.media.MediaService.getMedia(MediaService.java:302)
4

1 回答 1

1

您似乎使用的是旧版 Gdata 库,而不是新版 Drive SDK。这并不是说它不应该工作,只是它不再是首选的 API。文档和工具更好地支持 Drive SDK。

您返回的是 HTML 页面而不是简单的 API 响应,这有点奇怪。你用的是什么网址?

于 2012-09-02T15:28:23.687 回答