Class DocViewParser

    • Field Detail

      • MAX_NUM_BYTES_TO_READ_FOR_DOCVIEW_DETECTION

        public static final int MAX_NUM_BYTES_TO_READ_FOR_DOCVIEW_DETECTION
        See Also:
        Constant Field Values
    • Constructor Detail

      • DocViewParser

        public DocViewParser()
      • DocViewParser

        public DocViewParser​(@NotNull
                             @NotNull Session session)
        Parameters:
        session - uses the namespace from the session for resolving otherwise unknown namespace prefixes in docview files
      • DocViewParser

        public DocViewParser​(@Nullable
                             @Nullable NamespaceResolver resolver)
    • Method Detail

      • isDocView

        public static boolean isDocView​(InputSource source)
                                 throws IOException
        Checks if the given InputSource is complying with the Document View XML format.
        Parameters:
        source - the source to analyze
        Returns:
        true in case the given source is Document View XML format
        Throws:
        IOException - if an I/O error occurs
      • getDocumentViewXmlRootNodePath

        @Nullable
        public static @Nullable String getDocumentViewXmlRootNodePath​(InputStream input,
                                                                      Path filePath)
                                                               throws IOException
        Converts the given file path to the absolute root node path given that InputStream is complying with the Document View XML format.
        Parameters:
        input - the given input is automatically reset after this method returns
        filePath - the file path of the file containing the potential docview xml, must be relative to the jcr_root directory
        Returns:
        either the absolute repository path of the root node of the given docview xml or null if no docview xml given
        Throws:
        IOException