写入CSV文件,然后在Appengine(Java)中将其压缩 [英] Writing to CSV Files and then Zipping it up in Appengine (Java)
问题描述
我目前正在开发一个在google appengine上用Java完成的项目。
I'm currently working on a project that is done in Java, on google appengine.
Appengine不允许存储文件,因此任何磁盘表示对象不能使用。其中一些包括File类。
Appengine does not allow files to be stored so any on-disk representation objects cannot be used. Some of these include the File class.
我想写数据并将其导出到几个csv文件,然后将其压缩并允许用户下载。
I want to write data and export it to a few csv files, and then zip it up, and allow the user to download it.
我如何在不使用任何文件类的情况下这样做?我不是很有经验的文件处理,所以我希望你们可以告诉我。
How may I do this without using any File classes? I'm not very experienced in file handling so I hope you guys can advise me.
谢谢。
推荐答案
如果你的数据不是巨大的,意思可以留在内存,然后导出到CSV和拉链和流下载它们都可以在他们飞。缓存可以在任何这些步骤完成,这在很大程度上取决于您的应用程序的业务逻辑。
If your data is not huge, meaning can stay in memory then exporting to CSV and zipping up and streaming it for downloading can all be done on-they-fly. Caching can be done at any of these steps which greatly depends on your application's business logic.
这篇关于写入CSV文件,然后在Appengine(Java)中将其压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!