如何在Java中获取Google Drive REST API AlternativeLink? [英] How to get Google Drive REST api alternateLink in java?

查看:92
本文介绍了如何在Java中获取Google Drive REST API AlternativeLink?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

File file = mService.files().create(fileMetadata, content)
                    .setFields("id, webContentLink ,webViewLink, alternateLink").execute();

 Log.d(TAG, "File ID: " + file.getId());
 Log.d(TAG, "File web content link: " + file.getWebContentLink());     
 Log.d(TAG, "File web view link: " + file.getWebViewLink());
 Log.d(TAG, "File alternate link: " + file.????????);

我制作了一个文件,然后想要获取alternateLink,但是没有这样的方法来获取它吗?为什么?我在做错什么吗?

I make a file and then want to get alternateLink but there is not such a method to get it? Why? Am I doing something wrong?

推荐答案

The Drive API 允许您下载存储在Google云端硬盘中的文件.另外,您可以下载应用程序可以处理的格式的Google文档的导出版本(文档,电子表格,演示文稿等). 驱动器还支持用户通过webViewLink属性.

The Drive API allows you to download files that are stored in Google Drive. Also, you can download exported versions of Google Documents (Documents, Spreadsheets, Presentations, etc.) in formats that your app can handle. Drive also supports providing users direct access to a file via the URL in the webViewLink property.

文件的元数据:

{
"kind": "drive#file",
"id": string,
"etag": etag,
"selfLink": string,
"webContentLink": string,
"webViewLink": string,
"alternateLink": string,
"embedLink": string,
"openWithLinks": {
(key): string
}

这篇关于如何在Java中获取Google Drive REST API AlternativeLink?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