protected boolean prepareDeployment(@Nullable Project project,@Nullable final DataContext dataContext,final ProgressHandler progressHandler){
  boolean isVerified=true;
  if (project != null) {
    isVerified=doVerify(project,dataContext,progressHandler);
    if (isVerified) {
      final SlingServerTreeSelectionHandler selectionHandler=getSelectionHandler(project);
      ServerConfiguration serverConfiguration=selectionHandler.getCurrentConfiguration();
      if (serverConfiguration != null) {
        AEMPluginConfiguration pluginConfiguration=ComponentProvider.getComponent(project,AEMPluginConfiguration.class);
        String lastUsedServerConfiguration=pluginConfiguration != null ? pluginConfiguration.getLastUsedServerConfiguration() : "";
        if (lastUsedServerConfiguration != null && lastUsedServerConfiguration.length() > 0 && !lastUsedServerConfiguration.equals(serverConfiguration.getName())) {
          doPurge(project,progressHandler);
          if (pluginConfiguration != null) {
            pluginConfiguration.setLastUsedServerConfiguration(serverConfiguration.getName());
          }
        }
 else         if (lastUsedServerConfiguration == null || lastUsedServerConfiguration.length() == 0) {
          if (pluginConfiguration != null) {
            pluginConfiguration.setLastUsedServerConfiguration(serverConfiguration.getName());
          }
        }
      }
    }
  }
  return isVerified;
}

protected boolean prepareDeployment ( @ Nullable Project project , @ Nullable final DataContext dataContext , final ProgressHandler progressHandler ) { boolean isVerified = true ; if ( project != null ) { isVerified = doVerify ( project , dataContext , progressHandler ) ; if ( isVerified ) { final SlingServerTreeSelectionHandler selectionHandler = getSelectionHandler ( project ) ; ServerConfiguration serverConfiguration = selectionHandler . getCurrentConfiguration ( ) ; if ( serverConfiguration != null ) { AEMPluginConfiguration pluginConfiguration = ComponentProvider . getComponent ( project , AEMPluginConfiguration . class ) ; String lastUsedServerConfiguration = pluginConfiguration != null ? pluginConfiguration . getLastUsedServerConfiguration ( ) : "" ; if ( lastUsedServerConfiguration != null && lastUsedServerConfiguration . length ( ) > 0 && ! lastUsedServerConfiguration . equals ( serverConfiguration . getName ( ) ) ) { doPurge ( project , progressHandler ) ; if ( pluginConfiguration != null ) { pluginConfiguration . setLastUsedServerConfiguration ( serverConfiguration . getName ( ) ) ; } } else if ( lastUsedServerConfiguration == null || lastUsedServerConfiguration . length ( ) == 0 ) { if ( pluginConfiguration != null ) { pluginConfiguration . setLastUsedServerConfiguration ( serverConfiguration . getName ( ) ) ; } } } } } return isVerified ; }
prepares the deployment by running the verification and the purge if the server connection changed
