< prev index next >

src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java

Print this page

        

*** 93,135 **** } } private final Path root; private final Path mdir; - private final boolean genBom; private final Set<String> modules = new HashSet<>(); /** * Default image builder constructor. * - * @param genBom true, generates a bom file. * @param root The image root directory. * @throws IOException */ ! public DefaultImageBuilder(boolean genBom, Path root) throws IOException { Objects.requireNonNull(root); - this.genBom = genBom; - this.root = root; this.mdir = root.resolve("lib"); Files.createDirectories(mdir); } ! private void storeFiles(Set<String> modules, String bom, Properties release) throws IOException { if (release != null) { addModules(release, modules); File r = new File(root.toFile(), "release"); try (FileOutputStream fo = new FileOutputStream(r)) { release.store(fo, null); } } - // Generate bom - if (genBom) { - File bomFile = new File(root.toFile(), "bom"); - createUtf8File(bomFile, bom); - } } private void addModules(Properties release, Set<String> modules) throws IOException { StringBuilder builder = new StringBuilder(); int i = 0; --- 93,126 ---- } } private final Path root; private final Path mdir; private final Set<String> modules = new HashSet<>(); /** * Default image builder constructor. * * @param root The image root directory. * @throws IOException */ ! public DefaultImageBuilder(Path root) throws IOException { Objects.requireNonNull(root); this.root = root; this.mdir = root.resolve("lib"); Files.createDirectories(mdir); } ! private void storeFiles(Set<String> modules, Properties release) throws IOException { if (release != null) { addModules(release, modules); File r = new File(root.toFile(), "release"); try (FileOutputStream fo = new FileOutputStream(r)) { release.store(fo, null); } } } private void addModules(Properties release, Set<String> modules) throws IOException { StringBuilder builder = new StringBuilder(); int i = 0;
*** 142,152 **** } release.setProperty("MODULES", builder.toString()); } @Override ! public void storeFiles(Pool files, String bom, Properties release) { try { for (ModuleData f : files.getContent()) { if (!f.getType().equals(Pool.ModuleDataType.CLASS_OR_RESOURCE)) { accept(f); } --- 133,143 ---- } release.setProperty("MODULES", builder.toString()); } @Override ! public void storeFiles(Pool files, Properties release) { try { for (ModuleData f : files.getContent()) { if (!f.getType().equals(Pool.ModuleDataType.CLASS_OR_RESOURCE)) { accept(f); }
*** 159,169 **** continue; } modules.add(m.getName()); } } ! storeFiles(modules, bom, release); if (Files.getFileStore(root).supportsFileAttributeView(PosixFileAttributeView.class)) { // launchers in the bin directory need execute permission Path bin = root.resolve("bin"); if (Files.isDirectory(bin)) { --- 150,160 ---- continue; } modules.add(m.getName()); } } ! storeFiles(modules, release); if (Files.getFileStore(root).supportsFileAttributeView(PosixFileAttributeView.class)) { // launchers in the bin directory need execute permission Path bin = root.resolve("bin"); if (Files.isDirectory(bin)) {
*** 188,199 **** throw new PluginException(ex); } } @Override ! public void storeFiles(Pool files, String bom) { ! storeFiles(files, bom, new Properties()); } /** * Generates launcher scripts. * @param imageContent The image content. --- 179,190 ---- throw new PluginException(ex); } } @Override ! public void storeFiles(Pool files) { ! storeFiles(files, new Properties()); } /** * Generates launcher scripts. * @param imageContent The image content.
< prev index next >