public void removeFile()

in src/net/sourceforge/transparent/TransparentVcs.java [661:705]


  public void removeFile( final File file, final String comment, final List<VcsException> errors )
  {
    try
    {
      Runnable action = () -> {
        //  We can remove only non-checkedout files???
        Status status = getFileStatus( file );
        if( status == Status.CHECKED_OUT )
          undoCheckoutFile( file, errors );

        File ioParent = file.getParentFile();
        if( ioParent.exists() )
        {
          @NonNls String deleteComment = "Deleting " + file.getName();
          String parentComment = addToComment( comment, deleteComment );


          VcsException error = tryToCheckout( ioParent, parentComment, false);
          if( error != null )
          {
            errors.add( error );
            return;
          }

          //  All other exceptions are currently non-workaroundable and
          //  cause the complete operation failure.
          try
          {
            getClearCase().delete( file, StringUtil.isNotEmpty( comment ) ? comment : deleteComment );
            getClearCase().checkIn( ioParent, parentComment );
          }
          catch( ClearCaseException ccExc )
          {
            VcsException e = new VcsException( ccExc.getMessage() );
            errors.add( e );
          }
        }
      };
      executeAndHandleOtherFileInTheWay( file, action );
    }
    catch (Throwable e)
    {
      handleException( e, (VirtualFile)null, errors );
    }
  }