Tabnine Logo
ContentService.getContentItemData
Code IndexAdd Tabnine to your IDE (free)

How to use
getContentItemData
method
in
org.flowable.content.api.ContentService

Best Java code snippets using org.flowable.content.api.ContentService.getContentItemData (Showing top 2 results out of 315)

origin: org.flowable/flowable-content-rest

InputStream dataStream = contentService.getContentItemData(contentItemId);
if (dataStream == null) {
  throw new FlowableObjectNotFoundException("Content item with id '" + contentItemId + "' doesn't have content associated with it.");
origin: org.flowable/flowable-ui-task-rest

public void getRawContent(String contentId, HttpServletResponse response) {
  ContentItem contentItem = contentService.createContentItemQuery().id(contentId).singleResult();
  if (contentItem == null) {
    throw new NotFoundException("No content found with id: " + contentId);
  }
  if (!contentItem.isContentAvailable()) {
    throw new NotFoundException("Raw content not yet available for id: " + contentId);
  }
  if (!permissionService.canDownloadContent(SecurityUtils.getCurrentUserObject(), contentItem)) {
    throw new NotPermittedException("You are not allowed to read the content with id: " + contentId);
  }
  // Set correct mine-type
  if (contentItem.getMimeType() != null) {
    response.setContentType(contentItem.getMimeType());
  }
  // Write content response
  try (InputStream inputstream = contentService.getContentItemData(contentId)) {
    IOUtils.copy(inputstream, response.getOutputStream());
  } catch (IOException e) {
    throw new InternalServerErrorException("Error while writing raw content data for content: " + contentId, e);
  }
}
org.flowable.content.apiContentServicegetContentItemData

Popular methods of ContentService

  • createContentItemQuery
  • saveContentItem
  • deleteContentItem
  • newContentItem

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now