public static void copyResources(JAXConfiguration configuration) { InputStream defaultCSS = Utils.class.getResourceAsStream("/doclet.css"); if (defaultCSS == null) throw new RuntimeException("Failed to find doclet CSS (incorrect jax-doclets packaging?)"); if (!isEmptyOrNull(configuration.parentConfiguration.stylesheetfile)) { try { InputStream stream = new FileInputStream(configuration.parentConfiguration.stylesheetfile); copyResource(stream, new File(configuration.parentConfiguration.destDirName, "doclet.css")); // also put the original stylesheet in case it's needed copyResource( defaultCSS, new File(configuration.parentConfiguration.destDirName, "default-doclet.css")); } catch (Exception x) { throw new RuntimeException( "Failed to read user stylesheet " + configuration.parentConfiguration.stylesheetfile, x); } } else copyResource( defaultCSS, new File(configuration.parentConfiguration.destDirName, "doclet.css")); }
private static void copyResource(JAXConfiguration configuration, String name) { InputStream graphHTML = Utils.class.getResourceAsStream("/" + name); if (graphHTML == null) throw new RuntimeException("Failed to find " + name + " (incorrect jax-doclets packaging?)"); copyResource(graphHTML, new File(configuration.parentConfiguration.destDirName, name)); }
public static void copyJPAResources(JAXConfiguration configuration) { copyResource(configuration, "graph.js"); copyResource(configuration, "jit.js"); }