Class HippoBinaryNodeUtils

java.lang.Object
org.onehippo.forge.content.exim.core.util.HippoBinaryNodeUtils

public class HippoBinaryNodeUtils extends Object
Internal utility for Hippo binary related nodes.
  • Method Details

    • createMissingHippoBinaryFolders

      public static Node createMissingHippoBinaryFolders(Session session, String absPath, String primaryTypeName, String[] folderTypes, String[] galleryTypes) throws RepositoryException, org.hippoecm.repository.api.WorkflowException
      Checks if all the binary folders exist in the given absPath and creates binary folders if not existing.
      Parameters:
      session - JCR session
      absPath - absolute binary folder node path
      primaryTypeName - primary folder node type name
      folderTypes - folderTypes
      galleryTypes - galleryTypes
      Returns:
      the final folder node if successful
      Throws:
      RepositoryException - if any repository exception occurs
      org.hippoecm.repository.api.WorkflowException - if any workflow exception occurs
    • extractTextFromBinariesAndSaveHippoTextsUnderHandlePath

      public static void extractTextFromBinariesAndSaveHippoTextsUnderHandlePath(Session session, String handlePath) throws RepositoryException, IOException, org.apache.tika.exception.TikaException
      Finds binary resource node (hippo:resource) under the handlePath, extracts text content and saves hippo:text property if the binary data is application/pdf content.
      Parameters:
      session - JCR session
      handlePath - binary handle node path
      Throws:
      RepositoryException - if repository exception occurs
      IOException - if IO exception occurs
      org.apache.tika.exception.TikaException - if TIKA exception occurs
    • extractTextFromBinariesAndSaveHippoTexts

      public static void extractTextFromBinariesAndSaveHippoTexts(Session session, Node handle) throws RepositoryException, IOException, org.apache.tika.exception.TikaException
      Finds binary resource node (hippo:resource) under the handle, extracts text content and saves hippo:text property if the binary data is application/pdf content.
      Parameters:
      session - JCR session
      handle - binary handle node
      Throws:
      RepositoryException - if repository exception occurs
      IOException - if IO exception occurs
      org.apache.tika.exception.TikaException - if TIKA exception occurs