public void prepareDist(PerfTest perfTest,
							User user,
							FileEntry scriptEntry, File distDir, PropertiesWrapper properties,
							ProcessingResultPrintStream processingResult) {
		prepareDefaultFile(distDir, properties);
		List<FileEntry> fileEntries = getLibAndResourceEntries(user, scriptEntry, -1);
		if (scriptEntry.getRevision() != 0) {
			fileEntries.add(scriptEntry);
		}

		String basePath = getBasePath(scriptEntry);
		// Distribute each files in that folder.
		try {
			for (FileEntry each : fileEntries) {
				// Directory is not subject to be distributed.
				if (each.getFileType() == FileType.DIR) {
					continue;
				}
				File toDir = new File(distDir, calcDistSubPath(basePath, each));
				processingResult.printf("%s is being written.\n", each.getPath());
				log.info(format(perfTest, "{} is being written in {}", each.getPath(), toDir));
				if (isGitHubFileEntry(each)) {
					gitHubFileEntryRepository.writeContentTo(each.getPath(), toDir);
				} else {
					fileEntryRepository.writeContentTo(user, each.getPath(), toDir);
				}
			}
		} catch (IOException ex) {
			throw new PerfTestPrepareException("Fail to copy perftest files from distribution folder.\n" +
				"If you change your branch configuration, please click script refresh button before running test.", ex);
		}
		processingResult.setSuccess(true);
		prepareDistMore(perfTest, user, scriptEntry, distDir, properties, processingResult);
	}
Prepare the distribution.

@param perfTest         current running test.
@param user             user who will distribute the script.
@param scriptEntry      script to be distributed.
@param distDir          distribution target dir.
@param properties       properties set which is used for detailed distribution control.
@param processingResult processing result holder.
ngrinder-controller/src/main/java/org/ngrinder/script/handler/ScriptHandler.java