Source:
public Response updateRegistryEntry(String registryId, String entryId, RegistryEntryDTO registryEntry, InputStream definitionFileInputStream, Attachment definitionFileDetail, MessageContext messageContext) { String tenantDomain = RestApiUtil.getLoggedInUserTenantDomain(); String user = RestApiUtil.getLoggedInUsername(); EndpointRegistry registryProvider = new EndpointRegistryImpl(); EndpointRegistryEntry updatedEntry = null; try { EndpointRegistryInfo endpointRegistry = registryProvider.getEndpointRegistryByUUID(registryId, tenantDomain); if (endpointRegistry == null) { RestApiUtil.handleResourceNotFoundError("Endpoint registry with the id: " + registryId + " is not found", log); } EndpointRegistryEntry endpointRegistryEntry = registryProvider.getEndpointRegistryEntryByUUID(registryId, entryId); if (endpointRegistryEntry == null) { RestApiUtil.handleResourceNotFoundError("Endpoint registry entry with the id: " + entryId + " is not found", log); } ResourceFile definitionFile = new ResourceFile(definitionFileInputStream, definitionFileDetail .getContentType().getType()); EndpointRegistryEntry entryToUpdate = EndpointRegistryMappingUtils.fromDTOToRegistryEntry(registryEntry, entryId, definitionFile, endpointRegistry.getRegistryId()); registryProvider.updateEndpointRegistryEntry(entryToUpdate); updatedEntry = registryProvider.getEndpointRegistryEntryByUUID(registryId, entryId); } catch (APIMgtResourceAlreadyExistsException e) { RestApiUtil.handleResourceAlreadyExistsError("Endpoint Registry Entry with name '" + registryEntry.getEntryName() + "' already exists", e, log); } catch (APIManagementException e) { RestApiUtil.handleInternalServerError("Error while updating the endpoint registry entry " + "with id: " + entryId, e, log); } audit.info("Successfully updated endpoint registry entry with id :" + entryId + " in :" + registryId + " by:" + user); return Response.ok().entity(EndpointRegistryMappingUtils.fromRegistryEntryToDTO(updatedEntry)).build(); }

Target:
public Response updateRegistryEntry(String registryId, String entryId, RegistryEntryDTO registryEntry, InputStream definitionFileInputStream, Attachment definitionFileDetail, MessageContext messageContext) { String tenantDomain = RestApiUtil.getLoggedInUserTenantDomain(); String user = RestApiUtil.getLoggedInUsername(); EndpointRegistry registryProvider = new EndpointRegistryImpl(); EndpointRegistryEntry updatedEntry = null; try { EndpointRegistryInfo endpointRegistry = registryProvider.getEndpointRegistryByUUID(registryId, tenantDomain); if (endpointRegistry == null) { RestApiUtil.handleResourceNotFoundError("Endpoint registry with the id: " + registryId + " is not found", log); } EndpointRegistryEntry endpointRegistryEntry = registryProvider.getEndpointRegistryEntryByUUID(registryId, entryId); if (endpointRegistryEntry == null) { RestApiUtil.handleResourceNotFoundError("Endpoint registry entry with the id: " + entryId + " is not found", log); } ResourceFile definitionFile; if (definitionFileInputStream == null || definitionFileDetail == null) { definitionFile = new ResourceFile(null, null); } else { definitionFile = new ResourceFile(definitionFileInputStream, definitionFileDetail .getContentType().getType()); } EndpointRegistryEntry entryToUpdate = EndpointRegistryMappingUtils.fromDTOToRegistryEntry(registryEntry, entryId, definitionFile, endpointRegistry.getRegistryId()); registryProvider.updateEndpointRegistryEntry(entryToUpdate); updatedEntry = registryProvider.getEndpointRegistryEntryByUUID(registryId, entryId); } catch (APIMgtResourceAlreadyExistsException e) { RestApiUtil.handleResourceAlreadyExistsError("Endpoint Registry Entry with name '" + registryEntry.getEntryName() + "' already exists", e, log); } catch (APIManagementException e) { RestApiUtil.handleInternalServerError("Error while updating the endpoint registry entry " + "with id: " + entryId, e, log); } audit.info("Successfully updated endpoint registry entry with id :" + entryId + " in :" + registryId + " by:" + user); return Response.ok().entity(EndpointRegistryMappingUtils.fromRegistryEntryToDTO(updatedEntry)).build(); }