protected void tarConfigFiles()
      throws SystemException {

      try {
        File compressedOutputFile = new File(tmpDir, fileName + "-configs" + Configuration.DEF_ARCHIVE_EXTENSION);
        FileOutputStream fOut = new FileOutputStream(compressedOutputFile);
        BufferedOutputStream bOut = new BufferedOutputStream(fOut);
        GzipCompressorOutputStream gzOut = new GzipCompressorOutputStream(bOut);
        TarArchiveOutputStream tOut = new TarArchiveOutputStream(gzOut);
        tOut.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);
        tOut.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);

        try {
          for (ServiceComponentHostResponse schResponse : serviceComponentHostResponses) {
            String componentName = schResponse.getComponentName();
            File compressedInputFile = new File(tmpDir, componentName + "-configs" + Configuration.DEF_ARCHIVE_EXTENSION);
            FileInputStream fin = new FileInputStream(compressedInputFile);
            BufferedInputStream bIn = new BufferedInputStream(fin);
            GzipCompressorInputStream gzIn = new GzipCompressorInputStream(bIn);
            TarArchiveInputStream tarIn = new TarArchiveInputStream(gzIn);
            TarArchiveEntry entry = null;
            try {
              while ((entry = tarIn.getNextTarEntry()) != null) {
                entry.setName(componentName + File.separator + entry.getName());
                tOut.putArchiveEntry(entry);
                if (entry.isFile()) {
                  IOUtils.copy(tarIn, tOut);
                }
                tOut.closeArchiveEntry();
              }
            } catch (Exception e) {
              throw new SystemException(e.getMessage(), e);
            } finally {
              tarIn.close();
              gzIn.close();
              bIn.close();
              fin.close();
            }
          }
        } finally {
          tOut.finish();
          tOut.close();
        }
      } catch (Exception e) {
        throw new SystemException(e.getMessage(), e);
      }
    }
creates single compressed file from the list of existing compressed file
@throws SystemException
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java