Java Code Examples for org.gradle.util.GFileUtils#copyURLToFile()

The following examples show how to use org.gradle.util.GFileUtils#copyURLToFile() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HtmlReportRenderer.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * Renders a multi-page HTML report from the given model, into the given directory.
 */
public <T> void render(T model, ReportRenderer<T, HtmlReportBuilder> renderer, File outputDirectory) {
    try {
        outputDirectory.mkdirs();
        DefaultHtmlReportContext context = new DefaultHtmlReportContext(outputDirectory);
        renderer.render(model, context);
        for (Resource resource : context.resources.values()) {
            File destFile = new File(outputDirectory, resource.path);
            if (!destFile.exists()) {
                GFileUtils.copyURLToFile(resource.source, destFile);
            }
        }
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
 
Example 2
Source File: HtmlReportRenderer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * Renders a multi-page HTML report from the given model, into the given directory.
 */
public <T> void render(T model, ReportRenderer<T, HtmlReportBuilder> renderer, File outputDirectory) {
    try {
        outputDirectory.mkdirs();
        DefaultHtmlReportContext context = new DefaultHtmlReportContext(outputDirectory);
        renderer.render(model, context);
        for (Resource resource : context.resources.values()) {
            File destFile = new File(outputDirectory, resource.path);
            if (!destFile.exists()) {
                GFileUtils.copyURLToFile(resource.source, destFile);
            }
        }
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
 
Example 3
Source File: GenerateCUnitLauncher.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void writeToFile(File directory, String fileName) {
    final File file = new File(directory, fileName);
    GFileUtils.copyURLToFile(getClass().getResource(fileName), file);
}
 
Example 4
Source File: BuildDashboardGenerator.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void copyCss() {
    GFileUtils.copyURLToFile(getClass().getResource("/org/gradle/reporting/base-style.css"), new File(outputFile.getParent(), "base-style.css"));
    GFileUtils.copyURLToFile(getClass().getResource("style.css"), new File(outputFile.getParent(), "style.css"));
}
 
Example 5
Source File: GenerateCUnitLauncher.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void writeToFile(File directory, String fileName) {
    final File file = new File(directory, fileName);
    GFileUtils.copyURLToFile(getClass().getResource(fileName), file);
}
 
Example 6
Source File: BuildDashboardGenerator.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void copyCss() {
    GFileUtils.copyURLToFile(getClass().getResource("/org/gradle/reporting/base-style.css"), new File(outputFile.getParent(), "base-style.css"));
    GFileUtils.copyURLToFile(getClass().getResource("style.css"), new File(outputFile.getParent(), "style.css"));
}