/** * Returns the name to use for the corresponding HTML file from the given * XML file * * @param xmlFile * @return the HTML name to use */ protected String getNameFromXMLFilename(File xmlFile) { String fileName = xmlFile.getAbsolutePath(); int index = fileName.lastIndexOf('.'); StringBuilder buffer = new StringBuilder(); buffer.append(fileName.substring(getReportsRoot().getAbsolutePath().length(), index)).append(HTML_EXTENSION); File htmlFile = new File(getHtmlLocation(), String.valueOf(buffer)); return htmlFile.getAbsolutePath(); }
/** * Transforms the given set of xml files with the given XSLT and places the * result into a corresponding HTML file * * @param xmlfiles * @param xsltFile * @param html */ protected void tranformXml(File[] xmlfiles, File xsltFile) { File html = null; for (File xmlfile : xmlfiles) { try { File htmlroot = new File(getHtmlLocation(), getHTMLFileLocation(xmlfile)); if (!htmlroot.exists()) { htmlroot.mkdirs(); } html = new File(getNameFromXMLFilename(xmlfile)); applyXSLT(xsltFile, xmlfile, html); } catch (Exception e) { ApiPlugin.log(e); } } }
File originhtml = null; try { File htmlroot = new File(getHtmlLocation(), report.name); if (!htmlroot.exists()) { htmlroot.mkdirs();
File reportIndex = new File(getHtmlLocation(), "index.html"); //$NON-NLS-1$ if (!reportIndex.exists()) { reportIndex.createNewFile();
if (getHtmlLocation() == null) { return; localmonitor.setTaskName(SearchMessages.UseReportConverter_preparing_html_root); localmonitor.split(1); File htmlRoot = new File(getHtmlLocation()); if (!htmlRoot.exists()) { if (!htmlRoot.mkdirs()) { throw new Exception(NLS.bind(SearchMessages.could_not_create_file, getHtmlLocation()));