< prev index next >

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

Print this page




 172 
 173             files.entries().forEach(f -> {
 174                 if (!f.type().equals(ResourcePoolEntry.Type.CLASS_OR_RESOURCE)) {
 175                     try {
 176                         accept(f);
 177                     } catch (IOException ioExp) {
 178                         throw new UncheckedIOException(ioExp);
 179                     }
 180                 }
 181             });
 182             files.moduleView().modules().forEach(m -> {
 183                 // Only add modules that contain packages
 184                 if (!m.packages().isEmpty()) {
 185                     modules.add(m.name());
 186                 }
 187             });
 188 
 189             storeFiles(modules, release);
 190 
 191             if (Files.getFileStore(root).supportsFileAttributeView(PosixFileAttributeView.class)) {
 192                 // launchers in the bin directory need execute permission

 193                 if (Files.isDirectory(bin)) {
 194                     Files.list(bin)
 195                             .filter(f -> !f.toString().endsWith(".diz"))
 196                             .filter(f -> Files.isRegularFile(f))
 197                             .forEach(this::setExecutable);
 198                 }
 199 
 200                 // jspawnhelper is in lib or lib/<arch>
 201                 Path lib = root.resolve("lib");
 202                 if (Files.isDirectory(lib)) {
 203                     Files.find(lib, 2, (path, attrs) -> {
 204                         return path.getFileName().toString().equals("jspawnhelper")
 205                                 || path.getFileName().toString().equals("jexec");
 206                     }).forEach(this::setExecutable);
 207                 }
 208             }
 209 
 210             // If native files are stripped completely, <root>/bin dir won't exist!
 211             // So, don't bother generating launcher scripts.
 212             if (Files.isDirectory(bin)) {
 213                  prepareApplicationFiles(files, modules);
 214             }
 215         } catch (IOException ex) {
 216             throw new PluginException(ex);
 217         }




 172 
 173             files.entries().forEach(f -> {
 174                 if (!f.type().equals(ResourcePoolEntry.Type.CLASS_OR_RESOURCE)) {
 175                     try {
 176                         accept(f);
 177                     } catch (IOException ioExp) {
 178                         throw new UncheckedIOException(ioExp);
 179                     }
 180                 }
 181             });
 182             files.moduleView().modules().forEach(m -> {
 183                 // Only add modules that contain packages
 184                 if (!m.packages().isEmpty()) {
 185                     modules.add(m.name());
 186                 }
 187             });
 188 
 189             storeFiles(modules, release);
 190 
 191             if (Files.getFileStore(root).supportsFileAttributeView(PosixFileAttributeView.class)) {
 192                 // launchers in the bin directory need execute permission.
 193                 // On Windows, "bin" also subdirectories containing jvm.dll.
 194                 if (Files.isDirectory(bin)) {
 195                     Files.find(bin, 2, (path, attrs) -> {
 196                         return attrs.isRegularFile() && !path.toString().endsWith(".diz");
 197                     }).forEach(this::setExecutable);

 198                 }
 199 
 200                 // jspawnhelper is in lib or lib/<arch>
 201                 Path lib = root.resolve("lib");
 202                 if (Files.isDirectory(lib)) {
 203                     Files.find(lib, 2, (path, attrs) -> {
 204                         return path.getFileName().toString().equals("jspawnhelper")
 205                                 || path.getFileName().toString().equals("jexec");
 206                     }).forEach(this::setExecutable);
 207                 }
 208             }
 209 
 210             // If native files are stripped completely, <root>/bin dir won't exist!
 211             // So, don't bother generating launcher scripts.
 212             if (Files.isDirectory(bin)) {
 213                  prepareApplicationFiles(files, modules);
 214             }
 215         } catch (IOException ex) {
 216             throw new PluginException(ex);
 217         }


< prev index next >