/**
* 解压
* @param fileUtils 文件对象
* @param srcF 源文件
* @param dir 目录
* @see Expand#expandFile(FileUtils, File, File)
* @throws IOException 抛出IO异常
*/
protected void expandFile(FileUtils fileUtils, File srcF, File dir)
throws IOException
{
FileInputStream fis = null;
TarInputStream tis = null;
try
{
fis = new FileInputStream(srcF);
tis = new TarInputStream(compression.decompress(srcF,
new BufferedInputStream(fis)));
TarEntry te = null;
while ((te = tis.getNextEntry()) != null)
{
extractFile(fileUtils,
srcF,
dir,
tis,
te.getName(),
te.getModTime(),
te.isDirectory());
}
}
finally
{
if (tis != null)
{
tis.close();
}
if (fis != null)
{
fis.close();
}
}
}
解压tar包工具UntarUtil(2)
最新推荐文章于 2023-01-25 12:44:56 发布