public final Map run()

in customization-base/src/main/java/com/azure/autorest/customization/Customization.java [28:56]


    public final Map<String, String> run(Map<String, String> files, Logger logger) {
        Path tempDirWithPrefix;

        // Populate editor
        Editor editor;
        try {
            tempDirWithPrefix = FileUtils.createTempDirectory("temp");
            editor = new Editor(files, tempDirWithPrefix);
            InputStream pomStream = Customization.class.getResourceAsStream("/pom.xml");
            byte[] buffer = new byte[pomStream.available()];
            pomStream.read(buffer);
            editor.addFile("pom.xml", new String(buffer, StandardCharsets.UTF_8));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        // Start language client
        try (EclipseLanguageClient languageClient
            = new EclipseLanguageClient(null, tempDirWithPrefix.toString(), logger)) {
            languageClient.initialize();
            customize(new LibraryCustomization(editor, languageClient), logger);
            editor.removeFile("pom.xml");
            return editor.getContents();
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            Utils.deleteDirectory(tempDirWithPrefix.toFile());
        }
    }