/** * Gets directory where the attachments are stored. * * @return directory for attachment */ public File getEmbeddingDirectory() { return new File(getReportDirectory().getAbsolutePath(), ReportBuilder.BASE_DIRECTORY + File.separatorChar + Configuration.EMBEDDINGS_DIRECTORY); }
/** * Gets directory where the attachments are stored. * * @return directory for attachment */ public File getEmbeddingDirectory() { return new File(getReportDirectory().getAbsolutePath(), ReportBuilder.BASE_DIRECTORY + File.separatorChar + Configuration.EMBEDDINGS_DIRECTORY); }
private Properties buildProperties() { Properties props = new Properties(); props.setProperty("resource.loader", "class"); props.setProperty("class.resource.loader.class", ClasspathResourceLoader.class.getCanonicalName()); props.setProperty("runtime.log", new File(configuration.getReportDirectory(), "velocity.log").getPath()); return props; }
private Properties buildProperties() { Properties props = new Properties(); props.setProperty("resource.loader", "class"); props.setProperty("class.resource.loader.class", ClasspathResourceLoader.class.getCanonicalName()); props.setProperty("runtime.log", new File(configuration.getReportDirectory(), "velocity.log").getPath()); return props; }
private void copyResources(String resourceLocation, String... resources) { for (String resource : resources) { File tempFile = new File(configuration.getReportDirectory().getAbsoluteFile(), BASE_DIRECTORY + File.separatorChar + resourceLocation + File.separatorChar + resource); // don't change this implementation unless you verified it works on Jenkins try { FileUtils.copyInputStreamToFile( this.getClass().getResourceAsStream("/" + resourceLocation + "/" + resource), tempFile); } catch (IOException e) { // based on FileUtils implementation, should never happen even is declared throw new ValidationException(e); } } }
private void copyResources(String resourceLocation, String... resources) { for (String resource : resources) { File tempFile = new File(configuration.getReportDirectory().getAbsoluteFile(), BASE_DIRECTORY + File.separatorChar + resourceLocation + File.separatorChar + resource); // don't change this implementation unless you verified it works on Jenkins try { FileUtils.copyInputStreamToFile( this.getClass().getResourceAsStream("/" + resourceLocation + "/" + resource), tempFile); } catch (IOException e) { // based on FileUtils implementation, should never happen even is declared throw new ValidationException(e); } } }
private void generateReport() { context.put("report_file", getWebPage()); Template template = engine.getTemplate("templates/generators/" + templateFileName); File reportFile = new File(configuration.getReportDirectory(), ReportBuilder.BASE_DIRECTORY + File.separatorChar + getWebPage()); try (Writer writer = new OutputStreamWriter(new FileOutputStream(reportFile), StandardCharsets.UTF_8)) { template.merge(context, writer); } catch (IOException e) { throw new ValidationException(e); } }
private void generateReport() { context.put("report_file", getWebPage()); Template template = engine.getTemplate("templates/generators/" + templateFileName); File reportFile = new File(configuration.getReportDirectory(), ReportBuilder.BASE_DIRECTORY + File.separatorChar + getWebPage()); try (Writer writer = new OutputStreamWriter(new FileOutputStream(reportFile), StandardCharsets.UTF_8)) { template.merge(context, writer); } catch (IOException e) { throw new ValidationException(e); } }