Comprimir el directorio a tar.gz con Commons Compress

Estoy encontrando un problema usando la biblioteca de compresión commons para crear un tar.gz de un directorio. Tengo una estructura de directorio que es la siguiente.

parent/
    child/
        file1.raw
        fileN.raw

Estoy usando el siguiente código para hacer la compresión. Funciona bien sin excepciones. Sin embargo, cuando intento descomprimir ese archivo tar.gz, obtengo un solo archivo con el nombre "childDirToCompress". Es el tamaño correcto, por lo que los archivos se han añadido claramente entre sí en el proceso de marcado. La salida deseada sería un directorio. No puedo entender lo que estoy haciendo mal. ¿Puede algún compresor de sabios comunes ubicarme en el camino correcto?

CreateTarGZ() throws CompressorException, FileNotFoundException, ArchiveException, IOException {
            File f = new File("parent");
            File f2 = new File("parent/childDirToCompress");

            File outFile = new File(f2.getAbsolutePath() + ".tar.gz");
            if(!outFile.exists()){
                outFile.createNewFile();
            }
            FileOutputStream fos = new FileOutputStream(outFile);

            TarArchiveOutputStream taos = new TarArchiveOutputStream(new GZIPOutputStream(new BufferedOutputStream(fos)));
            taos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_STAR); 
            taos.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);
            addFilesToCompression(taos, f2, ".");
            taos.close();

        }

        private static void addFilesToCompression(TarArchiveOutputStream taos, File file, String dir) throws IOException{
            taos.putArchiveEntry(new TarArchiveEntry(file, dir));

            if (file.isFile()) {
                BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
                IOUtils.copy(bis, taos);
                taos.closeArchiveEntry();
                bis.close();
            }

            else if(file.isDirectory()) {
                taos.closeArchiveEntry();
                for (File childFile : file.listFiles()) {
                    addFilesToCompression(taos, childFile, file.getName());

                }
            }
        }

Respuestas a la pregunta(5)

Su respuesta a la pregunta