private function initTar(PhingFile $tarfile)
    {
        $compression = null;
        $tarfileName = $tarfile->getName();
        $mode = strtolower(substr($tarfileName, strrpos($tarfileName, '.')));

        $compressions = [
            'gz' => ['.gz', '.tgz',],
            'bz2' => ['.bz2',],
        ];
        foreach ($compressions as $algo => $ext) {
            if (in_array($mode, $ext)) {
                $compression = $algo;
                break;
            }
        }

        return new Archive_Tar($tarfile->getAbsolutePath(), $compression);
    }