@PostMapping("/save/**")
	public void save(User user, @RequestBody FileSaveParams fileSaveParams) {
		FileEntry fileEntry = fileSaveParams.getFileEntry();

		if (fileEntry.getFileType().getFileCategory() == FileCategory.SCRIPT) {
			Map<String, String> map = buildMap(
				"validated", fileSaveParams.getValidated(),
				"targetHosts", trimToEmpty(fileSaveParams.getTargetHosts())
			);
			fileEntry.setProperties(map);
		}
		fileEntryService.save(user, fileEntry);

		String basePath = getPath(fileEntry.getPath());
		if (fileSaveParams.isCreateLibAndResource()) {
			fileEntryService.addFolder(user, basePath, "lib", getMessages("script.commit.libFolder"));
			fileEntryService.addFolder(user, basePath, "resources", getMessages("script.commit.resourceFolder"));
		}
	}
Save a fileEntry.

@param user                 current user
@param fileSaveParams       model for params
ngrinder-controller/src/main/java/org/ngrinder/script/controller/FileEntryApiController.java