src/demo/share/jpackage/JNLPConverter/src/jnlp/converter/JNLPConverter.java
branchJDK-8200758-branch
changeset 57315 4f1efc26b577
parent 57291 f2d429260ad4
equal deleted inserted replaced
57314:23da9e6f446f 57315:4f1efc26b577
   383 
   383 
   384         return file;
   384         return file;
   385     }
   385     }
   386 
   386 
   387     private void buildLaunchArgs() {
   387     private void buildLaunchArgs() {
   388         if (options.createImage()) {
   388         if (options.createAppImage()) {
   389             addLaunchArg("create-image", launchArgs);
   389             addLaunchArg("create-app-image", launchArgs);
   390         } else if (options.createInstaller()) {
   390         } else if (options.createInstaller()) {
   391             if (options.getInstallerType() == null) {
   391             if (options.getInstallerType() == null) {
   392                 addLaunchArg("create-installer", launchArgs);
   392                 addLaunchArg("create-installer", launchArgs);
   393             } else {
   393             } else {
   394                 addLaunchArg("create-installer", launchArgs);
   394                 addLaunchArg("create-installer", launchArgs);
   411         addLaunchArg("--description", jnlpd.getDescription(), launchArgs);
   411         addLaunchArg("--description", jnlpd.getDescription(), launchArgs);
   412         addLaunchArg("--icon", jnlpd.getIconLocation(), launchArgs);
   412         addLaunchArg("--icon", jnlpd.getIconLocation(), launchArgs);
   413         addLaunchArg("--main-jar", jnlpd.getMainJar(), launchArgs);
   413         addLaunchArg("--main-jar", jnlpd.getMainJar(), launchArgs);
   414         addLaunchArg("--main-class", jnlpd.getMainClass(), launchArgs);
   414         addLaunchArg("--main-class", jnlpd.getMainClass(), launchArgs);
   415 
   415 
   416         addFiles(launchArgs);
       
   417         addArguments(launchArgs);
   416         addArguments(launchArgs);
   418         addJVMArgs(launchArgs);
   417         addJVMArgs(launchArgs);
   419 
   418 
   420         if (options.createInstaller()) {
   419         if (options.createInstaller()) {
   421             if (jnlpd.isDesktopHint()) {
   420             if (jnlpd.isDesktopHint()) {
   539                 Log.warning("jpackage retrun non zero code: " + exitCode);
   538                 Log.warning("jpackage retrun non zero code: " + exitCode);
   540             }
   539             }
   541         } catch (IOException | InterruptedException ex) {
   540         } catch (IOException | InterruptedException ex) {
   542             Log.error(ex.getMessage());
   541             Log.error(ex.getMessage());
   543         }
   542         }
   544     }
       
   545 
       
   546     private void addFileList(String arg, List<String> filesToAdd, List<String> launchArgs) {
       
   547         if (filesToAdd.isEmpty()) {
       
   548             return;
       
   549         }
       
   550 
       
   551         String filesArg = "";
       
   552         for (int i = 0; i < filesToAdd.size(); i++) {
       
   553             filesArg += quote(filesToAdd.get(i));
       
   554             if ((i + 1) != filesToAdd.size()) {
       
   555                 filesArg += File.pathSeparator;
       
   556             }
       
   557         }
       
   558 
       
   559         launchArgs.add(arg);
       
   560         launchArgs.add(filesArg);
       
   561     }
       
   562 
       
   563     private void addFiles(List<String> launchArgs) {
       
   564         addFileList("--files", jnlpd.getFiles(), launchArgs);
       
   565     }
   543     }
   566 
   544 
   567     private void addArguments(List<String> launchArgs) {
   545     private void addArguments(List<String> launchArgs) {
   568         List<String> arguments = jnlpd.getArguments();
   546         List<String> arguments = jnlpd.getArguments();
   569         if (arguments.isEmpty()) {
   547         if (arguments.isEmpty()) {