0

我有以下代码:

def copyFile(bucket:String, filename:String, newFilename:String) {
    getFile(bucket, filename) match {
      case Some(storageObject) => storage.objects().copy(bucket, filename, bucket, newFilename, storageObject).execute()
      case None => throw new FileNotFoundException("file " + filename + " not found")
    }
  }

代码找到了文件,所以我知道存储桶、文件名和存储对象是有效的。对于我的测试,newFilename 只是“test123”,所以不确定这怎么可能是错误的。另外,为什么该方法需要 storageObject?似乎拥有现有的和新的存储桶和文件名就足够了。不幸的是,错误消息确实不透明。

400 Bad Request
{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "Invalid argument.",
    "reason" : "invalid"
  } ],
  "message" : "Invalid argument."
}
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "Invalid argument.",
    "reason" : "invalid"
  } ],
  "message" : "Invalid argument."
}
4

0 回答 0