【问题标题】:how to get text document content with the google docs api如何使用 google docs api 获取文本文档内容
【发布时间】:2012-06-29 14:33:59
【问题描述】:

我尝试使用 google docs api 获取文本文档的内容,这就是我获取 url 以像文本一样导出文档的方式

  MediaContent mc = (MediaContent) entry.getContent();
  String UrlForDownload = mc.getUri()+"&exportFormat=txt&format=txt";

但不知道如何在java中获取内容,

希望有人能提前帮忙

【问题讨论】:

    标签: java google-docs google-docs-api google-drive-api


    【解决方案1】:

    请尝试以下代码:

    MediaContent mc = new MediaContent();
    mc.setUri(UrlForDownload);
    MediaSource ms = docsService.getMedia(mc);
    InputStream in = ms.getInputStream();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-06-16
      • 1970-01-01
      • 2012-06-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多