Class DocViewParser
- java.lang.Object
 - 
- org.apache.jackrabbit.vault.fs.io.DocViewParser
 
 
- 
@ProviderType public final class DocViewParser extends java.lang.ObjectThis is a thread-safe SAX parser which deals with FileVault Document View XML files and passes them to a givenDocViewParserHandler. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDocViewParser.XmlParseExceptionThrown in case the XML is not well-formed or no valid docview format. 
- 
Field Summary
Fields Modifier and Type Field Description static intMAX_NUM_BYTES_TO_READ_FOR_DOCVIEW_DETECTION 
- 
Constructor Summary
Constructors Constructor Description DocViewParser()DocViewParser(@NotNull javax.jcr.Session session)DocViewParser(@Nullable NamespaceResolver resolver) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @Nullable java.lang.StringgetDocumentViewXmlRootNodePath(java.io.InputStream input, java.nio.file.Path filePath)Converts the given file path to the absolute root node path given thatInputStreamis complying with the Document View XML format.static booleanisDocView(org.xml.sax.InputSource source)Checks if the givenInputSourceis complying with the Document View XML format.voidparse(java.lang.String rootNodePath, org.xml.sax.InputSource inputSource, DocViewParserHandler handler)Parses a FileVault Document View XML file and calls the given handler for each parsed node. 
 - 
 
- 
- 
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 javax.jcr.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(org.xml.sax.InputSource source) throws java.io.IOExceptionChecks if the givenInputSourceis complying with the Document View XML format.- Parameters:
 source- the source to analyze- Returns:
 truein case the given source is Document View XML format- Throws:
 java.io.IOException- if an I/O error occurs
 
- 
getDocumentViewXmlRootNodePath
@Nullable public static @Nullable java.lang.String getDocumentViewXmlRootNodePath(java.io.InputStream input, java.nio.file.Path filePath) throws java.io.IOExceptionConverts the given file path to the absolute root node path given thatInputStreamis complying with the Document View XML format.- Parameters:
 input- the given input is automatically reset after this method returnsfilePath- 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 
nullif no docview xml given - Throws:
 java.io.IOException
 
- 
parse
public void parse(java.lang.String rootNodePath, org.xml.sax.InputSource inputSource, DocViewParserHandler handler) throws java.io.IOException, DocViewParser.XmlParseExceptionParses a FileVault Document View XML file and calls the given handler for each parsed node.- Parameters:
 rootNodePath- the path of the root node of the given docview xmlinputSource- the source of the docview xmlhandler- the callback handler which gets the deserialized node information- Throws:
 java.io.IOExceptionDocViewParser.XmlParseException
 
 - 
 
 -