--- old/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java 2016-12-14 22:22:57.000000000 +0530 +++ new/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java 2016-12-14 22:22:57.000000000 +0530 @@ -58,7 +58,6 @@ import static java.util.stream.Collectors.*; import jdk.tools.jlink.internal.BasicImageWriter; -import jdk.tools.jlink.internal.plugins.FileCopierPlugin.SymImageFile; import jdk.tools.jlink.internal.ExecutableImage; import jdk.tools.jlink.plugin.ResourcePool; import jdk.tools.jlink.plugin.ResourcePoolEntry; @@ -149,20 +148,6 @@ Files.createDirectories(mdir); } - private void storeRelease(ResourcePool pool) throws IOException { - Properties props = new Properties(); - Optional release = pool.findEntry("/java.base/release"); - if (release.isPresent()) { - try (InputStream is = release.get().content()) { - props.load(is); - } - } - File r = new File(root.toFile(), "release"); - try (FileOutputStream fo = new FileOutputStream(r)) { - props.store(fo, null); - } - } - @Override public void storeFiles(ResourcePool files) { try { @@ -180,9 +165,6 @@ throw new PluginException("TargetPlatform attribute is missing for java.base module"); } - // store 'release' file - storeRelease(files); - Path bin = root.resolve(BIN_DIRNAME); // check any duplicated resource files @@ -373,13 +355,22 @@ return Paths.get(LEGAL_DIRNAME, entryToFileName(entry)); case TOP: return Paths.get(entryToFileName(entry)); - case OTHER: - return Paths.get("other", entryToFileName(entry)); default: throw new IllegalArgumentException("invalid type: " + entry); } } + private void storeRelease(ResourcePoolEntry release) throws IOException { + Properties props = new Properties(); + try (InputStream is = release.content()) { + props.load(is); + } + File r = new File(root.toFile(), "release"); + try (FileOutputStream fo = new FileOutputStream(r)) { + props.store(fo, null); + } + } + private void accept(ResourcePoolEntry file) throws IOException { if (file.linkedTarget() != null && file.type() != Type.LEGAL_NOTICE) { throw new UnsupportedOperationException("symbolic link not implemented: " + file); @@ -412,19 +403,9 @@ } break; case TOP: - break; - case OTHER: - String filename = entryToFileName(file); - if (file instanceof SymImageFile) { - SymImageFile sym = (SymImageFile) file; - Path target = root.resolve(sym.getTargetPath()); - if (!Files.exists(target)) { - throw new IOException("Sym link target " + target - + " doesn't exist"); - } - writeSymEntry(root.resolve(filename), target); - } else { - writeEntry(in, root.resolve(filename)); + // only TOP file as of now is "release" file. + if ("/java.base/release".equals(file.path())) { + storeRelease(file); } break; default: