commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Callebaut <benoit.calleb...@euphonynet.be>
Subject [vfs][compress] TAR Filesystem creation && temp dir
Date Tue, 28 Mar 2006 20:59:01 GMT
Hello,
I am running the VFS test suite. I have problems, so I do manual tests.
In one of them, I try to parse the following URI (the file does exist)
uri = "tar:gz://Z:\\programming\\apache\\jakarta\\commons\\vfs\\target\
\test-data\\nested.tar.gz!/nested.tar/file1.txt";
byy calling manager.resolveFile("uri");

During the "creation" of a "tar.gz" file, you create the tar file.

When you create a TAR Filesystem, it creates a temporary directory.

You end up with a FileObject entry representing the tar file created in
the VFS namespace. This entry represents a directory.

Afterward, when you want to create the content of thye tar file, you
first open it. At this time, you call 
createTarFile method in class TarFileSystem try to read a file on the
(local) filesystem by using the following statement : 
new TarInputStream(new FileInputStream(file));

This leads to an exception because it tries to open a directory instead
of a file.

What is the good way ? Building the whole tar tree in a stream in which
case the first part of the code is wrong (can be hard to solve since it
is something that is not in the TAR provider). Or building the entries
in a temporary location. In the later case, you have to have to handle
the case of a non yet existing tar file and first decompress it
internally if it exist.

I think the first one is better.Bu I have to check this.




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message