public static byte[] readData(String data)
            throws IOException, URISyntaxException, InstantiationException, IllegalAccessException {
        if (data.startsWith("data:") || data.startsWith("file:")) {
            return IOUtils.toByteArray(URL.createURL(data));
        } else if (Files.exists(Paths.get(data))) {
            return Files.readAllBytes(Paths.get(data));
        } else if (org.apache.commons.codec.binary.Base64.isBase64(data)) {
            return Base64.getDecoder().decode(data);
        } else {
            String msg = "Not supported config";
            throw new IllegalArgumentException(msg);
        }
    }
@Test
    public void testReadData() throws Exception {
        byte[] data = Files.readAllBytes(Path.of(basicAuthConf));
        String base64Data = Base64.getEncoder().encodeToString(data);

        // base64 format
        assertEquals(AuthenticationProviderBasic.readData("data:;base64," + base64Data), data);
        assertEquals(AuthenticationProviderBasic.readData(base64Data), data);

        // file format
        assertEquals(AuthenticationProviderBasic.readData("file://" + basicAuthConf), data);
        assertEquals(AuthenticationProviderBasic.readData(basicAuthConf), data);
    }