code: public void removeRepository(String repositoryName, boolean forceRemove) throws RepositoryCreationException
     {
        if (rpcService != null)
        {
           try
           {
              if (!forceRemove)
              {
                 List<Object> results = rpcService.executeCommandOnAllNodes(canRemoveRepository, true, repositoryName);
                 for (Object result : results)
                 {
                    if (result != null)
                    {
                       if (result instanceof Throwable)
                       {
                          throw new RepositoryCreationException("It is not possible to check is repository "
                             + repositoryName + " in usage or not", (Throwable)result);
                       }
                       else if (result instanceof Boolean)
                       {
                          if (!(Boolean)result)
                          {
                             throw new RepositoryCreationException("Can't remove repository " + repositoryName
                                + ". The repository in use.");
                          }
                       }
                       else
                       {
                          throw new RepositoryCreationException(
                             "checkRepositoryInUse command returned uknown result type");
                       }
                    }
                 }
              }
  
              List<Object> results = rpcService.executeCommandOnAllNodes(removeRepository, true, repositoryName, new Boolean(forceRemove));
              for (Object result : results)
              {
                 if (result != null)
                 {
                    if (result instanceof Throwable)
                    {
                       throw new RepositoryCreationException("Can't remove repository " + repositoryName,
                          (Throwable)result);
                    }
                    else
                    {
                       throw new RepositoryCreationException("removeRepository command returned uknown result type");
                    }
                 }
              }
           }
           catch (RPCException e)
           {
              throw new RepositoryCreationException("Can't remove repository " + repositoryName, e);
           }
        }
        else
        {
           if (!forceRemove)
           {
              try
              {
                 if (!repositoryService.canRemoveRepository(repositoryName))
                 {
                    throw new RepositoryCreationException("Can't remove repository " + repositoryName
                       + ". The repository in use.");
                 }
              }
              catch (RepositoryException e)
              {
                 throw new RepositoryCreationException("It is not possible to check is repository " + repositoryName
                    + " in usage or not", e);
              }
           }
  
           removeRepositoryLocally(repositoryName, forceRemove);
        }
     }
docs: {@inheritDoc}