javagoogledriveapi下载文件

javagoogledriveapi下载文件,java,google-drive-api,Java,Google Drive Api,我正在尝试下载带有驱动器Api的文件,但遇到了一些问题。我阅读本指南并使用此代码 String fileId = "0BwwA4oUTeiV1UVNwOHItT0xfa2M"; OutputStream outputStream = new ByteArrayOutputStream(); driveService.files().get(fileId).executeMediaAndDownloadTo(outputStream); 每次我都会犯这个错误` com.google.api.cl

我正在尝试下载带有驱动器Api的文件,但遇到了一些问题。我阅读本指南并使用此代码

String fileId = "0BwwA4oUTeiV1UVNwOHItT0xfa2M";
OutputStream outputStream = new ByteArrayOutputStream();
driveService.files().get(fileId).executeMediaAndDownloadTo(outputStream);
每次我都会犯这个错误`

com.google.api.client.http.HttpResponseException: 400 Bad Request
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "badRequest",
    "message": "Bad Request"
   }
  ],
  "code": 400,
  "message": "Bad Request"
 }
}`
发件人:

遇到的错误可能意味着未提供必需的字段或参数、提供的值无效或提供的字段组合无效

尝试将重复的父项添加到驱动器项时,可能会引发此错误。当尝试添加将在目录图中创建循环的父级时,也可以抛出该循环

您还可以尝试中建议的解决方案,其中在HTTP GET请求中指定正确的版本号可能是遇到错误的可能解决方案