private String integrateStylesheetIntoXslt(InputStream xsltAsInputStream, InputStream styleSheetAsInputStream) { String xsltAsString = Streams.asString(xsltAsInputStream); String styleSheetAsString = Streams.asString(styleSheetAsInputStream); xsltAsString = xsltAsString.replace("<style type=\"text/css\"></style>", "<style type=\"text/css\">\n" + styleSheetAsString + "\n</style>"); if (System.getProperty("japicmp.dump.xslt") != null) { try { Files.write(Paths.get(System.getProperty("japicmp.dump.xslt")), Collections.singletonList(xsltAsString), Charset.forName("UTF-8"), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } catch (IOException e) { LOGGER.log(Level.WARNING, "Could not dump XSLT file: " + e.getMessage(), e); } } return xsltAsString; }
private String integrateStylesheetIntoXslt(InputStream xsltAsInputStream, InputStream styleSheetAsInputStream) { String xsltAsString = Streams.asString(xsltAsInputStream); String styleSheetAsString = Streams.asString(styleSheetAsInputStream); xsltAsString = xsltAsString.replace("<style type=\"text/css\"></style>", "<style type=\"text/css\">\n" + styleSheetAsString + "\n</style>"); if (System.getProperty("japicmp.dump.xslt") != null) { try { Files.write(Paths.get(System.getProperty("japicmp.dump.xslt")), Collections.singletonList(xsltAsString), Charset.forName("UTF-8"), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } catch (IOException e) { LOGGER.log(Level.WARNING, "Could not dump XSLT file: " + e.getMessage(), e); } } return xsltAsString; }