File fsrc = new File(fname);
app.open(fsrc, "r:gz");
//String dbname = extractName(fname);
//String targetDirAndDB = FilenameUtils.concat(targetDir,dbname);
//app.extract(targetDirAndDB);
app.extract(targetDir);
//for saving the disk space, truncate file size to zero but
//reserve the "date of last modified" as the tag.
truncate(fsrc);
if (removeSourceFile)
fsrc.delete();