org.glassfish.jersey.internal.Version.getVersion()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(86)

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

Version.getVersion介绍

[英]Get Jersey version.
[中]换件运动衫。

代码示例

代码示例来源:origin: jersey/jersey

@Override
  public String getName() {
    return String.format("Async HTTP Grizzly Connector %s", Version.getVersion());
  }
}

代码示例来源:origin: jersey/jersey

private ClientRequest addUserAgent(final ClientRequest clientRequest, final String connectorName) {
  final MultivaluedMap<String, Object> headers = clientRequest.getHeaders();
  if (headers.containsKey(HttpHeaders.USER_AGENT)) {
    // Check for explicitly set null value and if set, then remove the header - see JERSEY-2189
    if (clientRequest.getHeaderString(HttpHeaders.USER_AGENT) == null) {
      headers.remove(HttpHeaders.USER_AGENT);
    }
  } else if (!clientRequest.ignoreUserAgent()) {
    if (connectorName != null && !connectorName.isEmpty()) {
      headers.put(HttpHeaders.USER_AGENT,
          Collections.singletonList(String.format("Jersey/%s (%s)", Version.getVersion(), connectorName)));
    } else {
      headers.put(HttpHeaders.USER_AGENT,
          Collections.singletonList(String.format("Jersey/%s", Version.getVersion())));
    }
  }
  return clientRequest;
}

代码示例来源:origin: jersey/jersey

private ClientRequest addUserAgent(final ClientRequest clientRequest, final String connectorName) {
  final MultivaluedMap<String, Object> headers = clientRequest.getHeaders();
  if (headers.containsKey(HttpHeaders.USER_AGENT)) {
    // Check for explicitly set null value and if set, then remove the header - see JERSEY-2189
    if (clientRequest.getHeaderString(HttpHeaders.USER_AGENT) == null) {
      headers.remove(HttpHeaders.USER_AGENT);
    }
  } else if (!clientRequest.ignoreUserAgent()) {
    if (connectorName != null && !connectorName.isEmpty()) {
      headers.put(HttpHeaders.USER_AGENT,
          Collections.singletonList(String.format("Jersey/%s (%s)", Version.getVersion(), connectorName)));
    } else {
      headers.put(HttpHeaders.USER_AGENT,
          Collections.singletonList(String.format("Jersey/%s", Version.getVersion())));
    }
  }
  return clientRequest;
}

代码示例来源:origin: org.glassfish.jersey.core/jersey-client

private ClientRequest addUserAgent(final ClientRequest clientRequest, final String connectorName) {
  final MultivaluedMap<String, Object> headers = clientRequest.getHeaders();
  if (headers.containsKey(HttpHeaders.USER_AGENT)) {
    // Check for explicitly set null value and if set, then remove the header - see JERSEY-2189
    if (clientRequest.getHeaderString(HttpHeaders.USER_AGENT) == null) {
      headers.remove(HttpHeaders.USER_AGENT);
    }
  } else if (!clientRequest.ignoreUserAgent()) {
    if (connectorName != null && !connectorName.isEmpty()) {
      headers.put(HttpHeaders.USER_AGENT,
          Collections.singletonList(String.format("Jersey/%s (%s)", Version.getVersion(), connectorName)));
    } else {
      headers.put(HttpHeaders.USER_AGENT,
          Collections.singletonList(String.format("Jersey/%s", Version.getVersion())));
    }
  }
  return clientRequest;
}

代码示例来源:origin: org.glassfish.jersey.connectors/jersey-grizzly-connector

@Override
  public String getName() {
    return String.format("Async HTTP Grizzly Connector %s", Version.getVersion());
  }
}

代码示例来源:origin: org.glassfish.jersey.bundles/jaxrs-ri

private ClientRequest addUserAgent(final ClientRequest clientRequest, final String connectorName) {
  final MultivaluedMap<String, Object> headers = clientRequest.getHeaders();
  if (headers.containsKey(HttpHeaders.USER_AGENT)) {
    // Check for explicitly set null value and if set, then remove the header - see JERSEY-2189
    if (clientRequest.getHeaderString(HttpHeaders.USER_AGENT) == null) {
      headers.remove(HttpHeaders.USER_AGENT);
    }
  } else if (!clientRequest.ignoreUserAgent()) {
    if (connectorName != null && !connectorName.isEmpty()) {
      headers.put(HttpHeaders.USER_AGENT,
          Collections.singletonList(String.format("Jersey/%s (%s)", Version.getVersion(), connectorName)));
    } else {
      headers.put(HttpHeaders.USER_AGENT,
          Collections.singletonList(String.format("Jersey/%s", Version.getVersion())));
    }
  }
  return clientRequest;
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

private ClientRequest addUserAgent(final ClientRequest clientRequest, final String connectorName) {
  final MultivaluedMap<String, Object> headers = clientRequest.getHeaders();
  if (headers.containsKey(HttpHeaders.USER_AGENT)) {
    // Check for explicitly set null value and if set, then remove the header - see JERSEY-2189
    if (clientRequest.getHeaderString(HttpHeaders.USER_AGENT) == null) {
      headers.remove(HttpHeaders.USER_AGENT);
    }
  } else if (!clientRequest.ignoreUserAgent()) {
    if (connectorName != null && !connectorName.isEmpty()) {
      headers.put(HttpHeaders.USER_AGENT,
          Arrays.<Object>asList(String.format("Jersey/%s (%s)", Version.getVersion(), connectorName)));
    } else {
      headers.put(HttpHeaders.USER_AGENT,
          Arrays.<Object>asList(String.format("Jersey/%s", Version.getVersion())));
    }
  }
  return clientRequest;
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

private ClientRequest addUserAgent(final ClientRequest clientRequest, final String connectorName) {
  final MultivaluedMap<String, Object> headers = clientRequest.getHeaders();
  if (headers.containsKey(HttpHeaders.USER_AGENT)) {
    // Check for explicitly set null value and if set, then remove the header - see JERSEY-2189
    if (clientRequest.getHeaderString(HttpHeaders.USER_AGENT) == null) {
      headers.remove(HttpHeaders.USER_AGENT);
    }
  } else if (!clientRequest.ignoreUserAgent()) {
    if (connectorName != null && !connectorName.isEmpty()) {
      headers.put(HttpHeaders.USER_AGENT,
          Arrays.<Object>asList(String.format("Jersey/%s (%s)", Version.getVersion(), connectorName)));
    } else {
      headers.put(HttpHeaders.USER_AGENT,
          Arrays.<Object>asList(String.format("Jersey/%s", Version.getVersion())));
    }
  }
  return clientRequest;
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

private ClientRequest addUserAgent(final ClientRequest clientRequest, final String connectorName) {
  final MultivaluedMap<String, Object> headers = clientRequest.getHeaders();
  if (headers.containsKey(HttpHeaders.USER_AGENT)) {
    // Check for explicitly set null value and if set, then remove the header - see JERSEY-2189
    if (clientRequest.getHeaderString(HttpHeaders.USER_AGENT) == null) {
      headers.remove(HttpHeaders.USER_AGENT);
    }
  } else if (!clientRequest.ignoreUserAgent()) {
    if (connectorName != null && !connectorName.isEmpty()) {
      headers.put(HttpHeaders.USER_AGENT,
          Arrays.<Object>asList(String.format("Jersey/%s (%s)", Version.getVersion(), connectorName)));
    } else {
      headers.put(HttpHeaders.USER_AGENT,
          Arrays.<Object>asList(String.format("Jersey/%s", Version.getVersion())));
    }
  }
  return clientRequest;
}

相关文章