private void compareToInstallLocation ( ExecutionContext context , CommandConsole console , Map < String , Set < String > > aparToIFixMap , File wlpInstallationDirectory ) { String installToCompareToLocation = context . getOptionValue ( INSTALL_LOCATION_TO_COMPARE_TO_OPTION ) ; File installToCompareToFile = new File ( installToCompareToLocation ) ; if ( ! installToCompareToFile . exists ( ) ) { console . printlnErrorMessage ( getMessage ( "compare.to.option.does.not.exist" , installToCompareToLocation ) ) ; return ; } Set < String > aparsForNewInstall = null ; try { aparsForNewInstall = findFixPackAparIds ( installToCompareToFile , console , context ) ; } catch ( IllegalArgumentException e ) { // These are thrown by the methods when the inputs were invalid and should have the message set to something readable to the user console . printlnErrorMessage ( e . getMessage ( ) ) ; return ; } catch ( ZipException e ) { console . printlnErrorMessage ( getMessage ( "compare.error.reading.install" , installToCompareToLocation , e . getMessage ( ) ) ) ; return ; } catch ( IOException e ) { console . printlnErrorMessage ( getMessage ( "compare.error.reading.install" , installToCompareToLocation , e . getMessage ( ) ) ) ; return ; } // Go through all of the APARs that are currently installed and make sure they are in the new version Map < String , Set < String > > missingApars = new HashMap < String , Set < String > > ( ) ; for ( Map . Entry < String , Set < String > > aparIFixInfo : aparToIFixMap . entrySet ( ) ) { String apar = aparIFixInfo . getKey ( ) ; if ( ! aparsForNewInstall . contains ( apar ) ) { missingApars . put ( apar , aparIFixInfo . getValue ( ) ) ; } } // Output the result, this will consist of a message saying if there were any missing iFixes then details on what was missing and what was included if ( missingApars . isEmpty ( ) ) { console . printlnInfoMessage ( getMessage ( "compare.all.ifixes.present" , wlpInstallationDirectory . getAbsolutePath ( ) , installToCompareToLocation ) ) ; } else { console . printlnInfoMessage ( getMessage ( "compare.ifixes.missing" , wlpInstallationDirectory . getAbsolutePath ( ) , installToCompareToLocation ) ) ; console . printlnInfoMessage ( "" ) ; console . printlnInfoMessage ( getMessage ( "compare.list.missing.ifixes" , wlpInstallationDirectory . getAbsolutePath ( ) , installToCompareToLocation ) ) ; printAparIFixInfo ( console , missingApars ) ; } // Now print the included APARs by removing all of the missing ones for ( String missingApar : missingApars . keySet ( ) ) { aparToIFixMap . remove ( missingApar ) ; } if ( ! aparToIFixMap . isEmpty ( ) ) { console . printlnInfoMessage ( "" ) ; console . printlnInfoMessage ( getMessage ( "compare.list.included.ifixes" , wlpInstallationDirectory . getAbsolutePath ( ) , installToCompareToLocation ) ) ; printAparIFixInfo ( console , aparToIFixMap ) ; } }
Compares the current install to one supplied in the console arguments