public File createPackage(PackageHandler packageHandler, PackageDownloadInfo packageDownloadInfo) {
		synchronized (AgentPackageService.class) {
			File packageFile = packageHandler.getPackageFile(packageDownloadInfo, false);
			if (packageFile.exists()) {
				return packageFile;
			}
			FileUtils.deleteQuietly(packageFile);
			try (TarArchiveOutputStream tarOutputStream = createTarArchiveStream(packageFile)) {
				addDependentLibToTarStream(packageHandler, tarOutputStream);
				if (!(packageHandler instanceof AgentPackageHandler) || isNotEmpty(packageDownloadInfo.getConnectionIp())) {
					packageHandler.addConfigToPackage(tarOutputStream, packageHandler.getConfigParam(packageDownloadInfo));
				}
			} catch (Exception e) {
				LOGGER.error("Error while generating an agent package" + e.getMessage());
			}
			return packageFile;
		}
	}
Create package from PackageHandler.

@return File package.
ngrinder-controller/src/main/java/org/ngrinder/agent/service/AgentPackageService.java