/**
   * Delete any tmp storage for parts, and clear out the parts list.
   *
   * @throws MultiException
   */
  public void deleteParts() throws MultiException {
    Collection<Part> parts = getParsedParts();
    MultiException err = new MultiException();
    for (Part p : parts) {
      try {
        ((MultiPartInputStreamParser.MultiPart) p).cleanUp();
      } catch (Exception e) {
        err.add(e);
      }
    }
    _parts.clear();

    err.ifExceptionThrowMulti();
  }
  /**
   * @throws GridException If failed.
   * @return {@code True} if Jetty started.
   */
  @SuppressWarnings("IfMayBeConditional")
  private boolean startJetty() throws GridException {
    try {
      httpSrv.start();

      if (httpSrv.isStarted()) {
        for (Connector con : httpSrv.getConnectors()) {
          int connPort = ((NetworkConnector) con).getPort();

          if (connPort > 0) ctx.ports().registerPort(connPort, TCP, getClass());
        }

        return true;
      }

      return false;
    } catch (SocketException ignore) {
      if (log.isDebugEnabled()) log.debug("Failed to bind HTTP server to configured port.");

      stopJetty();

      return false;
    } catch (MultiException e) {
      if (log.isDebugEnabled()) log.debug("Caught multi exception: " + e);

      for (Object obj : e.getThrowables())
        if (!(obj instanceof SocketException))
          throw new GridException("Failed to start Jetty HTTP server.", e);

      if (log.isDebugEnabled()) log.debug("Failed to bind HTTP server to configured port.");

      stopJetty();

      return false;
    } catch (Exception e) {
      throw new GridException("Failed to start Jetty HTTP server.", e);
    }
  }