回答

1

這是一種可能的方式:您可以通過查詢雲數據存儲在內存中構建CSV文件在雲端點並打印到一個ByteArrayOutputStream,如圖所示以下:

ByteArrayOutputStream csvOS = new ByteArrayOutputStream(); 
PrintStream printer = new PrintStream(csvOS); 
printer.println("L1C1;L1C2;L1C3"); 
printer.println("L2C1;L2C2;L2C3"); 
printer.close(); 

然後你的CSV文件保存到雲存儲和返回的URL下載它,因爲我在下面的答案解釋:

https://stackoverflow.com/a/37603225/3371862

的另一種可能性是通過谷歌應用程序引擎的servlet流的結果(即你不要通過Cloud Endpoints)。看看how to write csv file in google app by using java

相關問題