Examples of addHeader()


Examples of org.apache.commons.httpclient.HeaderGroup.addHeader()

                  responseBuf.append( m_httpVersion );
                  responseBuf.append( " " );
                  responseBuf.append( m_httpStatus );
                  responseBuf.append( "\r\n" );
                  HeaderGroup headerGroup = new HeaderGroup(  );
                  headerGroup.addHeader( new Header( "Date",
                                                     HTTP_DATE_FORMAT.format( timeNow ) ) );
                  headerGroup.addHeader( new Header( "Server", m_httpServerName ) );
                  headerGroup.addHeader( new Header( "Cache-Control", "max-age=86400" ) );
                  headerGroup.addHeader( new Header( "Expires",
                                                     HTTP_DATE_FORMAT.format( sameTimeTomorrow ) ) );
View Full Code Here

Examples of org.apache.commons.httpclient.server.SimpleResponse.addHeader()

                if (ver.equals(HttpVersion.HTTP_1_0)) {
                    return false;
                } else {
                    SimpleResponse response = new SimpleResponse();
                    response.setStatusLine(ver, HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED);
                    response.addHeader(new Header("Proxy-Connection", "close"));
                    conn.setKeepAlive(false);
                    // Make sure the request body is fully consumed
                    request.getBodyBytes();
                    conn.writeResponse(response);
                    return true;
View Full Code Here

Examples of org.apache.commons.mail.Email.addHeader()

            email.setSubject(subject);
            email.updateContentType(TEXT_HTML);

            if (headers != null) {
                for (String key : headers.keySet()) {
                    email.addHeader(key, headers.get(key));
                }
            }
            // reset the infomap
            infos.remove();
            return Mail.send(email);
View Full Code Here

Examples of org.apache.commons.mail.HtmlEmail.addHeader()

            email.setSubject(String.format("[%s] @%s wants to transfer project", pt.project.name, pt.sender.loginId));
            email.setHtmlMsg(Markdown.render(message));
            email.setTextMsg(message);
            email.setCharset("utf-8");
            email.addHeader("References", "<" + acceptUrl + "@" + Config.getHostname() + ">");
            email.setSentDate(pt.requested);
            Mailer.send(email);
            String escapedTitle = email.getSubject().replace("\"", "\\\"");
            String logEntry = String.format("\"%s\" %s", escapedTitle, email.getBccAddresses());
            play.Logger.of("mail").info(logEntry);
View Full Code Here

Examples of org.apache.commons.mail.SimpleEmail.addHeader()

         * Set headers for proper threading: GMail will not group messages, even if they have same subject, but don't have "In-Reply-To" and
         * "References" headers. TODO investigate threading in other clients like KMail, Thunderbird, Outlook
         */
        if (StringUtils.isNotEmpty(emailMessage.getMessageId())) {
          String messageId = "<" + emailMessage.getMessageId() + "@" + host + ">";
          email.addHeader(IN_REPLY_TO_HEADER, messageId);
          email.addHeader(REFERENCES_HEADER, messageId);
        }
        // Set headers for proper filtering
        email.addHeader(LIST_ID_HEADER, "SonarQube <sonar." + host + ">");
        email.addHeader(LIST_ARCHIVE_HEADER, configuration.getServerBaseURL());
View Full Code Here

Examples of org.apache.coyote.tomcat5.CoyoteResponse.addHeader()

        CoyoteResponse response = (CoyoteResponse) getResponse();
        // Assert response!=null
        if (response != null) {
            String[] cacheControls = ((PwcWebModule) ctx).getCacheControls();
            for (int i=0; cacheControls!=null && i<cacheControls.length; i++) {
                response.addHeader("Cache-Control", cacheControls[i]);
            }
        }

        sunWebXmlChecked = false;
    }
View Full Code Here

Examples of org.apache.cxf.ws.security.policy.model.SignedEncryptedParts.addHeader()

                   
                    SignedEncryptedParts parts = new SignedEncryptedParts(true,
                                                                          SP12Constants.INSTANCE);
                    parts.setBody(true);
                    if (addNs != null) {
                        parts.addHeader(new Header("To", addNs));
                        parts.addHeader(new Header("From", addNs));
                        parts.addHeader(new Header("FaultTo", addNs));
                        parts.addHeader(new Header("ReplyTO", addNs));
                        parts.addHeader(new Header("MessageID", addNs));
                        parts.addHeader(new Header("RelatesTo", addNs));
View Full Code Here

Examples of org.apache.geronimo.messaging.MsgHeader.addHeader()

     *
     * @param aMsg Msg to process.
     */
    public void push(Msg aMsg) {
        MsgHeader header = aMsg.getHeader();
        header.addHeader(key, value);
        next.push(aMsg);
    }

}
View Full Code Here

Examples of org.apache.hadoop.hbase.rest.filter.GZIPResponseWrapper.addHeader()

    HttpServletResponse response = mock(HttpServletResponse.class);

    GZIPResponseWrapper test = new GZIPResponseWrapper(response);
    test.setStatus(200);
    verify(response).setStatus(200);
    test.addHeader("header", "header value");
    verify(response).addHeader("header", "header value");
    test.addHeader("content-length", "header value2");
    verify(response, never()).addHeader("content-length", "header value");

    test.setIntHeader("header", 5);
View Full Code Here

Examples of org.apache.http.HttpEntityEnclosingRequest.addHeader()

  @Test
  public void testParseRequestHttpRequest() throws Exception {
    HttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST", "/test.html");
    request.setEntity(new StringEntity(""));
    String CONTENT_TYPE = "multipart/form-data; boundary=---1234";
    request.addHeader(HTTP.CONTENT_TYPE, CONTENT_TYPE);
    upload.parseRequest(request);
  }

  @Test
  public void testParseRequestRequestContext() throws Exception {
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.