@PUT
@Path("file_format/{path: .*}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public FileFormatUI saveFormatSettings(FileFormat fileFormat, @PathParam("path") String path)
throws FileNotFoundException, HomeNotFoundException, NamespaceException {
FilePath filePath = FilePath.fromURLPath(homeName, path);
final DatasetConfig existingDSConfig = namespaceService.getDataset(filePath.toNamespaceKey());
final FileConfig oldConfig = toFileConfig(existingDSConfig);
final FileConfig newConfig = fileFormat.asFileConfig();
newConfig.setCtime(oldConfig.getCtime());
newConfig.setFullPathList(oldConfig.getFullPathList());
newConfig.setName(oldConfig.getName());
newConfig.setOwner(oldConfig.getOwner());
newConfig.setLocation(oldConfig.getLocation());
catalog.createOrUpdateDataset(namespaceService, new NamespaceKey(HomeFileSystemStoragePlugin.HOME_PLUGIN_NAME), filePath.toNamespaceKey(), toDatasetConfig(newConfig, DatasetType.PHYSICAL_DATASET_HOME_FILE,
securityContext.getUserPrincipal().getName(), existingDSConfig.getId()));
return new FileFormatUI(FileFormat.getForFile(newConfig), filePath);
}