private File saveSchemasFromJar(File tmpBase, Version vespaVersion) throws IOException {
        Class<? extends SchemaValidators> schemaValidatorClass = this.getClass();
        Enumeration<URL> uris = schemaValidatorClass.getClassLoader().getResources("schema");
        if (uris == null) throw new IllegalArgumentException("Could not find XML schemas ");

        File tmpDir = createTempDirectory(tmpBase.toPath(), "vespa").toFile();
        log.log(Level.FINE, () -> "Will save all XML schemas for " + vespaVersion + " to " + tmpDir);
        boolean schemasFound = false;
        while (uris.hasMoreElements()) {
            URL u = uris.nextElement();
            // Used when building standalone-container
            if ("jar".equals(u.getProtocol())) {
                JarURLConnection jarConnection = (JarURLConnection) u.openConnection();
                JarFile jarFile = jarConnection.getJarFile();
                for (Enumeration<JarEntry> entries = jarFile.entries(); entries.hasMoreElements(); ) {
                    JarEntry je = entries.nextElement();
                    if (je.getName().startsWith("schema/") && je.getName().endsWith(".rnc")) {
                        schemasFound = true;
                        writeContentsToFile(tmpDir, je.getName(), jarFile.getInputStream(je));
                    }
                }
                jarFile.close();
            } else if ("bundle".equals(u.getProtocol())) {
                Bundle bundle = getBundle(schemaValidatorClass);
                // Use schemas on disk when bundle is null (which is the case when using config-model-fat-amended.jar)
                if (bundle == null) {
                    String pathPrefix = getDefaults().underVespaHome("share/vespa/schema/");
                    File schemaPath = new File(pathPrefix + "version/" + vespaVersion.getMajor() + ".x/schema/");
                    // Fallback to path without version if path with version does not exist
                    if (! schemaPath.exists()) {
                        log.log(Level.INFO, "Found no schemas in " + schemaPath + ", fallback to schemas in " + pathPrefix);
                        schemaPath = new File(pathPrefix);
                    }
                    log.log(Level.FINE, "Using schemas found in " + schemaPath);
                    schemasFound = true;
                    copySchemas(schemaPath, tmpDir);
                } else {
                    log.log(Level.FINE, () -> String.format("Saving schemas for model bundle %s:%s", bundle.getSymbolicName(), bundle.getVersion()));
                    for (Enumeration<URL> entries = bundle.findEntries("schema", "*.rnc", true); entries.hasMoreElements(); ) {
                        URL url = entries.nextElement();
                        writeContentsToFile(tmpDir, url.getFile(), url.openStream());
                        schemasFound = true;
                    }
                }
            } else if ("file".equals(u.getProtocol())) { // Used when running unit tests
                File schemaPath = new File(u.getPath());
                copySchemas(schemaPath, tmpDir);
                schemasFound = true;
            }
        }

        if ( ! schemasFound) {
            IOUtils.recursiveDeleteDir(tmpDir);
            throw new IllegalArgumentException("Could not find schemas for version " + vespaVersion);
        }

        return tmpDir;
    }
Looks for schema files in config-model.jar and saves them in a temp dir. Uses schema files
in $VESPA_HOME/share/vespa/schema/[major-version].x/ otherwise

@return the directory the schema files are stored in
@throws IOException if it is not possible to read schema files
config-application-package/src/main/java/com/yahoo/config/model/application/provider/SchemaValidators.java