Examples of HttpHeader


Examples of org.sentinel.servers.http.protocol.HTTPHeader

    @Test
    public void testGet()
    {
        try {
            HTTPHeaders headers = new HTTPHeaders();
            headers.add(new HTTPHeader("key", "value"));
            assertEquals("value", headers.get("key").getValue());
        }
        catch(NoSuchHTTPHeaderException ex) {
            fail(ex.getMessage());
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.dav.http.HTTPHeader

    public SVNLock doLock(String path, DAVRepository repos, String comment, boolean force, long revision) throws SVNException {
        DAVBaselineInfo info = DAVUtil.getBaselineInfo(this, repos, path, -1, false, true, null);

        StringBuffer body = DAVLockHandler.generateSetLockRequest(null, comment);
        HTTPHeader header = new HTTPHeader();
        header.setHeaderValue(HTTPHeader.DEPTH_HEADER, "0");
        header.setHeaderValue(HTTPHeader.TIMEOUT_HEADER, "Infinite");
        header.setHeaderValue(HTTPHeader.CONTENT_TYPE_HEADER, "text/xml; charset=\"utf-8\"");

        if (revision >= 0) {
            header.setHeaderValue(HTTPHeader.SVN_VERSION_NAME_HEADER, Long.toString(revision));
        }
        if (force) {
            header.setHeaderValue(HTTPHeader.SVN_OPTIONS_HEADER, "lock-steal");
        }
        DAVLockHandler handler = new DAVLockHandler();
        SVNErrorMessage context = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "Lock request failed");
        IHTTPConnection httpConnection = getConnection();
        HTTPStatus status = httpConnection.request("LOCK", path, header, body, -1, 0, null, handler, context);
View Full Code Here

Examples of rabbit.http.HttpHeader

             HttpHeader header,
             Connection.RequestHandler rh) {
  CacheEntry entry = rh.entry;
  if (entry == null)
      return null;
  HttpHeader oldresp = rh.dataHook;
  HttpHeader expfail = checkExpectations (con, header, oldresp);
  if (expfail != null)
      return expfail;
  String im = header.getHeader ("If-Match");
  if (im == null)
      return null;
View Full Code Here

Examples of rabbit.http.HttpHeader

    public boolean checkCachedEntry (Connection con,
             HttpHeader header,
             Connection.RequestHandler rh) {
  con.getCounter ().inc ("Cache hits");
  con.setKeepalive (true);
  HttpHeader resp = checkIfMatch (con, header, rh);
  if (resp == null) {
      NotModifiedHandler nmh = new NotModifiedHandler ();
      resp = nmh.is304 (header, con, rh);
  }
  if (resp != null) {
View Full Code Here

Examples of rabbit.http.HttpHeader

      int port2 = u2.getPort ();
      if (port2 == -1)
    port2 = 80;
      if (port1 != port2)
    return;
      HttpHeader h = new HttpHeader ();
      h.setRequestURI (u2.toString ());
      cache.remove (h);
  } catch (MalformedURLException e) {
      logger.logWarn ("removeCaches got bad url: " +
          request.getRequestURI () + ", " +
          loc + ": " + e);
View Full Code Here

Examples of rabbit.http.HttpHeader

  if (buffer.remaining () > 4 && !matchBuffer (HTTP_IDENTIFIER)) {
      Logger log = getLogger ();
      log.logWarn ("http response header with odd start:" +
       getBufferStartString (5));
      header = new HttpHeader ();
      header.setStatusLine ("HTTP/1.1 200 OK");
      header.setHeader ("Connection", "close");
      return true;
  }
View Full Code Here

Examples of rabbit.http.HttpHeader

      headerRead = header != null;
      return;
  }

  if (header == null) {
      header = new HttpHeader ();
      header.setRequestLine (line);
      headerRead = false;
      return;
  }
View Full Code Here

Examples of rabbit.http.HttpHeader

     * @return null if all is ok, a HttpHeader if this request is blocked.
     */
    public HttpHeader filterHttpIn (Connection con,
            SocketChannel channel, HttpHeader in) {
  for (HttpFilter hf : httpInFilters) {
      HttpHeader badresponse =
    hf.doHttpInFiltering (channel, in, con);
      if (badresponse != null)
    return badresponse;     
  }
  return null;
View Full Code Here

Examples of rabbit.http.HttpHeader

     * @return null if all is ok, a HttpHeader if this request is blocked.
     */
    public HttpHeader filterHttpOut (Connection con,
            SocketChannel channel, HttpHeader in) {
  for (HttpFilter hf : httpOutFilters) {
      HttpHeader badresponse =
    hf.doHttpOutFiltering (channel, in, con);
      if (badresponse != null)
    return badresponse;     
  }
  return null;
View Full Code Here

Examples of rabbit.http.HttpHeader

    if (allowMeta) {
        String metaStart = "http://" +
      con.getProxy ().getHost ().getHostName () + ":" +
      con.getProxy ().getPort () + "/";
        if (!s.startsWith (metaStart)) {
      HttpHeader ret = con.getHttpGenerator ().get403 ();
      return ret;
        }
    }
      }
  }
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.