io.vertx.reactivex.core.MultiMap.names()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中io.vertx.reactivex.core.MultiMap.names()方法的一些代码示例,展示了MultiMap.names()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MultiMap.names()方法的具体详情如下:
包路径:io.vertx.reactivex.core.MultiMap
类名称:MultiMap
方法名:names

MultiMap.names介绍

暂无

代码示例

代码示例来源:origin: io.knotx/knotx-core

private String buildRepoUri(ClientRequest repoRequest) {
 StringBuilder uri = new StringBuilder(repoRequest.getPath());
 MultiMap params = repoRequest.getParams();
 if (params != null && params.names() != null && !params.names().isEmpty()) {
  uri.append("?")
    .append(params.names().stream()
      .map(name -> new StringBuilder(encode(name)).append("=")
        .append(encode(params.get(name))))
      .collect(Collectors.joining("&"))
    );
 }
 return uri.toString();
}

代码示例来源:origin: io.knotx/knotx-core

private void writeHeaders(HttpServerResponse response, MultiMap headers) {
 headers.names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       headers
         .getAll(name)
         .forEach(value -> response.putHeader(name, value))
   );
}

代码示例来源:origin: Cognifide/knotx

private void writeHeaders(HttpServerResponse response, MultiMap headers) {
 headers.names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       headers
         .getAll(name)
         .forEach(value -> response.putHeader(name, value))
   );
}

代码示例来源:origin: io.knotx/knotx-server

private void writeHeaders(HttpServerResponse response, MultiMap headers) {
 headers.names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       headers
         .getAll(name)
         .forEach(value -> response.putHeader(name, value))
   );
}

代码示例来源:origin: io.knotx/knotx-databridge-adapter-http

private MultiMap getFilteredHeaders(MultiMap headers, List<Pattern> allowedHeaders) {
 return headers.names().stream()
   .filter(AllowedHeadersFilter.create(allowedHeaders))
   .collect(MultiMapCollector.toMultiMap(o -> o, headers::getAll));
}

代码示例来源:origin: io.knotx.acme/acme-forms-adapter-http

private MultiMap getFilteredHeaders(MultiMap headers, List<Pattern> allowedHeaders) {
 return headers.names().stream()
   .filter(AllowedHeadersFilter.create(allowedHeaders))
   .collect(MultiMapCollector.toMultiMap(o -> o, headers::getAll));
}

代码示例来源:origin: Cognifide/knotx

private MultiMap getFilteredHeaders(MultiMap headers, List<Pattern> allowedHeaders) {
 return headers.names().stream()
   .filter(AllowedHeadersFilter.create(allowedHeaders))
   .collect(MultiMapCollector.toMultiMap(o -> o, headers::getAll));
}

代码示例来源:origin: io.knotx/knotx-core

private MultiMap filteredHeaders(MultiMap headers) {
 return headers.names().stream()
   .filter(AllowedHeadersFilter.create(configuration.getAllowedRequestHeadersPatterns()))
   .collect(MultiMapCollector.toMultiMap(o -> o, headers::getAll));
}

代码示例来源:origin: Cognifide/knotx

private MultiMap filteredHeaders(MultiMap headers) {
 return headers.names().stream()
   .filter(AllowedHeadersFilter.create(configuration.getAllowedRequestHeadersPatterns()))
   .collect(MultiMapCollector.toMultiMap(o -> o, headers::getAll));
}

代码示例来源:origin: me.escoffier.fluid/vertx-eventbus-connector

private static <T> Message<T> createData(io.vertx.reactivex.core.eventbus.Message<T> msg) {
  Map<String, Object> map = new HashMap<>();
  msg.headers().names().forEach(s -> map.put(s, msg.headers().get(s)));
  map.put(CommonHeaders.ORIGINAL, msg);
  return new Message<>(msg.body(), map);
 }
}

代码示例来源:origin: io.gravitee.am.gateway.handlers/gravitee-am-gateway-handler

private void parseRequestParameters(RoutingContext context) {
  // invalid_request if the request is missing a required parameter, includes an
  // invalid parameter value, includes a parameter more than once, or is otherwise malformed.
  MultiMap requestParameters = context.request().params();
  Set<String> requestParametersNames = requestParameters.names();
  requestParametersNames.forEach(requestParameterName -> {
    List<String> requestParameterValue = requestParameters.getAll(requestParameterName);
    if (requestParameterValue.size() > 1) {
      throw new InvalidRequestException("Parameter [" + requestParameterName + "] is included more than once");
    }
  });
}

代码示例来源:origin: io.gravitee.am.gateway.handlers/gravitee-am-gateway-handler

private void parseRequestParameters(RoutingContext context) {
  // invalid_request if the request is missing a required parameter, includes an
  // invalid parameter value, includes a parameter more than once, or is otherwise malformed.
  MultiMap requestParameters = context.request().params();
  Set<String> requestParametersNames = requestParameters.names();
  requestParametersNames.forEach(requestParameterName -> {
    List<String> requestParameterValue = requestParameters.getAll(requestParameterName);
    if (requestParameterValue.size() > 1) {
      throw new InvalidRequestException("Parameter [" + requestParameterName + "] is included more than once");
    }
  });
}

代码示例来源:origin: gravitee-io/graviteeio-access-management

private void parseRequestParameters(RoutingContext context) {
  // invalid_request if the request is missing a required parameter, includes an
  // invalid parameter value, includes a parameter more than once, or is otherwise malformed.
  MultiMap requestParameters = context.request().params();
  Set<String> requestParametersNames = requestParameters.names();
  requestParametersNames.forEach(requestParameterName -> {
    List<String> requestParameterValue = requestParameters.getAll(requestParameterName);
    if (requestParameterValue.size() > 1) {
      throw new InvalidRequestException("Parameter [" + requestParameterName + "] is included more than once");
    }
  });
}

代码示例来源:origin: gravitee-io/graviteeio-access-management

private void parseRequestParameters(RoutingContext context) {
  // invalid_request if the request is missing a required parameter, includes an
  // invalid parameter value, includes a parameter more than once, or is otherwise malformed.
  MultiMap requestParameters = context.request().params();
  Set<String> requestParametersNames = requestParameters.names();
  requestParametersNames.forEach(requestParameterName -> {
    List<String> requestParameterValue = requestParameters.getAll(requestParameterName);
    if (requestParameterValue.size() > 1) {
      throw new InvalidRequestException("Parameter [" + requestParameterName + "] is included more than once");
    }
  });
}

代码示例来源:origin: io.knotx/knotx-server

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: io.knotx/knotx-server

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: io.knotx/knotx-core

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: io.knotx/knotx-core

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: Cognifide/knotx

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: Cognifide/knotx

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

相关文章