Examples of addHeader()


Examples of io.vertx.core.eventbus.DeliveryOptions.addHeader()

  public void testDeliveryOptions() {
    DeliveryOptions options = new DeliveryOptions();

    assertIllegalArgumentException(() -> options.setSendTimeout(0));
    assertIllegalArgumentException(() -> options.setSendTimeout(-1));
    assertNullPointerException(() -> options.addHeader(null, ""));
    assertNullPointerException(() -> options.addHeader("", null));
  }

  @Test
  public void testArgumentValidation() throws Exception {
View Full Code Here

Examples of iqq.im.http.QQHttpRequest.addHeader()

    QQHttpRequest req = createHttpRequest("POST", QQConstants.URL_CHANNEL_LOGIN);
    req.addPostValue("r", json.toString());
    req.addPostValue("clientid", session.getClientId()+"");
    req.addPostValue("psessionid", session.getSessionId());
   
    req.addHeader("Referer", QQConstants.REFFER);
    return req;
  }

  /** {@inheritDoc} */
  @Override
 
View Full Code Here

Examples of javax.mail.BodyPart.addHeader()

                    messageBodyPart.setDataHandler(handler);

                    if (attachmentFilename.toLowerCase().startsWith("cid:")) {
                        // add a Content-ID header to the attachment
                        // must use angle brackets according to RFC: http://www.ietf.org/rfc/rfc2392.txt
                        messageBodyPart.addHeader("Content-ID", "<" + attachmentFilename.substring(4) + ">");
                        // Set the filename without the cid
                        messageBodyPart.setFileName(attachmentFilename.substring(4));
                    } else {
                        // Set the filename
                        messageBodyPart.setFileName(attachmentFilename);
View Full Code Here

Examples of javax.mail.Message.addHeader()

                Enumeration e = headers.keys();
                while (e.hasMoreElements())
                {
                    String name = (String) e.nextElement();
                    String value = (String) headers.get(name);
                    msg.addHeader(name, value);
                }
            }

            // Send the message.
            Transport.send(msg);
View Full Code Here

Examples of javax.mail.internet.InternetHeaders.addHeader()

   */
  private InternetHeaders parseHeaders(Enumeration pHeaders) {
    InternetHeaders retVal = new InternetHeaders();
    while (pHeaders.hasMoreElements()) {
      Header hdr = (Header) pHeaders.nextElement();
      retVal.addHeader(hdr.getName(), hdr.getValue());
    }

    return retVal;
  }

View Full Code Here

Examples of javax.mail.internet.MimeBodyPart.addHeader()

        mbp.setDataHandler(new DataHandler(new URLDataSource(url)));
        mbp.setFileName(name);
        mbp.setDisposition("inline");
        String cid = org.apache.turbine.util.GenerateUniqueId.getIdentifier();
        mbp.addHeader("Content-ID", cid);

        getHtmlContent().addBodyPart(mbp);
        return mbp.getContentID();
    }
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.addHeader()

     * @param value the header value
     */
    public void addHeader(String name, String value) {
        HttpServletResponse res = getServletResponse();
        if (res != null)
            res.addHeader(name, value);
    }

    /**
     * Proxy to HttpServletResponse.addDateHeader()
     * @param name the header name
View Full Code Here

Examples of javax.servlet.http.HttpServletResponseWrapper.addHeader()

       
        if (EnvConfig.getInstance().allowRecordBenchmark()) {
            log.info("\"" + requestPathKeyWithQueryString + "\" takes: " + (after - before) + " ms");
            if (EnvConfig.getInstance().allowRecordBenchmarkInHeader()) {
                HttpServletResponseWrapper resw = new HttpServletResponseWrapper((HttpServletResponse)response);
                resw.addHeader("Exec-Time", (after - before) + " ms");
            }
        }
       
        clearCachedRequestData();
    }
View Full Code Here

Examples of javax.servlet.sip.SipServletRequest.addHeader()

    {
      SipSession session = subscription.getSession();
      if (session.isValid())
      {
        SipServletRequest notify = session.createRequest(Constants.NOTIFY);
        notify.addHeader(Constants.EVENT, getName());
       
        String s = subscription.getState().getName();
        if (subscription.getState() == Subscription.State.ACTIVE
            || subscription.getState() == Subscription.State.PENDING)
          s = s + ";expires=" + ((subscription.getExpirationTime()-System.currentTimeMillis()) / 1000);
View Full Code Here

Examples of javax.servlet.sip.SipServletResponse.addHeader()

        || WatcherInfoEventPackage.NAME.equals(event))
      getServletContext().getNamedDispatcher("presence").forward(subscribe, null);
    else
    {
      SipServletResponse response = subscribe.createResponse(SipServletResponse.SC_BAD_EVENT);
      response.addHeader(Constants.ALLOW_EVENTS, RegEventPackage.NAME);
      response.addHeader(Constants.ALLOW_EVENTS, PresenceEventPackage.NAME);
      response.addHeader(Constants.ALLOW_EVENTS, WatcherInfoEventPackage.NAME);
      response.send();
      response.getApplicationSession().invalidate();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.