public static void delete(IResource resource) throws CoreException {
  for (int i=0; i < MAX_RETRY; i++) {
    try {
      resource.delete(IResource.FORCE | IResource.ALWAYS_DELETE_PROJECT_CONTENT,null);
      i=MAX_RETRY;
    }
 catch (    CoreException e) {
      if (i == MAX_RETRY - 1) {
        JavaPlugin.log(e);
        throw e;
      }
      try {
        JavaPlugin.log(new IllegalStateException("sleep before retrying JavaProjectHelper.delete() for " + resource.getLocationURI()));
        Thread.sleep(RETRY_DELAY);
      }
 catch (      InterruptedException e1) {
      }
    }
  }
}

public static void delete ( IResource resource ) throws CoreException { for ( int i = 0 ; i < MAX_RETRY ; i ++ ) { try { resource . delete ( IResource . FORCE | IResource . ALWAYS_DELETE_PROJECT_CONTENT , null ) ; i = MAX_RETRY ; } catch ( CoreException e ) { if ( i == MAX_RETRY - 1 ) { JavaPlugin . log ( e ) ; throw e ; } try { JavaPlugin . log ( new IllegalStateException ( "sleep before retrying JavaProjectHelper.delete() for " + resource . getLocationURI ( ) ) ) ; Thread . sleep ( RETRY_DELAY ) ; } catch ( InterruptedException e1 ) { } } } }
removes a resource . retries if deletion failed ( e . g . because the indexer still locks the file ) .
