< prev index next >

src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppBundler.java

Print this page




  85                     if (result != null) {
  86                         MacCertificate certificate = new MacCertificate(result);
  87 
  88                         if (!certificate.isValid()) {
  89                             Log.error(MessageFormat.format(I18N.getString(
  90                                     "error.certificate.expired"), result));
  91                         }
  92                     }
  93 
  94                     return result;
  95                 },
  96             (s, p) -> s);
  97 
  98     public static final BundlerParamInfo<String> BUNDLE_ID_SIGNING_PREFIX =
  99             new StandardBundlerParam<>(
 100             Arguments.CLIOptions.MAC_BUNDLE_SIGNING_PREFIX.getId(),
 101             String.class,
 102             params -> IDENTIFIER.fetchFrom(params) + ".",
 103             (s, p) -> s);
 104 
 105     public static final BundlerParamInfo<File> ICON_ICNS =
 106             new StandardBundlerParam<>(
 107             "icon.icns",
 108             File.class,
 109             params -> {
 110                 File f = ICON.fetchFrom(params);
 111                 if (f != null && !f.getName().toLowerCase().endsWith(".icns")) {
 112                     Log.error(MessageFormat.format(
 113                             I18N.getString("message.icon-not-icns"), f));
 114                     return null;
 115                 }
 116                 return f;
 117             },
 118             (s, p) -> new File(s));
 119 
 120     public static boolean validCFBundleVersion(String v) {
 121         // CFBundleVersion (String - iOS, OS X) specifies the build version
 122         // number of the bundle, which identifies an iteration (released or
 123         // unreleased) of the bundle. The build version number should be a
 124         // string comprised of three non-negative, period-separated integers
 125         // with the first integer being greater than zero. The string should
 126         // only contain numeric (0-9) and period (.) characters. Leading zeros
 127         // are truncated from each integer and will be ignored (that is,
 128         // 1.02.3 is equivalent to 1.2.3). This key is not localizable.
 129 
 130         if (v == null) {
 131             return false;
 132         }
 133 
 134         String p[] = v.split("\\.");
 135         if (p.length > 3 || p.length < 1) {
 136             Log.verbose(I18N.getString(
 137                     "message.version-string-too-many-components"));
 138             return false;
 139         }




  85                     if (result != null) {
  86                         MacCertificate certificate = new MacCertificate(result);
  87 
  88                         if (!certificate.isValid()) {
  89                             Log.error(MessageFormat.format(I18N.getString(
  90                                     "error.certificate.expired"), result));
  91                         }
  92                     }
  93 
  94                     return result;
  95                 },
  96             (s, p) -> s);
  97 
  98     public static final BundlerParamInfo<String> BUNDLE_ID_SIGNING_PREFIX =
  99             new StandardBundlerParam<>(
 100             Arguments.CLIOptions.MAC_BUNDLE_SIGNING_PREFIX.getId(),
 101             String.class,
 102             params -> IDENTIFIER.fetchFrom(params) + ".",
 103             (s, p) -> s);
 104 















 105     public static boolean validCFBundleVersion(String v) {
 106         // CFBundleVersion (String - iOS, OS X) specifies the build version
 107         // number of the bundle, which identifies an iteration (released or
 108         // unreleased) of the bundle. The build version number should be a
 109         // string comprised of three non-negative, period-separated integers
 110         // with the first integer being greater than zero. The string should
 111         // only contain numeric (0-9) and period (.) characters. Leading zeros
 112         // are truncated from each integer and will be ignored (that is,
 113         // 1.02.3 is equivalent to 1.2.3). This key is not localizable.
 114 
 115         if (v == null) {
 116             return false;
 117         }
 118 
 119         String p[] = v.split("\\.");
 120         if (p.length > 3 || p.length < 1) {
 121             Log.verbose(I18N.getString(
 122                     "message.version-string-too-many-components"));
 123             return false;
 124         }


< prev index next >