code: @GET
     @RolesAllowed("administrators")
     @Path("/remove-repository/{repositoryName}/{forseSessionClose}")
     public Response removeRepository(@Context UriInfo uriInfo, @PathParam("repositoryName") String repositoryName,
        @PathParam("forseSessionClose") Boolean forseSessionClose)
     {
        String errorMessage = new String();
        Status status;
  
        try
        {
           if (forseSessionClose)
           {
              for (WorkspaceEntry wsEntry : repositoryService.getConfig().getRepositoryConfiguration(repositoryName)
                 .getWorkspaceEntries())
              {
                 forceCloseSession(repositoryName, wsEntry.getName());
              }
           }
  
           if (repositoryService.canRemoveRepository(repositoryName))
           {
              repositoryService.removeRepository(repositoryName);
              repositoryService.getConfig().retain(); // save configuration to persistence (file or persister) 
              return Response.ok().build();
           }
           return Response.status(Status.CONFLICT).entity("Can't remove repository " + repositoryName)
              .cacheControl(NO_CACHE).build();
        }
        catch (RepositoryException e)
        {
           if (log.isDebugEnabled())
           {
              log.error(e.getMessage(), e);
           }
           errorMessage = e.getMessage();
           status = Status.NOT_FOUND;
        }
        catch (Throwable e) //NOSONAR
        {
           if (log.isDebugEnabled())
           {
              log.error(e.getMessage(), e);
           }
           errorMessage = e.getMessage();
           status = Status.INTERNAL_SERVER_ERROR;
        }
  
        return Response.status(status).entity(errorMessage).type(MediaType.TEXT_PLAIN_TYPE).cacheControl(NO_CACHE)
           .build();
     }
docs: Removes an existing repository
  
  @param uriInfo the uri location
  @param repositoryName the name of the repository
  @param forseSessionClose a flag indicating whether or not the current sessions must be closed
  @return Response return the Response
  @LevelAPI Experimental