用于压缩/解压缩的便携式 java 解决方案

发布于 2024-12-18 09:02:28 字数 179 浏览 1 评论 0原文

我正在寻找一个简单的包,我可以简单地从命令行(即批处理脚本)调用它,它可以在很大程度上取代 Linux 中 zip/unzip 工具的功能。理想情况下,我能够将应用程序(.jar 文件)部署到任何运行 Java 的计算机,告诉它要解压缩什么,它就会执行它的操作。这看起来应该相当简单,我不想重新发明轮子,但我似乎找不到这样的东西。感谢您的帮助!

I'm looking for a simple package that I may simply call from command line (i.e. batch script) that can mostly replace the functionality of zip/unzip tools in Linux. Ideally, I'd be able to deploy the application (.jar file) to any machine that runs Java, tell it what to unzip and it does it's thing. This seems like it should be fairly simple and I don't want to re-invent the wheel, but I can't seem to find something like this. Thanks for any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

开始看清了 2024-12-25 09:02:28

我不知道有什么现成的工具,但您可以轻松地(可能是单个类)使用 java.util.zip,例如 ZipFile 类。

I don't know a ready tool, but you could easily (a single class probably) write your own unzip tool in Java using the classes from java.util.zip, e.g. the ZipFile class.

猫七 2024-12-25 09:02:28

Ant 任务 - zipunzip 应该对你有一些好处,如果你不想完全重新发明轮子。您可以将它们作为 Ant 的一部分进行调用,也可以使用 Java 代码直接调用任务实现。

The Ant tasks - zip and unzip should be of some benefit to you, if you don't want to completely re-invent the wheel. You could either call them as part of Ant, or call the task implementations directly using Java code.

梦回梦里 2024-12-25 09:02:28

您想查看 ZipInputStream 和如果你想自己构建一个工具,它的兄弟 ZipOutputStream 。

但严肃地说:您在安装了 Java 但没有压缩工具来执行 zip 和解压缩的系统上运行工具的可能性有多大?

You want to look at ZipInputStream and its brother ZipOutputStream if you want to build a tool yourself.

But seriously: what is the chance that you are running a tool on a system which does have Java installed, but does not have compression tools to perform zip and unzip?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文