Handling gz-ed tar files in CF?
I'm having problems dealing with files that I am receiving that are gzed tar files. CFZIP does not handle gz files, but I have tried using a function that I found a while back on fusion coder.com that uses java's ability to handle gziped files. I uses this code to handle the unzipping:
// Open the compressed file
localStruct.inFilename = "#arguments.inputFilePath#";
localStruct.file_in = createobject('java','java.io.FileInputStream').init(localStruct.inFilename);
localStruct.fin_obj = createobject('java','java.util.zip.GZIPInputStream');
localStruct.fin = localStruct.fin_obj.init(localStruct.file_in);
But my problem is that this gives me the .tar file, and I cannot find any way of pulling the file out of the tar file.
I used to have success doing a CFEXECUTE of the 7z utility, and it seems to automatically ahndle the tar file because all I give it is the .gz file and it sends me back the actual data file that is inside of the tar. But I'm setting up a new CF server and having problems getting that kludge to work, and am hoping to find a cleaner way of doing all of this.
Any hints are appreciated. I've been googling this all over but have not found anything that helps me do this from my CF code. I'm running CF9 btw.
thanks,
-reed
