}
throw new Exception();
}
public void doDecompression(String tarFile,String destFolder) {
TarInputStream tis = null;
try {
tis = new TarInputStream(new BufferedInputStream(new FileInputStream(tarFile)));
TarEntry entry;
try {
while ((entry = tis.getNextEntry()) != null) {
int count;
byte data[] = new byte[2048];
FileOutputStream fos = new FileOutputStream(destFolder + "/" + entry.getName());
BufferedOutputStream dest = new BufferedOutputStream(fos);
while ((count = tis.read(data)) != -1) {
dest.write(data, 0, count);
}
dest.flush();
dest.close();
}
} catch (IOException ex) {
logger.warn(ex.getLocalizedMessage());
}
try {
tis.close();
} catch (IOException ex) {
logger.warn(ex.getLocalizedMessage());
}
} catch (FileNotFoundException ex) {
logger.warn(ex.getLocalizedMessage());
} finally {
try {
tis.close();
} catch (IOException ex) {
logger.warn(ex.getLocalizedMessage());
}
}
}