[英]How to download all folder content in Liferay 6.2
Is there any way to download a folder : all files within the folder and subfolders in Liferay 6.2 without using a loop through all files existing in the folder ? 有什么方法可以下载文件夹:Liferay 6.2中该文件夹及其子文件夹中的所有文件,而无需循环浏览该文件夹中现有的所有文件?
I need to do it programmatically. 我需要以编程方式进行操作。
Example :
Folder to download "XFolder"
XFolder
- SubFolder1
- File11
- File12
- SubFolder2
- File21
- File22
- File1
- File2
When choosing to download XFolder, the system searches the folder in document and media and saves all the folder content in a .zip file in disk. 选择下载XFolder时,系统会在文档和媒体中搜索文件夹,并将所有文件夹内容保存在磁盘的.zip文件中。
The content should have the same structure above. 内容应具有与上面相同的结构。
Thank you for your help. 谢谢您的帮助。
You can try to use the "treePath" value of folder and entry to figure out the files but you still will require some looping. 您可以尝试使用文件夹和条目的“ treePath”值来找出文件,但是仍然需要进行一些循环。
You will probably need dynamic queries for this. 为此,您可能需要动态查询。
the algorithm should go something like this. 该算法应该是这样的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.