test_class.file: vault-validation/src/test/java/org/apache/jackrabbit/vault/validation/spi/impl/DocumentViewParserValidatorTest.java
test_class.identifier: DocumentViewParserValidatorTest
test_case.body: @Test
      public void testGetDocumentViewXmlRootPathFromContentXml() throws IOException {
          Path filePath = Paths.get("test", "parent", ".content.xml");
          Assert.assertEquals(Paths.get("test", "parent"), DocumentViewParserValidator.getDocumentViewXmlRootPath(null, filePath));
      }
test_case.class_method_signature: DocumentViewParserValidatorTest.testGetDocumentViewXmlRootPathFromContentXml()
test_case.full_signature: @Test public void testGetDocumentViewXmlRootPathFromContentXml()
test_case.identifier: testGetDocumentViewXmlRootPathFromContentXml
test_case.invocations: get assertEquals get getDocumentViewXmlRootPath
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetDocumentViewXmlRootPathFromContentXml()
focal_class.declarator: EXTENDED_FILE_AGGREGATE_FOLDER_SUFFIX = ".dir"
focal_class.modifier: public static final
focal_class.original_string: public static final String EXTENDED_FILE_AGGREGATE_FOLDER_SUFFIX = ".dir";
focal_class.type: String
focal_class.var_name: EXTENDED_FILE_AGGREGATE_FOLDER_SUFFIX
focal_class.declarator: docViewValidators
focal_class.modifier: private final
focal_class.original_string: private final Map<String, DocumentViewXmlValidator> docViewValidators;
focal_class.type: Map<String, DocumentViewXmlValidator>
focal_class.var_name: docViewValidators
focal_class.declarator: saxParser
focal_class.modifier: private final
focal_class.original_string: private final SAXParser saxParser;
focal_class.type: SAXParser
focal_class.var_name: saxParser
focal_class.declarator: severity
focal_class.modifier: private final @NotNull
focal_class.original_string: private final @NotNull ValidationMessageSeverity severity;
focal_class.type: ValidationMessageSeverity
focal_class.var_name: severity
focal_class.file: vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/DocumentViewParserValidator.java
focal_class.identifier: DocumentViewParserValidator
focal_class.interfaces: implements GenericJcrDataValidator
focal_class.class_method_signature: DocumentViewParserValidator.DocumentViewParserValidator(SAXParser saxParser, @NotNull ValidationMessageSeverity severity)
focal_class.full_signature: public  DocumentViewParserValidator(SAXParser saxParser, @NotNull ValidationMessageSeverity severity)
focal_class.identifier: DocumentViewParserValidator
focal_class.modifiers: public
focal_class.parameters: (SAXParser saxParser, @NotNull ValidationMessageSeverity severity)
focal_class.signature:  DocumentViewParserValidator(SAXParser saxParser, @NotNull ValidationMessageSeverity severity)
focal_class.class_method_signature: DocumentViewParserValidator.setDocumentViewXmlValidators(Map<String, DocumentViewXmlValidator> documentViewXmlValidators)
focal_class.full_signature: public void setDocumentViewXmlValidators(Map<String, DocumentViewXmlValidator> documentViewXmlValidators)
focal_class.identifier: setDocumentViewXmlValidators
focal_class.modifiers: public
focal_class.parameters: (Map<String, DocumentViewXmlValidator> documentViewXmlValidators)
focal_class.return: void
focal_class.signature: void setDocumentViewXmlValidators(Map<String, DocumentViewXmlValidator> documentViewXmlValidators)
focal_class.class_method_signature: DocumentViewParserValidator.done()
focal_class.full_signature: @Override public Collection<ValidationMessage> done()
focal_class.identifier: done
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<ValidationMessage>
focal_class.signature: Collection<ValidationMessage> done()
focal_class.class_method_signature: DocumentViewParserValidator.shouldValidateJcrData(@NotNull Path filePath, @NotNull Path basePath)
focal_class.full_signature: @Override public boolean shouldValidateJcrData(@NotNull Path filePath, @NotNull Path basePath)
focal_class.identifier: shouldValidateJcrData
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull Path filePath, @NotNull Path basePath)
focal_class.return: boolean
focal_class.signature: boolean shouldValidateJcrData(@NotNull Path filePath, @NotNull Path basePath)
focal_class.class_method_signature: DocumentViewParserValidator.validateJcrData(@NotNull InputStream input, @NotNull Path filePath, @NotNull Path basePath, @NotNull Map<String, Integer> nodePathsAndLineNumbers)
focal_class.full_signature: @Override public Collection<ValidationMessage> validateJcrData(@NotNull InputStream input, @NotNull Path filePath, @NotNull Path basePath, @NotNull Map<String, Integer> nodePathsAndLineNumbers)
focal_class.identifier: validateJcrData
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull InputStream input, @NotNull Path filePath, @NotNull Path basePath, @NotNull Map<String, Integer> nodePathsAndLineNumbers)
focal_class.return: Collection<ValidationMessage>
focal_class.signature: Collection<ValidationMessage> validateJcrData(@NotNull InputStream input, @NotNull Path filePath, @NotNull Path basePath, @NotNull Map<String, Integer> nodePathsAndLineNumbers)
focal_class.class_method_signature: DocumentViewParserValidator.getDocumentViewXmlRootPath(BufferedInputStream input, Path path)
focal_class.full_signature: static Path getDocumentViewXmlRootPath(BufferedInputStream input, Path path)
focal_class.identifier: getDocumentViewXmlRootPath
focal_class.modifiers: static
focal_class.parameters: (BufferedInputStream input, Path path)
focal_class.return: Path
focal_class.signature: Path getDocumentViewXmlRootPath(BufferedInputStream input, Path path)
focal_class.class_method_signature: DocumentViewParserValidator.validateDocumentViewXml(InputStream input, @NotNull Path filePath, @NotNull Path basePath, String rootNodePath,
              Map<String, Integer> nodePathsAndLineNumbers)
