public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context)
      throws CoreException, OperationCanceledException {
    RefactoringStatus result = new RefactoringStatus();

    // Find target repository
    IConnectionProfileRepository repo = getTargetRepository();

    // RJC: TODO: we should really prompt the user for overwrites. i.e.
    // behavior should be similar to moving a resource in the workspace
    for (int index = 0, count = mProfiles.length; index < count; ++index) {
      // Verify that the profile is compatible with the repository
      if (repo != null) {
        if (repo.isReadOnly()
            || repo.getProfileByName(mProfiles[index].getName()) != null
            || !repo.supportsProfileType(mProfiles[index].getProviderId())
            || !((ConnectionProfileProvider) mProfiles[index].getProvider())
                .compatibleWithRepository(repo.getRepositoryProfile())) {
          continue;
        }
      } else if (InternalProfileManager.getInstance()
              .getProfileByName(mProfiles[index].getName(), false)
          != null) {
        continue;
      }

      mProfilesToMove.add(mProfiles[index]);
    }

    return result;
  }