@Test public void testCopyCss() throws Exception { final File tempDirectory = File.createTempFile("testCopyCss", null).getParentFile(); mojo.copyCss(tempDirectory, "fake-css.css"); final File cssFile = new File(tempDirectory, "fake-css.css"); assertThat(cssFile).exists(); try { assertThat(FileUtils.fileRead(cssFile, "utf-8")).isEqualTo(""); } finally { FileUtils.forceDelete(cssFile); } }
void copyCss(final File cssDirectory, final String cssFilename) throws MavenReportException { final File cssFile = new File(cssDirectory, cssFilename); try (final InputStream scriptCssStream = getClass().getResourceAsStream("/css/" + cssFilename); Writer scriptCssOutput = new OutputStreamWriter(new FileOutputStream(cssFile), Charset.forName(getOutputEncoding()));) { IOUtils.copy(scriptCssStream, scriptCssOutput, "utf-8"); } catch (final IOException e) { throw new MavenReportException("Failed to copy summary CSS file: " + cssFilename, e); } }
CDocReportMojo extends AbstractMavenReport { void copyCss(final File cssDirectory, final String cssFilename) throws MavenReportException { final File cssFile = new File(cssDirectory, cssFilename); try (final InputStream scriptCssStream = getClass().getResourceAsStream("/css/" + cssFilename); Writer scriptCssOutput = new OutputStreamWriter(new FileOutputStream(cssFile), Charset.forName(getOutputEncoding()));) { IOUtils.copy(scriptCssStream, scriptCssOutput, "utf-8"); } catch (final IOException e) { throw new MavenReportException("Failed to copy summary CSS file: " + cssFilename, e); } } }
CDocReportMojo extends AbstractMavenReport { void copyCss(final File cssDirectory, final String cssFilename) throws MavenReportException { final File cssFile = new File(cssDirectory, cssFilename); try (final InputStream scriptCssStream = getClass().getResourceAsStream("/css/" + cssFilename); Writer scriptCssOutput = new OutputStreamWriter(new FileOutputStream(cssFile), Charset.forName(getOutputEncoding()));) { IOUtils.copy(scriptCssStream, scriptCssOutput, "utf-8"); } catch (final IOException e) { throw new MavenReportException("Failed to copy summary CSS file: " + cssFilename, e); } } CDocReportMojo();  CDocReportMojo(final TextParser textParser, final ScriptExecutionDetailsParser detailsParser); }
CDocReportMojo extends AbstractMavenReport { void copyCss(final File cssDirectory, final String cssFilename) throws MavenReportException { final File cssFile = new File(cssDirectory, cssFilename); try (final InputStream scriptCssStream = getClass().getResourceAsStream("/css/" + cssFilename); Writer scriptCssOutput = new OutputStreamWriter(new FileOutputStream(cssFile), Charset.forName(getOutputEncoding()));) { IOUtils.copy(scriptCssStream, scriptCssOutput, "utf-8"); } catch (final IOException e) { throw new MavenReportException("Failed to copy summary CSS file: " + cssFilename, e); } } CDocReportMojo();  CDocReportMojo(final TextParser textParser, final ScriptExecutionDetailsParser detailsParser); @Override boolean canGenerateReport(); @Override String getDescription(final Locale locale); @Override String getName(final Locale locale); @Override String getOutputName(); @Override boolean isExternalReport(); }
CDocReportMojo extends AbstractMavenReport { void copyCss(final File cssDirectory, final String cssFilename) throws MavenReportException { final File cssFile = new File(cssDirectory, cssFilename); try (final InputStream scriptCssStream = getClass().getResourceAsStream("/css/" + cssFilename); Writer scriptCssOutput = new OutputStreamWriter(new FileOutputStream(cssFile), Charset.forName(getOutputEncoding()));) { IOUtils.copy(scriptCssStream, scriptCssOutput, "utf-8"); } catch (final IOException e) { throw new MavenReportException("Failed to copy summary CSS file: " + cssFilename, e); } } CDocReportMojo();  CDocReportMojo(final TextParser textParser, final ScriptExecutionDetailsParser detailsParser); @Override boolean canGenerateReport(); @Override String getDescription(final Locale locale); @Override String getName(final Locale locale); @Override String getOutputName(); @Override boolean isExternalReport();  }