code: @Override
      public InputStream validateResource(InputStream configDocInputStream, String docLocation) throws ConfigValidationException {
  
          errorMsgIssued = false;
          InputStream returnInputStream = null;
  
          try {
              // Reads the input stream into an output stream where we can copy it
              byte[] bfr = new byte[4096];
              int len = 0;
              ByteArrayOutputStream bfrOutputStream = new ByteArrayOutputStream();
              while ((len = configDocInputStream.read(bfr, 0, bfr.length)) > -1)
                  bfrOutputStream.write(bfr, 0, len);
              configDocInputStream.close();
              bfrOutputStream.close();
  
              // Makes two copies of the input stream (one for us and one for the
              // the configuration document parser)
              InputStream validatorInputStream =
                              new ByteArrayInputStream(bfrOutputStream.toByteArray());
              returnInputStream = new ByteArrayInputStream(bfrOutputStream.toByteArray());
  
              // Parses the document to be verified
              Document document = dbFactory.newDocumentBuilder().parse(validatorInputStream);
  
              // Verifies the signature
              verifyDocument(document, docLocation);
          }
  
          // An error occurred while attempting to verify the document signature
          catch (Throwable t) {
              if (!errorMsgIssued) {
                  if (t instanceof SAXException)
                      printErrorMessage("error.configValidator.parseFailed",
                                        docLocation, t.getMessage());
                  else if (t instanceof MarshalException)
                      printErrorMessage("error.configValidator.unmarshalFailed",
                                        docLocation, t.getMessage());
                  else
                      printErrorMessage("error.configValidator.error",
                                        docLocation, t.getMessage());
              }
  
              FFDCFilter.processException(t, CLASS_NAME, "138", this, new Object[] { docLocation });
  
              returnInputStream = null;
  
              // Throw exception to terminate the server
              throw new ConfigValidationException("Configuration parsing encountered an invalid document", docLocation);
          }
  
          return returnInputStream;
      }
docs: {@inheritDoc}
  
  @throws ConfigValidationException