我需要使用Java提取.tar.Z文件 [英] I need to extract .tar.Z file using java
问题描述
有人用Java编写代码来提取.tar.Z文件吗?
Do anyone have coding in java to extract .tar.Z files.
假设我有一个名为home.tar.Z的文件 我需要使用Java代码提取此文件,您能提供任何示例代码吗?
Assume that i am having file called home.tar.Z I need extract this file using java code, can you give any sample code.
谢谢
推荐答案
.Z
扩展名不是gzip
扩展名,它来自compress
.
The .Z
extension is not the gzip
extension, it is from compress
.
您可以从Java启动Shell脚本,我会那样做,因为我不知道Java的任何compress
库.对于tar/gz,您可以使用Plexus Archiver或Apache Commons VFS.
You can launch shell scripts from Java, I'd do it like that, since I don't know any compress
library for Java. For tar/gz you could use Plexus Archiver or Apache Commons VFS.
请参见
- How do I extract a tar file in Java?
- How to Compress/Decompress tar.gz files in java
可悲的是,似乎没有任何库涵盖.Z
文件,因此我认为这些链接对您不可用.
Sadly it doesn't seem that any libraries cover .Z
files, so I think those links are unusable for you.
但是看看:
这使您可以使用shell命令执行所有操作,这意味着您不必费心从Java进行操作.
This allows you to do everything with the shell commands which means you won't have to bother doing it from Java.
这篇关于我需要使用Java提取.tar.Z文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!