Deletes a resource.<p>

@param resourcePath the path of the resource to delete
508163
protected void internalDeleteResource(final String resourcePath) {

        CmsRpcAction<Void> action = new CmsRpcAction<Void>() {

            @Override
            public void execute() {

                start(0, false);
                getGalleryService().deleteResource(resourcePath, this);
            }

            @Override
            protected void onResponse(Void result) {

                stop(false);
                updateResultsTab(false);
            }
        };
        action.execute();
    }
1056579
private void deleteResource(CmsResource resource) throws CmsException {

        String path = null;
        CmsObject cms = getCmsObject();
        try {
            path = cms.getSitePath(resource);
            cms.lockResource(path);
            cms.deleteResource(path, CmsResource.DELETE_PRESERVE_SIBLINGS);
            // check if any detail container page resources exist to this resource
            List<CmsResource> detailContainers = CmsDetailOnlyContainerUtil.getDetailOnlyResources(cms, resource);
            for (CmsResource detailContainer : detailContainers) {
                deleteResource(detailContainer);
            }
        } finally {
            try {
                if (path != null) {
                    getCmsObject().unlockResource(path);
                }
            } catch (Exception e) {
                // should really never happen
                LOG.debug(e.getLocalizedMessage(), e);
            }
        }
    }
248097
private boolean isDeletedResource(String path, boolean rootPath) {

        CmsObject cms = getCmsObject();
        CmsResource res = null;
        try {
            if (rootPath) {
                String origSiteRoot = cms.getRequestContext().getSiteRoot();
                try {
                    cms.getRequestContext().setSiteRoot("");
                    res = cms.readResource(path, CmsResourceFilter.ALL);

                } finally {
                    cms.getRequestContext().setSiteRoot(origSiteRoot);
                }
            } else {
                res = cms.readResource(path, CmsResourceFilter.ALL);
            }
        } catch (CmsException e) {
            // ignore
        }
        return (res != null) && res.getState().isDeleted();
    }
41417
public static boolean delete(Path targetPath) {
        debug(log, "delete", targetPath);
        try {
            Files.delete(targetPath);
            return true;
        } catch (Exception e) {
            return JMExceptionManager.handleExceptionAndReturnFalse(log, e,
                    "delete", targetPath);
        }
    }
1360664
public void unsubscribeResourceForAll(CmsObject cms, String resourcePath) throws CmsException {

        CmsResource resource = cms.readResource(resourcePath, CmsResourceFilter.ALL);
        unsubscribeResourceForAll(cms, resource);
    }
368024
public boolean removeResourceBundle(final ResourceBundle resourceBundle) {
        Objects.requireNonNull(resourceBundle, "resourceBundle should not be null.");
        
        if(!messageBundles.contains(resourceBundle)) {
            return false;
        }
        
        messageBundles.remove(resourceBundle);
        return true;
    }
347771
public void setResourceId(String resourceId) {

        try {
            if (!m_resourceBuilder.isFolder()) {
                m_resourceBuilder.setResourceId(new CmsUUID(resourceId));
            } else {
                m_resourceBuilder.setResourceId(new CmsUUID());
            }
        } catch (Throwable e) {
            setThrowable(e);
        }
    }
245713
protected void performSingleDeleteOperation(String resource, CmsResourceDeleteMode deleteOption)
    throws CmsException {

        // lock resource if autolock is enabled
        checkLock(resource);
        // delete the resource
        getCms().deleteResource(resource, deleteOption);
    }
