Remove ShrinkWrap deployment
@param deployment The deployment
@exception IOException Thrown if the deployment cant be removed
170629
private void removeDeployment(File deployment) throws IOException
   {
      if (deployment == null)
         throw new IllegalArgumentException("Deployment is null");

      if (deployment.exists() || (shrinkwrapDeployments != null && shrinkwrapDeployments.contains(deployment)))
      {
         shrinkwrapDeployments.remove(deployment);

         if (shrinkwrapDeployments.isEmpty())
            shrinkwrapDeployments = null;

         recursiveDelete(deployment);
      }
   }
945651
protected void writeDeployments(List<DeploymentReport> deploymentReports) throws IOException {

        for (DeploymentReport deploymentReport : deploymentReports) {

            writer.append("[cols=\"3*\", options=\"header\"]").append(NEW_LINE);
            writer.append(".").append(this.resourceBundle.getString("asciidoc.reporter.deployment")).append(NEW_LINE);
            writer.append("|===").append(NEW_LINE).append(NEW_LINE);

            writer.append("|NAME").append(NEW_LINE);
            writer.append("|ARCHIVE").append(NEW_LINE);
            writer.append("|ORDER").append(NEW_LINE).append(NEW_LINE);

            writer.append("|").append(deploymentReport.getName()).append(NEW_LINE);
            writer.append("|").append(deploymentReport.getArchiveName()).append(NEW_LINE);
            writer.append("|").append(Integer.toString(deploymentReport.getOrder())).append(NEW_LINE).append(NEW_LINE);

            writer.append("|===").append(NEW_LINE).append(NEW_LINE);

            if (!"_DEFAULT_".equals(deploymentReport.getProtocol())) {
                writer.append("NOTE: ").append(deploymentReport.getProtocol()).append(NEW_LINE).append(NEW_LINE);
            }

        }

    }
1251515
@Override
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();

        if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) {
            return;
        }

        final Map<String, ComponentDescription> componentByClass = new HashMap<String, ComponentDescription>();
        final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
        final EEApplicationClasses applicationClassesDescription = deploymentUnit
                .getAttachment(Attachments.EE_APPLICATION_CLASSES_DESCRIPTION);
        final CompositeIndex compositeIndex = deploymentUnit
                .getAttachment(org.jboss.as.server.deployment.Attachments.COMPOSITE_ANNOTATION_INDEX);
        if (moduleDescription == null) {
            return; // not an ee deployment
        }
        for (ComponentDescription component : moduleDescription.getComponentDescriptions()) {
            componentByClass.put(component.getComponentClassName(), component);
        }

        final SipMetaData sipMetaData = deploymentUnit.getAttachment(SipMetaData.ATTACHMENT_KEY);
        final SipAnnotationMetaData sipAnnotationMetaData = deploymentUnit.getAttachment(SipAnnotationMetaData.ATTACHMENT_KEY);
        if (sipMetaData == null && sipAnnotationMetaData == null) {
            // not a sip deployment
            return;
        }
        final Set<String> classes = getAllComponentClasses(deploymentUnit, compositeIndex, sipMetaData, sipAnnotationMetaData);
        for (String clazz : classes) {
            if (clazz == null || clazz.trim().isEmpty()) {
                continue;
            }
            ComponentDescription description = componentByClass.get(clazz);
            if (description != null) {
                // //for now just make sure it has a single view
                // //this will generally be a managed bean, but it could also be an EJB
                // //TODO: make sure the component is a managed bean
                // if (!(description.getViews().size() == 1)) {
                // throw MESSAGES.wrongComponentType(clazz);
                // }
                // ManagedBeanComponentInstantiator instantiator = new ManagedBeanComponentInstantiator(deploymentUnit,
                // description);
                // webComponents.put(clazz, instantiator);
            } else {
                description = new WebComponentDescription(clazz, clazz, moduleDescription, deploymentUnit.getServiceName(),
                        applicationClassesDescription);
                moduleDescription.addComponent(description);
                deploymentUnit.addToAttachmentList(WebComponentDescription.WEB_COMPONENTS, description.getStartServiceName());
            }
        }
        // deploymentUnit.putAttachment(WebAttachments.WEB_COMPONENT_INSTANTIATORS, webComponents);
    }
1206726
@Override
  public void shutdown(DeployService2Impl<I> deploy,
                       ShutdownModeAmp mode,
                       Result<Boolean> result)
  {
    deploy.shutdownImpl(mode, result);
  }
944196
@Override
    public void deleteUnpackedWAR(StandardContext standardContext)
    {
        File unpackDir = new File(standardHost.getAppBase(), standardContext.getPath().substring(1));
        if (unpackDir.exists())
        {
            ExpandWar.deleteDir(unpackDir);
        }
    }
