private static void loadJar(
            TraitFactory traitFactory,
            Map<String, Object> properties,
            String filename,
            Consumer<LoadOperation> operationConsumer,
            Function<CharSequence, String> stringTable
    ) {
        URL manifestUrl = ModelDiscovery.createSmithyJarManifestUrl(filename);
        LOGGER.fine(() -> "Loading Smithy model imports from JAR: " + manifestUrl);

        for (URL model : ModelDiscovery.findModels(manifestUrl)) {
            try {
                URLConnection connection = model.openConnection();

                if (properties.containsKey(ModelAssembler.DISABLE_JAR_CACHE)) {
                    connection.setUseCaches(false);
                }

                boolean result = load(traitFactory, properties, model.toExternalForm(), operationConsumer, () -> {
                    try {
                        return connection.getInputStream();
                    } catch (IOException e) {
                        throw throwIoJarException(model, e);
                    }
                }, stringTable);

                // Smithy will skip unrecognized model files, including JSON files that don't contain a "smithy"
                // version key/value pair. However, JAR manifests are not allowed to refer to unrecognized files.
                if (!result) {
                    throw new ModelImportException("Invalid file referenced by Smithy JAR manifest: " + model);
                }
            } catch (IOException e) {
                throw throwIoJarException(model, e);
            }
        }
    }
Parses models and pushes {@link LoadOperation}s to the given consumer.

<p>The format contained in the supplied {@code InputStream} is
determined based on the file extension in the provided
{@code filename}.

@param traitFactory Factory used to create traits.
@param properties Bag of loading properties.
@param filename Filename to assign to the model.
@param operationConsumer Where loader operations are published.
@param contentSupplier The supplier that provides an InputStream. The
  supplied {@code InputStream} is automatically closed when the loader
  has finished reading from it.
@return Returns true if the file was loaded. Some JSON files might be ignored and return false.
@throws SourceException if there is an error reading from the contents.
smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelLoader.java