152228
private void deleteSourceClassesFolder(String targetModulePath, String sourcePathPart, String targetPathPart)
    throws CmsException {

        String sourceFirstFolder = sourcePathPart.substring(0, sourcePathPart.indexOf('/'));
        String targetFirstFolder = sourcePathPart.substring(0, sourcePathPart.indexOf('/'));
        if (!sourceFirstFolder.equals(targetFirstFolder)) {
            getCms().deleteResource(
                targetModulePath + PATH_CLASSES + sourceFirstFolder,
                CmsResource.DELETE_PRESERVE_SIBLINGS);
            return;
        }
        String[] targetPathParts = CmsStringUtil.splitAsArray(targetPathPart, '/');
        String[] sourcePathParts = CmsStringUtil.splitAsArray(sourcePathPart, '/');
        int sourceLength = sourcePathParts.length;
        int diff = 0;
        for (int i = 0; i < targetPathParts.length; i++) {
            if (sourceLength >= i) {
                if (!targetPathParts[i].equals(sourcePathParts[i])) {
                    diff = i + 1;
                }
            }
        }
        String topSourceClassesPath = targetModulePath
            + PATH_CLASSES
            + sourcePathPart.substring(0, sourcePathPart.indexOf('/'))
            + "/";

        if (diff != 0) {
            topSourceClassesPath = targetModulePath + PATH_CLASSES;
            for (int i = 0; i < diff; i++) {
                topSourceClassesPath += sourcePathParts[i] + "/";
            }
        }
        getCms().deleteResource(topSourceClassesPath, CmsResource.DELETE_PRESERVE_SIBLINGS);
    }
280116
public static void destroy(final Resource... resources)
  {
    for (Resource r : resources) {
      if (r != null) {
        r.destroy();
      }
    }
  }
1253792
public boolean revokeResourcePermission(String subjectid, String resourcePath) {
		if (!StringUtils.isBlank(subjectid) && getResourcePermissions().containsKey(subjectid) &&
				!StringUtils.isBlank(resourcePath)) {
			// urlDecode resource path
			resourcePath = Utils.urlDecode(resourcePath);
			getResourcePermissions().get(subjectid).remove(resourcePath);
			if (getResourcePermissions().get(subjectid).isEmpty()) {
				getResourcePermissions().remove(subjectid);
			}
			return true;
		}
		return false;
	}
762113
public void deletePath(final Path path, final boolean recursive) {
    this.futures.add(new NamedFuture(this.executor.submit(new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        Lock lock = ParallelRunner.this.locks.get(path.toString());
        lock.lock();
        try {
          HadoopUtils.deletePath(ParallelRunner.this.fs, path, recursive);
          return null;
        } finally {
          lock.unlock();
        }
      }
    }), "Delete path " + path));
  }
1152117
public static void delete(String path) throws IOException {
    if (!Files.deleteIfExists(Paths.get(path))) {
      throw new IOException("Failed to delete " + path);
    }
  }
433963
public void addResourceActionBinding(final String actionPath, final String resourcePath) {
		this.addActionBinding(new ActionBinding() {
			public boolean supports(ActionContext actionContext) {
				return actionContext.getPath().equals(actionPath);
			}

			public Action create(ActionContext actionContext) {
				return new ResourceAction(actionContext, resourcePath);
			}
		});
	}
933519
@Override
    public Node delete(String archivePath) {
        Validate.notNull(archivePath, "No path was specified");
        return delete(ArchivePaths.create(archivePath));
    }
30325
public void deletePath(String path) {
        if (path == null) {
            return;
        }
        String[] pathComponents = path.split("/");
        TrieNode parent = rootNode;
        String part = null;
        if (pathComponents.length <= 1) {
            throw new IllegalArgumentException("Invalid path " + path);
        }
        for (int i=1; i<pathComponents.length; i++) {
            part = pathComponents[i];
            if (parent.getChild(part) == null) {
                //the path does not exist
                return;
            }
            parent = parent.getChild(part);
            LOG.info(parent);
        }
        TrieNode realParent  = parent.getParent();
        realParent.deleteChild(part);
    }
119267
public void setResourceId(String resourceId) {

        try {
            if (!m_type.isFolder()) {
                m_resourceId = new CmsUUID(resourceId);
            } else {
                m_resourceId = new CmsUUID();
            }
        } catch (Throwable e) {
            setThrowable(e);
        }
    }