- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {ScheduledThreadPoolExecutor s =
new ScheduledThreadPoolExecutor(corePoolSize)
ThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
String str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
- Smart code suggestions by Codota
}
@ApiOperation(value = "Delete a content item", tags = { "Content item" }) @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the content item was deleted."), @ApiResponse(code = 404, message = "Indicates the content item was not found.") }) @DeleteMapping(value = "/content-service/content-items/{contentItemId}") public void deleteContentItem(@ApiParam(name = "contentItemId") @PathVariable String contentItemId, HttpServletResponse response) { ContentItem contentItem = getContentItemFromRequest(contentItemId); if (restApiInterceptor != null) { restApiInterceptor.deleteContentItem(contentItem); } contentService.deleteContentItem(contentItemId); response.setStatus(HttpStatus.NO_CONTENT.value()); } }
public void deleteContent(String contentId, HttpServletResponse response) { ContentItem contentItem = contentService.createContentItemQuery().id(contentId).singleResult(); if (contentItem == null) { throw new NotFoundException("No content found with id: " + contentId); } if (!permissionService.hasWritePermissionOnRelatedContent(SecurityUtils.getCurrentUserObject(), contentItem)) { throw new NotPermittedException("You are not allowed to delete the content with id: " + contentId); } if (contentItem.getField() != null) { // Not allowed to delete content that has been added as part of a form throw new NotPermittedException("You are not allowed to delete the content with id: " + contentId); } contentService.deleteContentItem(contentItem.getId()); }