简体   繁体   中英

How to create a Spread Sheet on Google Drive Using Java and Drive API

我正在尝试使用Java中的DRIVE API在Google Drive上创建电子表格,Google网站上的文档非常混乱,有人可以通过指向一个示例示例来帮助我,该示例​​演示如何使用Java在Google Drive上创建文档最新的DRIVE API?

Based from this SO question , using Drive API seems to only let you create new empty files with the spreadsheet MIME type. The Drive API is only concerned with operations at the whole file level. It is only possible in Google Drive to upload the created spreadsheet.

You can use Google Sheets API (formerly called the Google Spreadsheets API) which lets you develop client applications that create, read and modify worksheets and data in Google Sheets. This API can manage the worksheets in a Google Sheets file. You should strongly consider using a GData client library to interact with the API. Follow the following steps here to setup a development environment for working with the Sheets API.

You can create a spreadsheet via Drive API by calling files.create() with mimeType=application/vnd.google-apps.spreadsheet and uploading a CSV file. See Importing to Google Docs Types where there's a Java sample.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM