class ExtensionDescriptorBuilder {

    /**
     * @since 3.3.0
     */
    public String getExtensionDescriptorLocation() {
        return "META-INF/maven/extension.xml";
    }

    /**
     * Extracts the extension descriptor (if any) from the specified JAR file.
     *
     * @param extensionJar The JAR file or directory to extract the descriptor from, must not be {@code null}.
     * @return The extracted descriptor or {@code null} if no descriptor was found.
     * @throws IOException If the descriptor is present but could not be parsed.
     */
    public ExtensionDescriptor build(File extensionJar) throws IOException {<FILL_FUNCTION_BODY>}

    /**
     * @since 3.3.0
     */
    public ExtensionDescriptor build(InputStream is) throws IOException {
        ExtensionDescriptor extensionDescriptor = new ExtensionDescriptor();

        XmlNode dom;
        try {
            XMLStreamReader reader = WstxInputFactory.newFactory().createXMLStreamReader(is);
            dom = XmlNodeStaxBuilder.build(reader);
        } catch (XMLStreamException e) {
            throw new IOException(e.getMessage(), e);
        }

        if (!"extension".equals(dom.getName())) {
            throw new IOException("Unexpected root element \"" + dom.getName() + "\", expected \"extension\"");
        }

        extensionDescriptor.setExportedPackages(parseStrings(dom.getChild("exportedPackages")));

        extensionDescriptor.setExportedArtifacts(parseStrings(dom.getChild("exportedArtifacts")));

        return extensionDescriptor;
    }

    private List<String> parseStrings(XmlNode dom) {
        List<String> strings = null;

        if (dom != null) {
            strings = new ArrayList<>();

            for (XmlNode child : dom.getChildren()) {
                String string = child.getValue();
                if (string != null) {
                    string = string.trim();
                    if (!string.isEmpty()) {
                        strings.add(string);
                    }
                }
            }
        }

        return strings;
    }
}

        ExtensionDescriptor extensionDescriptor = null;

        if (extensionJar.isFile()) {
            try (JarFile pluginJar = new JarFile(extensionJar, false)) {
                ZipEntry pluginDescriptorEntry = pluginJar.getEntry(getExtensionDescriptorLocation());

                if (pluginDescriptorEntry != null) {
                    try (InputStream is = pluginJar.getInputStream(pluginDescriptorEntry)) {
                        extensionDescriptor = build(is);
                    }
                }
            }
        } else {
            File pluginXml = new File(extensionJar, getExtensionDescriptorLocation());

            if (pluginXml.canRead()) {
                try (InputStream is = Files.newInputStream(pluginXml.toPath())) {
                    extensionDescriptor = build(is);
                }
            }
        }

        return extensionDescriptor;
    
<no_super_class>