private Path getNewFolder(Path targetDir) {
		CountDownLatch countDownLatch = new CountDownLatch(1);
		final Path[] folder = new Path[1];
			threadService.runActionLater(()->{
				try{
					DialogBuilder dialog = DialogBuilder.newFolderDialog();
					dialog.showAndWait().map(String::trim).ifPresent(folderName -> {
						if (dialog.isShowing()) {
							dialog.hide();
						}
						if (folderName.matches(DialogBuilder.FOLDER_NAME_REGEX)) {
							folder[0] = targetDir.resolve(folderName);
							countDownLatch.countDown();
						}
					});
				} catch (Exception e) {
					logger.error(e.getMessage());
					countDownLatch.countDown();
				}
			});
		try {
			countDownLatch.await(2, TimeUnit.MINUTES);
		} catch (InterruptedException e) {
			throw new RuntimeException("Couldn't provide folder name in given time", e);
		}
		if (folder.length == 0 || Objects.isNull(folder[0])) {
			throw new RuntimeException("Folder name is required");
		}
		return folder[0];
	}
Depending on the location of the template downloads it or copies the file. If
it is a zip-archive it should be extracted. During the process no existing
files should be overwritten.

@param targetDir
@throws Exception
src/main/java/com/kodedu/service/TemplateService.java