480 (Class<Set<String>>) (Object) Set.class,
481 p -> new LinkedHashSet<String>(),
482 (s, p) -> new LinkedHashSet<>(Arrays.asList(s.split(",")))
483 );
484
485 static boolean isRuntimeInstaller(Map<String, ? super Object> params) {
486 if (params.containsKey(MODULE.getID()) ||
487 params.containsKey(MAIN_JAR.getID()) ||
488 params.containsKey(PREDEFINED_APP_IMAGE.getID())) {
489 return false; // we are building or are given an application
490 }
491 // runtime installer requires --runtime-image, if this is false
492 // here then we should have thrown error validating args.
493 return params.containsKey(PREDEFINED_RUNTIME_IMAGE.getID());
494 }
495
496 static File getPredefinedAppImage(Map<String, ? super Object> params) {
497 File applicationImage = null;
498 if (PREDEFINED_APP_IMAGE.fetchFrom(params) != null) {
499 applicationImage = PREDEFINED_APP_IMAGE.fetchFrom(params);
500 Log.debug("Using App Image from " + applicationImage);
501 if (!applicationImage.exists()) {
502 throw new RuntimeException(
503 MessageFormat.format(I18N.getString(
504 "message.app-image-dir-does-not-exist"),
505 PREDEFINED_APP_IMAGE.getID(),
506 applicationImage.toString()));
507 }
508 }
509 return applicationImage;
510 }
511
512 static void copyPredefinedRuntimeImage(
513 Map<String, ? super Object> params,
514 AbstractAppImageBuilder appBuilder)
515 throws IOException , ConfigException {
516 File topImage = PREDEFINED_RUNTIME_IMAGE.fetchFrom(params);
517 if (!topImage.exists()) {
518 throw new ConfigException(
519 MessageFormat.format(I18N.getString(
520 "message.runtime-image-dir-does-not-exist"),
|
480 (Class<Set<String>>) (Object) Set.class,
481 p -> new LinkedHashSet<String>(),
482 (s, p) -> new LinkedHashSet<>(Arrays.asList(s.split(",")))
483 );
484
485 static boolean isRuntimeInstaller(Map<String, ? super Object> params) {
486 if (params.containsKey(MODULE.getID()) ||
487 params.containsKey(MAIN_JAR.getID()) ||
488 params.containsKey(PREDEFINED_APP_IMAGE.getID())) {
489 return false; // we are building or are given an application
490 }
491 // runtime installer requires --runtime-image, if this is false
492 // here then we should have thrown error validating args.
493 return params.containsKey(PREDEFINED_RUNTIME_IMAGE.getID());
494 }
495
496 static File getPredefinedAppImage(Map<String, ? super Object> params) {
497 File applicationImage = null;
498 if (PREDEFINED_APP_IMAGE.fetchFrom(params) != null) {
499 applicationImage = PREDEFINED_APP_IMAGE.fetchFrom(params);
500 if (!applicationImage.exists()) {
501 throw new RuntimeException(
502 MessageFormat.format(I18N.getString(
503 "message.app-image-dir-does-not-exist"),
504 PREDEFINED_APP_IMAGE.getID(),
505 applicationImage.toString()));
506 }
507 }
508 return applicationImage;
509 }
510
511 static void copyPredefinedRuntimeImage(
512 Map<String, ? super Object> params,
513 AbstractAppImageBuilder appBuilder)
514 throws IOException , ConfigException {
515 File topImage = PREDEFINED_RUNTIME_IMAGE.fetchFrom(params);
516 if (!topImage.exists()) {
517 throw new ConfigException(
518 MessageFormat.format(I18N.getString(
519 "message.runtime-image-dir-does-not-exist"),
|