[TRUEZIP-338] TFile cannot find all expected files Created: 24/Dec/13  Updated: 07/Feb/15  Resolved: 17/Nov/14

Status: Closed
Project: TrueZIP
Component/s: TrueZIP Driver TAR
Affects Version/s: TrueZIP 7.7.5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: diamss Assignee: Christian Schlichtherle
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 64 bit with JDK 1.6.38 / 1.7.11



 Description   

For some TAR.GZ archives generated by Maven Assembly Plugin, TruzZip canno find all files.

  • Do not work on TAR.GZ
  • Do not work on TAR if GZ was decompressed with TrueZip.
  • Work on TAR if GZ was decompressed with 7-zip.

I cannot upload the example TAR.GZ at the moment because of restrictions in my company, but I could do it soon.

Test.java
public static void main(String[] args) throws Exception {

	final TArchiveDetector detectorGz = new TArchiveDetector("gz", new TarGZipDriver(IOPoolLocator.SINGLETON));
	final TArchiveDetector detectorTar = new TArchiveDetector("tar", new TarDriver(IOPoolLocator.SINGLETON));
	final TFile gz = new TFile(args[0], detectorGz);
	final TFile tar = new TFile(gz.getParentFile(), "extracted.tar", detectorTar);

	TFile.cp_r(gz, tar, detectorGz, detectorTar);
	recursive(tar);
}

public static void recursive(final TFile file) {

	if (!file.isDirectory()) {

		System.out.println(file);
		return;
	}

	final TFile[] children = file.listFiles();

	System.out.println(file + " (" + children.length + ')');

	for (final TFile child : children) {

		recursive(child);
	}
}


 Comments   
Comment by Christian Schlichtherle [ 24/Dec/13 ]

The driver setup is wrong: The TarGZipDriver reads and writes TAR.GZ files , not just GZ files. The latter is not an archive file format, just a compressor format.

Generated at Fri Feb 12 15:46:47 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.