modules/jdk.packager/src/main/java/com/oracle/tools/packager/mac/MacAppStoreBundler.java

Print this page




 187             IOUtils.exec(pb, VERBOSE.fetchFrom(p));
 188             return finalPKG;
 189         } catch (Exception ex) {
 190             Log.info("App Store Ready Bundle failed : " + ex.getMessage());
 191             ex.printStackTrace();
 192             Log.debug(ex);
 193             return null;
 194         } finally {
 195             try {
 196                 if (appImageDir != null && !Log.isDebug()) {
 197                     IOUtils.deleteRecursive(appImageDir);
 198                 } else if (appImageDir != null) {
 199                     Log.info(MessageFormat.format(I18N.getString("mesasge.intermediate-bundle-location"), appImageDir.getAbsolutePath()));
 200                 }
 201                 if (!VERBOSE.fetchFrom(p)) {
 202                     //cleanup
 203                     cleanupConfigFiles(p);
 204                 } else {
 205                     Log.info(MessageFormat.format(I18N.getString("message.config-save-location"), CONFIG_ROOT.fetchFrom(p).getAbsolutePath()));
 206                 }
 207             } catch (FileNotFoundException ex) {
 208                 //noinspection ReturnInsideFinallyBlock

 209                 return null;
 210             }
 211         }
 212     }
 213 
 214     protected void cleanupConfigFiles(Map<String, ? super Object> params) {
 215         if (getConfig_Entitlements(params) != null) {
 216             getConfig_Entitlements(params).delete();
 217         }
 218         if (getConfig_Inherit_Entitlements(params) != null) {
 219             getConfig_Inherit_Entitlements(params).delete();
 220         }
 221         if (MAC_APP_IMAGE.fetchFrom(params) == null) {
 222             APP_BUNDLER.fetchFrom(params).cleanupConfigFiles(params);
 223         }
 224     }
 225 
 226     private File getConfig_Entitlements(Map<String, ? super Object> params) {
 227         return new File(CONFIG_ROOT.fetchFrom(params), APP_NAME.fetchFrom(params) + ".entitlements");
 228     }




 187             IOUtils.exec(pb, VERBOSE.fetchFrom(p));
 188             return finalPKG;
 189         } catch (Exception ex) {
 190             Log.info("App Store Ready Bundle failed : " + ex.getMessage());
 191             ex.printStackTrace();
 192             Log.debug(ex);
 193             return null;
 194         } finally {
 195             try {
 196                 if (appImageDir != null && !Log.isDebug()) {
 197                     IOUtils.deleteRecursive(appImageDir);
 198                 } else if (appImageDir != null) {
 199                     Log.info(MessageFormat.format(I18N.getString("mesasge.intermediate-bundle-location"), appImageDir.getAbsolutePath()));
 200                 }
 201                 if (!VERBOSE.fetchFrom(p)) {
 202                     //cleanup
 203                     cleanupConfigFiles(p);
 204                 } else {
 205                     Log.info(MessageFormat.format(I18N.getString("message.config-save-location"), CONFIG_ROOT.fetchFrom(p).getAbsolutePath()));
 206                 }
 207             } catch (IOException ex) {
 208                 //noinspection ReturnInsideFinallyBlock
 209                 Log.debug(ex.getMessage());
 210                 return null;
 211             }
 212         }
 213     }
 214 
 215     protected void cleanupConfigFiles(Map<String, ? super Object> params) {
 216         if (getConfig_Entitlements(params) != null) {
 217             getConfig_Entitlements(params).delete();
 218         }
 219         if (getConfig_Inherit_Entitlements(params) != null) {
 220             getConfig_Inherit_Entitlements(params).delete();
 221         }
 222         if (MAC_APP_IMAGE.fetchFrom(params) == null) {
 223             APP_BUNDLER.fetchFrom(params).cleanupConfigFiles(params);
 224         }
 225     }
 226 
 227     private File getConfig_Entitlements(Map<String, ? super Object> params) {
 228         return new File(CONFIG_ROOT.fetchFrom(params), APP_NAME.fetchFrom(params) + ".entitlements");
 229     }