org.glassfish.jersey.internal.Version类的使用及代码示例

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

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

Version介绍

[英]Utility class for reading build.properties file.
[中]

代码示例

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

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

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

private static void _initiateProperties() {
  final InputStream in = getIntputStream();
  if (in != null) {
    try {
      final Properties p = new Properties();
      p.load(in);
      final String timestamp = p.getProperty("Build-Timestamp");
      version = p.getProperty("Build-Version");
      buildId = String.format("Jersey: %s %s", version, timestamp);
    } catch (final Exception e) {
      buildId = "Jersey";
    } finally {
      close(in);
    }
  }
}

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

private void addVersion(Application wadlApplication) {
  // Include Jersey version as doc element with generatedBy attribute
  Doc d = new Doc();
  d.getOtherAttributes().put(new QName(WadlApplicationContextImpl.WADL_JERSEY_NAMESPACE, "generatedBy", "jersey"),
      Version.getBuildId());
  wadlApplication.getDoc().add(d);
}

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

private static void _initiateProperties() {
  final InputStream in = getIntputStream();
  if (in != null) {
    try {
      final Properties p = new Properties();
      p.load(in);
      final String timestamp = p.getProperty("Build-Timestamp");
      version = p.getProperty("Build-Version");
      buildId = String.format("Jersey: %s %s", version, timestamp);
    } catch (final Exception e) {
      buildId = "Jersey";
    } finally {
      close(in);
    }
  }
}

代码示例来源: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 void addVersion(Application wadlApplication) {
  // Include Jersey version as doc element with generatedBy attribute
  Doc d = new Doc();
  d.getOtherAttributes().put(new QName(WadlApplicationContextImpl.WADL_JERSEY_NAMESPACE, "generatedBy", "jersey"),
      Version.getBuildId());
  wadlApplication.getDoc().add(d);
}

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

private static void _initiateProperties() {
  final InputStream in = getIntputStream();
  if (in != null) {
    try {
      final Properties p = new Properties();
      p.load(in);
      final String timestamp = p.getProperty("Build-Timestamp");
      version = p.getProperty("Build-Version");
      buildId = String.format("Jersey: %s %s", version, timestamp);
    } catch (final Exception e) {
      buildId = "Jersey";
    } finally {
      close(in);
    }
  }
}

代码示例来源: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 void initialize(ApplicationConfigurator applicationConfigurator, InjectionManager injectionManager,
    Binder customBinder) {
  LOGGER.config(LocalizationMessages.INIT_MSG(Version.getBuildId()));
  this.injectionManager = injectionManager;
  this.injectionManager.register(CompositeBinder.wrap(new ServerBinder(), customBinder));

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

private static void _initiateProperties() {
  final InputStream in = getIntputStream();
  if (in != null) {
    try {
      final Properties p = new Properties();
      p.load(in);
      final String timestamp = p.getProperty("Build-Timestamp");
      version = p.getProperty("Build-Version");
      buildId = String.format("Jersey: %s %s", version, timestamp);
    } catch (final Exception e) {
      buildId = "Jersey";
    } finally {
      close(in);
    }
  }
}

代码示例来源: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: jersey/jersey

private void initialize(ApplicationConfigurator applicationConfigurator, InjectionManager injectionManager,
    Binder customBinder) {
  LOGGER.config(LocalizationMessages.INIT_MSG(Version.getBuildId()));
  this.injectionManager = injectionManager;
  this.injectionManager.register(CompositeBinder.wrap(new ServerBinder(), customBinder));

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

private static void _initiateProperties() {
  final InputStream in = getIntputStream();
  if (in != null) {
    try {
      final Properties p = new Properties();
      p.load(in);
      final String timestamp = p.getProperty("Build-Timestamp");
      version = p.getProperty("Build-Version");
      buildId = String.format("Jersey: %s %s", version, timestamp);
    } catch (final Exception e) {
      buildId = "Jersey";
    } finally {
      close(in);
    }
  }
}

代码示例来源: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.core/jersey-server

private void addVersion(Application wadlApplication) {
  // Include Jersey version as doc element with generatedBy attribute
  Doc d = new Doc();
  d.getOtherAttributes().put(new QName(WadlApplicationContextImpl.WADL_JERSEY_NAMESPACE, "generatedBy", "jersey"),
      Version.getBuildId());
  wadlApplication.getDoc().add(d);
}

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

private static void _initiateProperties() {
  final InputStream in = getIntputStream();
  if (in != null) {
    try {
      final Properties p = new Properties();
      p.load(in);
      final String timestamp = p.getProperty("Build-Timestamp");
      version = p.getProperty("Build-Version");
      buildId = String.format("Jersey: %s %s", version, timestamp);
    } catch (final Exception e) {
      buildId = "Jersey";
    } finally {
      close(in);
    }
  }
}

代码示例来源: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: org.glassfish.jersey.core/jersey-server

private void initialize(ApplicationConfigurator applicationConfigurator, InjectionManager injectionManager,
    Binder customBinder) {
  LOGGER.config(LocalizationMessages.INIT_MSG(Version.getBuildId()));
  this.injectionManager = injectionManager;
  this.injectionManager.register(CompositeBinder.wrap(new ServerBinder(), customBinder));

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

private static void _initiateProperties() {
  final InputStream in = getIntputStream();
  if (in != null) {
    try {
      final Properties p = new Properties();
      p.load(in);
      final String timestamp = p.getProperty("Build-Timestamp");
      version = p.getProperty("Build-Version");
      buildId = String.format("Jersey: %s %s", version, timestamp);
    } catch (final Exception e) {
      buildId = "Jersey";
    } finally {
      close(in);
    }
  }
}

代码示例来源: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;
}

相关文章