src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java
branchJDK-8200758-branch
changeset 57096 d06bec27f8c9
parent 57091 06bc4bd64599
child 57106 ea870b9ce89a
equal deleted inserted replaced
57095:1e18c850b591 57096:d06bec27f8c9
    84             }
    84             }
    85             return null;
    85             return null;
    86         } catch (IOException ex) {
    86         } catch (IOException ex) {
    87             Log.verbose(ex);
    87             Log.verbose(ex);
    88             return null;
    88             return null;
    89         } finally {
    89         }
    90             try {
       
    91                 if (appImageDir != null &&
       
    92                         PREDEFINED_APP_IMAGE.fetchFrom(params) == null &&
       
    93                         (PREDEFINED_RUNTIME_IMAGE.fetchFrom(params) == null ||
       
    94                         !Arguments.CREATE_JRE_INSTALLER.fetchFrom(params)) &&
       
    95                         !Log.isDebug() &&
       
    96                         !Log.isVerbose()) {
       
    97                     IOUtils.deleteRecursive(appImageDir);
       
    98                 } else if (appImageDir != null) {
       
    99                     Log.verbose(MessageFormat.format(I18N.getString(
       
   100                             "message.intermediate-image-location"),
       
   101                             appImageDir.getAbsolutePath()));
       
   102                 }
       
   103 
       
   104                 //cleanup
       
   105                 cleanupConfigFiles(params);
       
   106             } catch (IOException ex) {
       
   107                 Log.debug(ex);
       
   108                 //noinspection ReturnInsideFinallyBlock
       
   109                 return null;
       
   110             }
       
   111         }
       
   112     }
       
   113 
       
   114     //remove
       
   115     protected void cleanupConfigFiles(Map<String, ? super Object> params) {
       
   116         if (Log.isDebug() || Log.isVerbose()) {
       
   117             return;
       
   118         }
       
   119 
       
   120         if (getConfig_VolumeBackground(params) != null) {
       
   121             getConfig_VolumeBackground(params).delete();
       
   122         }
       
   123         if (getConfig_VolumeIcon(params) != null) {
       
   124             getConfig_VolumeIcon(params).delete();
       
   125         }
       
   126         if (getConfig_VolumeScript(params) != null) {
       
   127             getConfig_VolumeScript(params).delete();
       
   128         }
       
   129         if (getConfig_Script(params) != null) {
       
   130             getConfig_Script(params).delete();
       
   131         }
       
   132         if (getConfig_LicenseFile(params) != null) {
       
   133             getConfig_LicenseFile(params).delete();
       
   134         }
       
   135         APP_BUNDLER.fetchFrom(params).cleanupConfigFiles(params);
       
   136     }
    90     }
   137 
    91 
   138     private static final String hdiutil = "/usr/bin/hdiutil";
    92     private static final String hdiutil = "/usr/bin/hdiutil";
   139 
    93 
   140     private void prepareDMGSetupScript(String volumeName,
    94     private void prepareDMGSetupScript(String volumeName,