public static void addFileToTar(TarArchiveOutputStream tarStream, File file, String path, int mode) throws IOException {
		TarArchiveEntry entry = new TarArchiveEntry(path);
		entry.setSize(file.length());
		entry.setMode(mode);
		BufferedInputStream bis = null;
		try {
			tarStream.putArchiveEntry(entry);
			bis = new BufferedInputStream(new FileInputStream(file));
			IOUtils.copy(bis, tarStream);
		} catch (IOException e) {
			throw processException("Error while adding File to Tar file", e);
		} finally {
			IOUtils.closeQuietly(bis);
			tarStream.closeArchiveEntry();
		}
	}
Add a file into tar.

@param tarStream TarArchive outputStream
@param file      file
@param path      relative path to append
@param mode      mode for this entry
@throws IOException thrown when having IO problem.
ngrinder-core/src/main/java/org/ngrinder/common/util/CompressionUtils.java