public static AdditionalServlets load(PulsarConfiguration conf) throws IOException {
        String additionalServletDirectory = conf.getProperties().getProperty(ADDITIONAL_SERVLET_DIRECTORY);
        if (additionalServletDirectory == null) {
            // Compatible with the current proxy configuration
            additionalServletDirectory = conf.getProperties().getProperty(PROXY_ADDITIONAL_SERVLET_DIRECTORY);
        }

        String additionalServlets = conf.getProperties().getProperty(ADDITIONAL_SERVLETS);
        if (additionalServlets == null) {
            additionalServlets = conf.getProperties().getProperty(PROXY_ADDITIONAL_SERVLETS);
        }

        String narExtractionDirectory = conf.getProperties().getProperty(NAR_EXTRACTION_DIRECTORY);
        if (StringUtils.isBlank(narExtractionDirectory)) {
            narExtractionDirectory = NarClassLoader.DEFAULT_NAR_EXTRACTION_DIR;
        }

        if (additionalServletDirectory == null || additionalServlets == null) {
            return null;
        }

        String[] additionalServletsList = additionalServlets.split(",");
        if (additionalServletsList.length == 0) {
            return null;
        }

        AdditionalServletDefinitions definitions =
                AdditionalServletUtils.searchForServlets(additionalServletDirectory
                        , narExtractionDirectory);
        ImmutableMap.Builder<String, AdditionalServletWithClassLoader> builder = ImmutableMap.builder();

        for (String servletName : additionalServletsList) {
            AdditionalServletMetadata definition = definitions.servlets().get(servletName);
            if (null == definition) {
                throw new RuntimeException("No additional servlet is found for name `" + servletName
                        + "`. Available additional servlet are : " + definitions.servlets());
            }

            AdditionalServletWithClassLoader servletWithClassLoader;
            try {
                servletWithClassLoader = AdditionalServletUtils.load(definition, narExtractionDirectory);
                if (servletWithClassLoader != null) {
                    builder.put(servletName, servletWithClassLoader);
                }
                log.info("Successfully loaded additional servlet for name `{}`", servletName);
            } catch (IOException e) {
                log.error("Failed to load the additional servlet for name `" + servletName + "`", e);
                throw new RuntimeException("Failed to load the additional servlet for name `" + servletName + "`");
            }
        }

        Map<String, AdditionalServletWithClassLoader> servlets = builder.build();
        if (!servlets.isEmpty()) {
            return new AdditionalServlets(servlets);
        }

        return null;
    }
@Test
    public void testEmptyStringAsExtractionDirectory() throws IOException {
        Properties p = new Properties();
        p.put("narExtractionDirectory", "");
        p.put("additionalServlets", "AS1,AS2");
        p.put("additionalServletDirectory", "/additionalServletDirectory");

        PulsarConfiguration config = mock(PulsarConfiguration.class);
        Mockito.when(config.getProperties()).thenReturn(p);

        AdditionalServletMetadata asm1 = additionalServletMetadata(1);
        AdditionalServletMetadata asm2 = additionalServletMetadata(2);

        AdditionalServletDefinitions definitions = new AdditionalServletDefinitions();
        definitions.servlets().put("AS1", asm1);
        definitions.servlets().put("AS2", asm2);

        AdditionalServletWithClassLoader as1 = mock(AdditionalServletWithClassLoader.class);
        AdditionalServletWithClassLoader as2 = mock(AdditionalServletWithClassLoader.class);

        try (MockedStatic<AdditionalServletUtils> utils = mockStatic(AdditionalServletUtils.class)) {
            String tmpDirectory =  System.getProperty("java.io.tmpdir");
            utils.when(() -> AdditionalServletUtils.searchForServlets(
                    "/additionalServletDirectory", tmpDirectory)).thenReturn(definitions);
            utils.when(() -> AdditionalServletUtils.load(asm1, tmpDirectory)).thenReturn(as1);
            utils.when(() -> AdditionalServletUtils.load(asm2, tmpDirectory)).thenReturn(as2);

            AdditionalServlets servlets = AdditionalServlets.load(config);

            Assert.assertEquals(servlets.getServlets().get("AS1"), as1);
            Assert.assertEquals(servlets.getServlets().get("AS2"), as2);
        }
    }