2013-06-28 82 views

回答

1

我已經解決了通過手動修改exportLink問題,如下圖所示:

if(file.getMimeType().equals("application/vnd.google-apps.spreadsheet")){ 
    String str= file.getExportLinks().get("application/pdf").replaceFirst("pdf", 
    enter code here"csv&grid=0"); 
    InputStream input = service 
      .getRequestFactory() 
      .buildGetRequest(new GenericUrl(str)).execute().getContent(); 
0

如果問題是搜索,這可能會更好只使用search API ,將mimeType是

應用/ vnd.google-apps.spreadsheet

如果您想要使用exportLinks來讀取您想要將其導出到OpenOffice SpreadSheet的內容,然後將該錶轉換爲csv,there is a link about it

+0

我知道搜索API,但我要下載的內容,所以我可以搜索它正則表達式。我們可以找到其他方式,而不是將每個MIME類型轉換爲文本。 – user1625525

相關問題