本文整理了Java中org.glassfish.jersey.internal.Version.getVersion()
方法的一些代码示例,展示了Version.getVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.getVersion()
方法的具体详情如下:
包路径:org.glassfish.jersey.internal.Version
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!