Package org.jboss.netty.handler.codec.http

Examples of org.jboss.netty.handler.codec.http.QueryStringDecoder


      if (request.getMethod() != GET) {
          sendError(ctx, METHOD_NOT_ALLOWED);
          return;
      }
      final Map<String,List<String>> q =
        new QueryStringDecoder(request.getUri()).getParameters();
      final List<String> mapIds = splitMaps(q.get("map"));
      final List<String> reduceQ = q.get("reduce");
      final List<String> jobQ = q.get("job");
      if (LOG.isDebugEnabled()) {
        LOG.debug("RECV: " + request.getUri() +
View Full Code Here


      if (request.getMethod() != GET) {
          sendError(ctx, METHOD_NOT_ALLOWED);
          return;
      }
      final Map<String,List<String>> q =
        new QueryStringDecoder(request.getUri()).getParameters();
      final List<String> mapIds = splitMaps(q.get("map"));
      final List<String> reduceQ = q.get("reduce");
      final List<String> jobQ = q.get("job");
      if (LOG.isDebugEnabled()) {
        LOG.debug("RECV: " + request.getUri() +
View Full Code Here

          || !ShuffleHeader.DEFAULT_HTTP_HEADER_VERSION.equals(
              request.getHeader(ShuffleHeader.HTTP_HEADER_VERSION))) {
        sendError(ctx, "Incompatible shuffle request version", BAD_REQUEST);
      }
      final Map<String,List<String>> q =
        new QueryStringDecoder(request.getUri()).getParameters();
      final List<String> mapIds = splitMaps(q.get("map"));
      final List<String> reduceQ = q.get("reduce");
      final List<String> jobQ = q.get("job");
      if (LOG.isDebugEnabled()) {
        LOG.debug("RECV: " + request.getUri() +
View Full Code Here

          || !ShuffleHeader.DEFAULT_HTTP_HEADER_VERSION.equals(
              request.getHeader(ShuffleHeader.HTTP_HEADER_VERSION))) {
        sendError(ctx, "Incompatible shuffle request version", BAD_REQUEST);
      }
      final Map<String,List<String>> q =
        new QueryStringDecoder(request.getUri()).getParameters();
      final List<String> mapIds = splitMaps(q.get("map"));
      final List<String> reduceQ = q.get("reduce");
      final List<String> jobQ = q.get("job");
      if (LOG.isDebugEnabled()) {
        LOG.debug("RECV: " + request.getUri() +
View Full Code Here

          || !ShuffleHeader.DEFAULT_HTTP_HEADER_VERSION.equals(
              request.getHeader(ShuffleHeader.HTTP_HEADER_VERSION))) {
        sendError(ctx, "Incompatible shuffle request version", BAD_REQUEST);
      }
      final Map<String,List<String>> q =
        new QueryStringDecoder(request.getUri()).getParameters();
      final List<String> mapIds = splitMaps(q.get("map"));
      final List<String> reduceQ = q.get("reduce");
      final List<String> jobQ = q.get("job");
      if (LOG.isDebugEnabled()) {
        LOG.debug("RECV: " + request.getUri() +
View Full Code Here

    if (this.request != null) {
      // extract any encoded session in url
      this.parseEncodedSessionId();
      // http get
      this.parameters = new HashMap<String, List<String>>();
      QueryStringDecoder qsd = new QueryStringDecoder(this.getURL());
      Map<String, List<String>> qsdParameters = qsd.getParameters();
      if (qsdParameters != null) {
        this.parameters.putAll(qsdParameters);
      }
      // http post
      ChannelBuffer content = request.getContent();
      if (content.readable()) {
        String charsetName = Constants.SC_CHARACTER_SET;
        if (request.containsHeader(HttpHeaders.Names.ACCEPT_CHARSET)) {
          String contentType = request.getHeader(HttpHeaders.Names.ACCEPT_CHARSET);
          charsetName = contentType.indexOf("charset=") > -1 ? contentType.substring(contentType.indexOf("charset=") + 8)
              : charsetName;
        }
        Charset charset = null;
        try {
          charset = Charset.forName(charsetName);
        } catch (Exception e) {
          charset = Charset.forName(Constants.SC_CHARACTER_SET);
          LOGGER.error("invalid charset name = " + charsetName, e);
        }
        String param = content.toString(charset);
        QueryStringDecoder queryStringDecoder = new QueryStringDecoder("/?" + param);
        Map<String, List<String>> postParams = queryStringDecoder.getParameters();
        this.parameters.putAll(postParams);
      }
    }
  }
View Full Code Here

            uri.contains("." + File.separator) ||
            uri.startsWith(".") || uri.endsWith(".")) {
            return null;
        }

        QueryStringDecoder decoder = new QueryStringDecoder(uri);
        uri = decoder.getPath();

        if (uri.endsWith("/")) {
            uri += "index.html";
        }
View Full Code Here

            uri.contains("." + File.separator) ||
            uri.startsWith(".") || uri.endsWith(".")) {
            return null;
        }

        QueryStringDecoder decoder = new QueryStringDecoder(uri);
        uri = decoder.getPath();

        if (uri.endsWith("/")) {
            uri += "index.html";
        }
View Full Code Here

            if(req.getMethod() == GET) {
                client.heartbeat();
                client.Reconnect(ctx, req);
            } else {
                //we got a message
                QueryStringDecoder decoder = new QueryStringDecoder("/?" + req.getContent().toString(CharsetUtil.UTF_8));
                String message = decoder.getParameters().get("data").get(0);
                handleMessage(client, message);

                //make sure the connection is closed once we send a response
                setKeepAlive(req, false);
View Full Code Here

            for (Cookie cookie: cookies) {
                responseContent.append("COOKIE: " + cookie.toString() + "\r\n");
            }
            responseContent.append("\r\n\r\n");

            QueryStringDecoder decoderQuery = new QueryStringDecoder(request
                    .getUri());
            Map<String, List<String>> uriAttributes = decoderQuery
                    .getParameters();
            for (Entry<String, List<String>> attr: uriAttributes.entrySet()) {
                for (String attrVal: attr.getValue()) {
                    responseContent.append("URI: " + attr.getKey() + '=' + attrVal + "\r\n");
                }
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.codec.http.QueryStringDecoder

Copyright © 2018 www.massapicom. 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.