866689
static void fullyDelete(String dir, Configuration conf) throws IOException {
    if (dir != null) {
      Path tmp = new Path(dir);
      tmp.getFileSystem(conf).delete(tmp, true);
    }
  }
366707
public void deleteProject(Serializable projectId) throws IOException {
        String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId);
        retrieve().method(DELETE).to(tailUrl, null);
    }
351966
public void removeServer(InternalInstrumented<ServerStats> server) {
    remove(servers, server);
    ServerSocketMap prev = perServerSockets.remove(id(server));
    assert prev != null;
    assert prev.isEmpty();
  }
1258908
public synchronized void resumeDeployment(final String deployment) {
        for (ControlPoint ep : entryPoints.values()) {
            if (ep.getDeployment().equals(deployment)) {
                ep.resume();
            }
        }
    }
837263
public void remove(Object data, int iOpenMode) throws DBException, RemoteException
    {
        if (m_objCurrentKey == null)
            throw new DBException(Constants.INVALID_RECORD);
        m_mDataMap.remove(m_objCurrentKey);
        if (m_iCurrentRecord != -1)
            m_iCurrentRecord--;     // This will keep the sequential read correct.
        m_iterator = null;
    }
168638
public final void removeServlet(String mountPoint) {
        mountPoint = GenericContext.normalizeMountPoint(mountPoint);
        synchronized (servlets) {
            ServletDescriptor remove = servlets.remove(mountPoint);
            if (remove != null) {
                unregisterServletDescriptor(remove);
            }
        }

    }
509684
async function deleteDeploymentFolder() {
  del.sync(deploymentTmpFolder, { force: true });
  del.sync(deploymentFolder, { force: true });
}
982390
public static void deleteSilentlyRecursively(final Path path) {
        if (path != null) {
            try {
                deleteRecursively(path);
            } catch (IOException ioex) {
                DeploymentRepositoryLogger.ROOT_LOGGER.cannotDeleteFile(ioex, path);
            }
        }
    }
758810
private synchronized void doNodeLeft(final String nodeID) {
    log.info(String.format("%s - %s left the cluster", this, nodeID));
    context.run(new Runnable() {
      @Override
      public void run() {
        // Redeploy any failed deployments.
        synchronized (deployments) {
          Collection<String> sdeploymentsInfo = deployments.get(group);
          for (final String sdeploymentInfo : sdeploymentsInfo) {
            final JsonObject deploymentInfo = new JsonObject(sdeploymentInfo);
            // If the deployment node is equal to the node that left the cluster then
            // remove the deployment from the deployments list and attempt to redeploy it.
            if (deploymentInfo.getString("node").equals(nodeID)) {
              // If the deployment is an HA deployment then attempt to redeploy it on this node.
              if (deployments.remove(group, sdeploymentInfo) && deploymentInfo.getBoolean("ha", false)) {
                doRedeploy(deploymentInfo);
              }
            }
          }
        }
      }
    });
  }
437279
@RequirePOST
    public synchronized void doDoDelete(StaplerResponse rsp) throws IOException, ServletException {
        getConfigFile().delete();
        getParent().logRecorders.remove(name);
        // Disable logging for all our targets,
        // then reenable all other loggers in case any also log the same targets
        for (Target t : targets)
            t.disable();
        for (LogRecorder log : getParent().logRecorders.values())
            for (Target t : log.targets)
                t.enable();
        rsp.sendRedirect2("..");
    }
578653
@Given("^I destroy service '(.+?)' in cluster '(.+?)'")
    public void destroyService(String service, String cluster) throws Exception {
        String endPoint = "/service/deploy-api/deploy/uninstall?app=" + service;
        Future response;

        this.commonspec.setRestProtocol("https://");
        this.commonspec.setRestHost(cluster);
        this.commonspec.setRestPort(":443");

        response = this.commonspec.generateRequest("DELETE", true, null, null, endPoint, null, "json");

        this.commonspec.setResponse("DELETE", (Response) response.get());
        assertThat(this.commonspec.getResponse().getStatusCode()).as("It hasn't been possible to destroy service: " + service).isIn(Arrays.asList(200, 202));
    }
991800
def delete_deployment_group(self, project, deployment_group_id):
        
        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url('project', project, 'str')
        if deployment_group_id is not None:
            route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int')
        self._send(http_method='DELETE',
                   location_id='083c4d89-ab35-45af-aa11-7cf66895c53e',
                   version='5.0-preview.1',
                   route_values=route_values)