Remove repository.

@param repositoryService
RepositoryService, the repository service
@param repositoryName
String, the repository name
@throws RepositoryException
will be generated the RepositoryException
@throws RepositoryConfigurationException
345882
protected void removeRepository(RepositoryService repositoryService, String repositoryName)
      throws RepositoryException,
      RepositoryConfigurationException
   {
      ManageableRepository mr = null;

      try
      {
         mr = repositoryService.getRepository(repositoryName);
      }
      catch (RepositoryException e)
      {
         // The repository not exist.
         if (LOG.isTraceEnabled())
         {
            LOG.trace("An exception occurred: " + e.getMessage());
         }
      }

      if (mr != null)
      {
         closeAllSession(mr);
         repositoryService.removeRepository(repositoryName);
         repositoryService.getConfig().retain(); // save configuration to persistence (file or persister)
      }
   }
532184
public void removeProperty(final FedoraResource resource,
                               final org.apache.jena.rdf.model.Property predicate,
                               final RDFNode objectNode,
                               final Map<String, String> nsPrefixMap) throws RepositoryException {

        final Node node = getJcrNode(resource);
        final String propertyName = getPropertyNameFromPredicate(node, predicate, nsPrefixMap);

        if (isManagedPredicate.test(predicate) || jcrProperties.contains(predicate)) {

            throw new ServerManagedPropertyException("Could not remove triple containing predicate "
                    + predicate.toString()
                    + " to node "
                    + node.getPath());
        }

        if (objectNode.isURIResource()
                && idTranslator.inDomain(objectNode.asResource())
                && !isReferenceProperty(node, propertyName)) {
            nodePropertiesTools.removeReferencePlaceholders(idTranslator,
                    node,
                    propertyName,
                    objectNode.asResource());
        } else {
            final Value v = createValue(node, objectNode, propertyName);
            nodePropertiesTools.removeNodeProperty(node, propertyName, v);
        }
    }
1032580
@Override
    protected void removeWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException {
        remove(subject, predicate, object, contexts);
    }
481292
public static void validateRepoName(String name) {
        if (name.isEmpty()) {
            throw new InvalidRepositoryNameException(String.format("Invalid empty repository name \"%s\"", name));
        }

        if (name.length() > RepositoryNameTotalLengthMax) {
            throw new InvalidRepositoryNameException(String.format("Repository name \"%s\" is longer than "
                    + RepositoryNameTotalLengthMax, name));
        }

        String[] components = name.split("/");

        for (String component : components) {
            if (!RepositoryNameComponentAnchoredRegexp.matcher(component).matches()) {
                throw new InvalidRepositoryNameException(String.format(
                        "Repository name \"%s\" is invalid. Component: %s", name, component));
            }
        }
    }
1267836
def delete_repository_tag(self, namespace, repository, tag):
        """"""
        return self._http_call(self.TAGS + '/' + tag, delete,
                               namespace=namespace, repository=repository)
666702
@com.fasterxml.jackson.annotation.JsonProperty("repositoryName")
    public void setRepositoryName(String repositoryName) {
        this.repositoryName = repositoryName;
    }
1184800
@Override
    public void destroy() throws ResourceException {
        LOGGER.debug("Shutting down connection to repo '{0}'", mcf.getRepositoryURL());
        this.session.logout();
        this.handles.clear();
    }
194866
public void addCrudService(Class clazz, BundleContext bundleContext, JcrRepository repository) throws RepositoryException {
        jcrom.map(clazz);
        JcrCrudService<? extends Object> jcromCrudService;
        jcromCrudService = new JcrCrudService<>(repository, jcrom, clazz);
        crudServiceRegistrations.put(jcromCrudService, registerCrud(bundleContext, jcromCrudService));
    }
775076
public void removeLoggerRepositoryEventListener(
    final LoggerRepositoryEventListener listener) {
    synchronized (repositoryEventListeners) {
      if (!repositoryEventListeners.contains(listener)) {
        LogLog.warn(
          "Ignoring attempt to remove a "
                  + "non-registered LoggerRepositoryEventListener.");
      } else {
        repositoryEventListeners.remove(listener);
      }
    }
  }
474322
private void removeMemberships(Node groupNode, boolean broadcast) throws RepositoryException
   {
      NodeIterator refUsers = groupNode.getNode(JCROrganizationServiceImpl.JOS_MEMBERSHIP).getNodes();
      while (refUsers.hasNext())
      {
         refUsers.nextNode().remove();
      }
   }
174630
@Override
    public void removeClass(JavaClass javaClass) {
        nameToClassMap.remove(javaClass.getClassName());
        if (DEBUG) {
            System.out.println("Removing class " + javaClass.getClassName() + " from Repository");
            dumpStack();
        }
    }
544891
public void deleteProduct(final String name) {
        final DbProduct dbProduct = getProduct(name);
        repositoryHandler.deleteProduct(dbProduct.getName());
    }
364414
public boolean removeEntityListener(String repoFullName, EntityListener entityListener) {
    lock.writeLock().lock();
    try {
      verifyRepoRegistered(repoFullName);
      SetMultimap<Object, EntityListener> entityListeners =
          this.entityListenersByRepo.get(repoFullName);
      if (entityListeners.containsKey(entityListener.getEntityId())) {
        entityListeners.remove(entityListener.getEntityId(), entityListener);
        return true;
      }
      return false;
    } finally {
      lock.writeLock().unlock();
    }
  }
386452
@Delete("/projects/{projectName}/repos/{repoName}")
    @RequiresRole(roles = ProjectRole.OWNER)
    public CompletableFuture<Void> removeRepository(ServiceRequestContext ctx,
                                                    @Param("repoName") String repoName,
                                                    Repository repository,
                                                    Author author) {
        if (Project.isReservedRepoName(repoName)) {
            return HttpApiUtil.throwResponse(ctx, HttpStatus.FORBIDDEN,
                                             "A reserved repository cannot be removed.");
        }
        return execute(Command.removeRepository(author, repository.parent().name(), repository.name()))
                .thenCompose(unused -> mds.removeRepo(author, repository.parent().name(), repository.name()))
                .handle(HttpApiUtil::throwUnsafelyIfNonNull);
    }
1315571
protected ManageableRepository getWorkingRepository() throws RepositoryException, RepositoryConfigurationException
   {
      return repositoryName != null ? repositoryService.getRepository(repositoryName) : repositoryService
         .getCurrentRepository();
   }
774793
public function setCustomRepositoryClassName($repositoryClassName)
    {
        $this->customRepositoryClassName = $this->fullyQualifiedClassName($repositoryClassName);
        if ($this->customRepositoryClassName && !class_exists($this->customRepositoryClassName)) {
            throw MappingException::repositoryNotExisting($this->name, $this->customRepositoryClassName);
        }
    }
1159972
@RequestMapping(value = "/{name}", method = RequestMethod.DELETE)
	@ResponseStatus(HttpStatus.OK)
	protected void delete(@PathVariable("name") String name) {
		FieldValueCounter counter = repository.findOne(name);
		if (counter == null) {
			throw new NoSuchMetricException(name);
		}
		repository.reset(name);
	}