我的应用程序在谷歌应用引擎上运行,所以不能使用文件。我想将其他网站上的 pdf 文件保存到谷歌驱动器,但得到 IllegalArgumentException
file.setMimeType("application/pdf");
mediaContent = new InputStreamContent(file.getMimeType(),
url.openStream());
try {
File result = getDrive().files().insert(file, mediaContent)
.execute();
return result.getId();
} catch (Exception e) {
e.printStackTrace();
}
谢谢