modules/jdk.packager/src/main/java/jdk/packager/builders/linux/LinuxAppImageBuilder.java

Print this page




 176     public InputStream getResourceAsStream(String name) {
 177         return LinuxResources.class.getResourceAsStream(name);
 178     }
 179 
 180     @Override
 181     public void prepareApplicationFiles() throws IOException {
 182         Map<String, ? super Object> originalParams = new HashMap<>(params);
 183 
 184         try {
 185             // create the primary launcher
 186             createLauncherForEntryPoint(params, root);
 187 
 188             // Copy library to the launcher folder
 189             writeEntry(LinuxResources.class.getResourceAsStream(LIBRARY_NAME), root.resolve(LIBRARY_NAME));
 190 
 191             // create the secondary launchers, if any
 192             List<Map<String, ? super Object>> entryPoints = StandardBundlerParam.SECONDARY_LAUNCHERS.fetchFrom(params);
 193             for (Map<String, ? super Object> entryPoint : entryPoints) {
 194                 Map<String, ? super Object> tmp = new HashMap<>(originalParams);
 195                 tmp.putAll(entryPoint);



 196                 createLauncherForEntryPoint(tmp, root);
 197             }
 198 
 199             // Copy class path entries to Java folder
 200             copyApplication();
 201 
 202             // Copy icon to Resources folder
 203 //FIXME            copyIcon(resourcesDirectory);
 204 
 205         } catch (IOException ex) {
 206             Log.info("Exception: " + ex);
 207             Log.debug(ex);
 208         }
 209     }
 210 
 211     private void createLauncherForEntryPoint(Map<String, ? super Object> p, Path rootDir) throws IOException {
 212         // Copy executable to Linux folder
 213         Path executableFile = root.resolve(getLauncherName(p));
 214 
 215         writeEntry(LinuxResources.class.getResourceAsStream(EXECUTABLE_NAME), executableFile);




 176     public InputStream getResourceAsStream(String name) {
 177         return LinuxResources.class.getResourceAsStream(name);
 178     }
 179 
 180     @Override
 181     public void prepareApplicationFiles() throws IOException {
 182         Map<String, ? super Object> originalParams = new HashMap<>(params);
 183 
 184         try {
 185             // create the primary launcher
 186             createLauncherForEntryPoint(params, root);
 187 
 188             // Copy library to the launcher folder
 189             writeEntry(LinuxResources.class.getResourceAsStream(LIBRARY_NAME), root.resolve(LIBRARY_NAME));
 190 
 191             // create the secondary launchers, if any
 192             List<Map<String, ? super Object>> entryPoints = StandardBundlerParam.SECONDARY_LAUNCHERS.fetchFrom(params);
 193             for (Map<String, ? super Object> entryPoint : entryPoints) {
 194                 Map<String, ? super Object> tmp = new HashMap<>(originalParams);
 195                 tmp.putAll(entryPoint);
 196                 // remove name.fs that was calculated for main launcher.
 197                 // otherwise, wrong launcher name will be selected.
 198                 tmp.remove(APP_FS_NAME.getID());
 199                 createLauncherForEntryPoint(tmp, root);
 200             }
 201 
 202             // Copy class path entries to Java folder
 203             copyApplication();
 204 
 205             // Copy icon to Resources folder
 206 //FIXME            copyIcon(resourcesDirectory);
 207 
 208         } catch (IOException ex) {
 209             Log.info("Exception: " + ex);
 210             Log.debug(ex);
 211         }
 212     }
 213 
 214     private void createLauncherForEntryPoint(Map<String, ? super Object> p, Path rootDir) throws IOException {
 215         // Copy executable to Linux folder
 216         Path executableFile = root.resolve(getLauncherName(p));
 217 
 218         writeEntry(LinuxResources.class.getResourceAsStream(EXECUTABLE_NAME), executableFile);