< prev index next >

src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java

Print this page




 166         super(params, imageOutDir.resolve(APP_NAME.fetchFrom(params)
 167                 + ".app/Contents/runtime/Contents/Home"));
 168 
 169         Objects.requireNonNull(imageOutDir);
 170 
 171         this.root = imageOutDir.resolve(APP_NAME.fetchFrom(params) + ".app");
 172         this.contentsDir = root.resolve("Contents");
 173         this.javaDir = contentsDir.resolve("Java");
 174         this.javaModsDir = javaDir.resolve("mods");
 175         this.resourcesDir = contentsDir.resolve("Resources");
 176         this.macOSDir = contentsDir.resolve("MacOS");
 177         this.runtimeDir = contentsDir.resolve("runtime");
 178         this.runtimeRoot = runtimeDir.resolve("Contents/Home");
 179         this.mdir = runtimeRoot.resolve("lib");
 180         Files.createDirectories(javaDir);
 181         Files.createDirectories(resourcesDir);
 182         Files.createDirectories(macOSDir);
 183         Files.createDirectories(runtimeDir);
 184     }
 185 
 186     public MacAppImageBuilder(Map<String, Object> params, String jreName,
 187             Path imageOutDir) throws IOException {
 188         super(null, imageOutDir.resolve(jreName + "/Contents/Home"));
 189 
 190         Objects.requireNonNull(imageOutDir);
 191 
 192         this.root = imageOutDir.resolve(jreName );
 193         this.contentsDir = root.resolve("Contents");
 194         this.javaDir = null;
 195         this.javaModsDir = null;
 196         this.resourcesDir = null;
 197         this.macOSDir = null;
 198         this.runtimeDir = this.root;
 199         this.runtimeRoot = runtimeDir.resolve("Contents/Home");
 200         this.mdir = runtimeRoot.resolve("lib");
 201 
 202         Files.createDirectories(runtimeDir);
 203     }
 204 
 205     private void writeEntry(InputStream in, Path dstFile) throws IOException {
 206         Files.createDirectories(dstFile.getParent());
 207         Files.copy(in, dstFile);
 208     }
 209 
 210     public static boolean validCFBundleVersion(String v) {
 211         // CFBundleVersion (String - iOS, OS X) specifies the build version
 212         // number of the bundle, which identifies an iteration (released or
 213         // unreleased) of the bundle. The build version number should be a
 214         // string comprised of three non-negative, period-separated integers
 215         // with the first integer being greater than zero. The string should
 216         // only contain numeric (0-9) and period (.) characters. Leading zeros
 217         // are truncated from each integer and will be ignored (that is,
 218         // 1.02.3 is equivalent to 1.2.3). This key is not localizable.
 219 
 220         if (v == null) {
 221             return false;
 222         }
 223 
 224         String p[] = v.split("\\.");




 166         super(params, imageOutDir.resolve(APP_NAME.fetchFrom(params)
 167                 + ".app/Contents/runtime/Contents/Home"));
 168 
 169         Objects.requireNonNull(imageOutDir);
 170 
 171         this.root = imageOutDir.resolve(APP_NAME.fetchFrom(params) + ".app");
 172         this.contentsDir = root.resolve("Contents");
 173         this.javaDir = contentsDir.resolve("Java");
 174         this.javaModsDir = javaDir.resolve("mods");
 175         this.resourcesDir = contentsDir.resolve("Resources");
 176         this.macOSDir = contentsDir.resolve("MacOS");
 177         this.runtimeDir = contentsDir.resolve("runtime");
 178         this.runtimeRoot = runtimeDir.resolve("Contents/Home");
 179         this.mdir = runtimeRoot.resolve("lib");
 180         Files.createDirectories(javaDir);
 181         Files.createDirectories(resourcesDir);
 182         Files.createDirectories(macOSDir);
 183         Files.createDirectories(runtimeDir);
 184     }
 185 



















 186     private void writeEntry(InputStream in, Path dstFile) throws IOException {
 187         Files.createDirectories(dstFile.getParent());
 188         Files.copy(in, dstFile);
 189     }
 190 
 191     public static boolean validCFBundleVersion(String v) {
 192         // CFBundleVersion (String - iOS, OS X) specifies the build version
 193         // number of the bundle, which identifies an iteration (released or
 194         // unreleased) of the bundle. The build version number should be a
 195         // string comprised of three non-negative, period-separated integers
 196         // with the first integer being greater than zero. The string should
 197         // only contain numeric (0-9) and period (.) characters. Leading zeros
 198         // are truncated from each integer and will be ignored (that is,
 199         // 1.02.3 is equivalent to 1.2.3). This key is not localizable.
 200 
 201         if (v == null) {
 202             return false;
 203         }
 204 
 205         String p[] = v.split("\\.");


< prev index next >