focal_class.full_signature: protected Collection<ValidationMessage> validateDocumentViewXml(InputStream input, @NotNull Path filePath, @NotNull Path basePath, String rootNodePath,
              Map<String, Integer> nodePathsAndLineNumbers)
focal_class.identifier: validateDocumentViewXml
focal_class.modifiers: protected
focal_class.parameters: (InputStream input, @NotNull Path filePath, @NotNull Path basePath, String rootNodePath,
              Map<String, Integer> nodePathsAndLineNumbers)
focal_class.return: Collection<ValidationMessage>
focal_class.signature: Collection<ValidationMessage> validateDocumentViewXml(InputStream input, @NotNull Path filePath, @NotNull Path basePath, String rootNodePath,
              Map<String, Integer> nodePathsAndLineNumbers)
focal_method.body: static Path getDocumentViewXmlRootPath(BufferedInputStream input, Path path) throws IOException {
          Path name = path.getFileName();
          Path rootPath = null;
  
          int nameCount = path.getNameCount();
          if (name.equals(Paths.get(Constants.DOT_CONTENT_XML))) {
              if (nameCount > 1) {
                  rootPath = path.subpath(0, nameCount - 1);
                  // fix root mapping for http://jackrabbit.apache.org/filevault/vaultfs.html#Extended_File_aggregates
                  if (rootPath.toString().endsWith(EXTENDED_FILE_AGGREGATE_FOLDER_SUFFIX)) {
                      rootPath = Paths.get(rootPath.toString().substring(0, rootPath.toString().length() - EXTENDED_FILE_AGGREGATE_FOLDER_SUFFIX.length()));
                  }
              } else {
                  rootPath = Paths.get("");
              }
              // correct suffix matching
          } else if (name.toString().endsWith(".xml")) {
  
              // we need to rely on a buffered input stream to be able to reset it later
              input.mark(1024);
              // analyze content
              // this closes the input source internally, therefore protect against closing
              // make sure to initialize the SLF4J logger appropriately (for the XmlAnalyzer)
              try {
                  SerializationType type = XmlAnalyzer.analyze(new InputSource(new CloseShieldInputStream(input)));
                  if (type == SerializationType.XML_DOCVIEW) {
                      //  remove .xml extension
                      String fileName = path.getFileName().toString();
                      fileName = fileName.substring(0, fileName.length() - ".xml".length());
                      if (nameCount > 1) {
                          rootPath = path.subpath(0, nameCount - 1).resolve(fileName);
                      } else {
                          rootPath = Paths.get(fileName);
                      }
                  }
              } finally {
                  input.reset();
              }
          }
          return rootPath;
      }
focal_method.class_method_signature: DocumentViewParserValidator.getDocumentViewXmlRootPath(BufferedInputStream input, Path path)
focal_method.full_signature: static Path getDocumentViewXmlRootPath(BufferedInputStream input, Path path)
focal_method.identifier: getDocumentViewXmlRootPath
focal_method.invocations: getFileName getNameCount equals get subpath endsWith toString get substring toString length toString length get endsWith toString mark analyze toString getFileName substring length length resolve subpath get reset
focal_method.modifiers: static
focal_method.parameters: (BufferedInputStream input, Path path)
focal_method.return: Path
focal_method.signature: Path getDocumentViewXmlRootPath(BufferedInputStream input, Path path)