public static boolean isFileOfSupportedSchema(ResourceByteRangeProvider resourceByteRangeProvider) throws IOException {
  try (InputStream inputStream=resourceByteRangeProvider.getByteRangeAsStream(0,resourceByteRangeProvider.getResourceSize() - 1)){
    DocumentBuilderFactory documentBuilderFactory=DocumentBuilderFactory.newInstance();
    documentBuilderFactory.setNamespaceAware(true);
    DocumentBuilder documentBuilder=documentBuilderFactory.newDocumentBuilder();
    Document document=documentBuilder.parse(inputStream);
    NodeList nodeList=null;
    for (    String supportedSchemaURI : supportedAssetMapSchemaURIs) {
      nodeList=document.getElementsByTagNameNS(supportedSchemaURI,"AssetMap");
      if (nodeList != null && nodeList.getLength() == 1) {
        return true;
      }
    }
  }
 catch (  ParserConfigurationException|SAXException e) {
    return false;
  }
  return false;
}

public static boolean isFileOfSupportedSchema ( ResourceByteRangeProvider resourceByteRangeProvider ) throws IOException { try ( InputStream inputStream = resourceByteRangeProvider . getByteRangeAsStream ( 0 , resourceByteRangeProvider . getResourceSize ( ) - 1 ) ) { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory . newInstance ( ) ; documentBuilderFactory . setNamespaceAware ( true ) ; DocumentBuilder documentBuilder = documentBuilderFactory . newDocumentBuilder ( ) ; Document document = documentBuilder . parse ( inputStream ) ; NodeList nodeList = null ; for ( String supportedSchemaURI : supportedAssetMapSchemaURIs ) { nodeList = document . getElementsByTagNameNS ( supportedSchemaURI , "AssetMap" ) ; if ( nodeList != null && nodeList . getLength ( ) == 1 ) { return true ; } } } catch ( ParserConfigurationException | SAXException e ) { return false ; } return false ; }
a stateless method that verifies if the raw data represented by the resourcebyterangeprovider corresponds to a valid imf assetmap document
