找不到从google drive API下载的文档,它在哪里?

我的心
 OutputStream outputStream = new ByteArrayOutputStream();
service.files().export(fileId, "application/vnd.openxmlformats-officedocument.wordprocessingml.document")
.executeMediaAndDownloadTo(outputStream);
一个板球运动员

使用不同的输出流

File file = new java.io.File("foo.docx");
try (FileOutputStream outputStream = new FileOutputStream(file)) {
    // if file doesn't exists, then create it
    if (!file.exists()) {
        file.createNewFile();
    }
    service.files()
        .export(fileId, "application/vnd.openxmlformats-officedocument.wordprocessingml.document")
        .executeMediaAndDownloadTo(outputStream):
} 

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章