使用 Groovy 解压缩存档 [英] Unzip Archive with Groovy

查看:43
本文介绍了使用 Groovy 解压缩存档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Groovy 中是否有内置支持来处理 Zip 文件(groovy 方式)?

is there a built-in support in Groovy to handle Zip files (the groovy way)?

或者我必须使用 Java 的 java.util.zip.ZipFile 来处理 Groovy 中的 Zip 文件吗?

Or do i have to use Java's java.util.zip.ZipFile to process Zip files in Groovy ?

推荐答案

AFAIK,没有本地方式.但请查看这篇文章,了解如何添加.zip(...) 方法到 File,这将非常接近您要查找的内容.你只需要创建一个 .unzip(...) 方法.

AFAIK, there isn't a native way. But check out this article on how you'd add a .zip(...) method to File, which would be very close to what you're looking for. You'd just need to make an .unzip(...) method.

这篇关于使用 Groovy 解压缩存档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