static void saveHtmlToPath()

in buildSrc/src/main/groovy/org/grails/gradle/RenderSiteTask.groovy [131:147]


    static void saveHtmlToPath(File outputDir, String html, String filepath) {
        File pageOutput = new File(outputDir.absolutePath)
        pageOutput.mkdir()
        String[] paths = filepath.split('/')
        for (String path : paths) {
            if (path.endsWith(".html")) {
                pageOutput = new File(pageOutput.getAbsolutePath() + "/" + path)
            } else if (path.trim().isEmpty()) {
                continue
            } else {
                pageOutput = new File(pageOutput.getAbsolutePath() + "/" + path)
                pageOutput.mkdir()
            }
        }
        pageOutput.createNewFile()
        pageOutput.text = html
    }