code: public void ensureUniqueName(
          final String parentFolder,
          String newName,
          final I_CmsSimpleCallback<String> callback) {
  
          // using lower case folder names
          final String lowerCaseName = newName.toLowerCase();
          CmsRpcAction<String> action = new CmsRpcAction<String>() {
  
              /**
               * @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
               */
              @Override
              public void execute() {
  
                  start(0, false);
                  CmsCoreProvider.getService().getUniqueFileName(parentFolder, lowerCaseName, this);
              }
  
              /**
               * @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
               */
              @Override
              protected void onResponse(String result) {
  
                  stop(false);
                  callback.execute(result);
              }
  
          };
          action.execute();
      }
docs: Ensure the uniqueness of a given URL-name within the children of the given parent folder.<p>
  
  @param parentFolder the parent folder
  @param newName the proposed name
  @param callback the callback to execute