All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tigerbrokers.stock.openapi.client.util.SdkVersionUtils Maven / Gradle / Ivy

package com.tigerbrokers.stock.openapi.client.util;

import com.tigerbrokers.stock.openapi.client.constant.TigerApiConstants;
import java.io.IOException;
import java.util.Properties;

/**
 * description: Created by liutongping on 2021/11/8
 */
public class SdkVersionUtils {
  private static String sdkVersion = null;
  private SdkVersionUtils(){}

  /**
   * generate sdk version
   * @return sdk version
   */
  public static String getSdkVersion() {
    if (null == sdkVersion) {
      Properties properties = new Properties();
      try {
        properties.load(SdkVersionUtils.class.getClassLoader().getResourceAsStream("tiger-client.properties"));
        String version = null;
        if (!properties.isEmpty()) {
          version = properties.getProperty(TigerApiConstants.SDK_VERSION);
        }
        if (version != null) {
          sdkVersion = "java-" + version;
        }
      } catch (IOException e) {
        ApiLogger.error("SdkVersionUtils getSdkVersion io exception:{}", e.getMessage(), e);
      }
    }
    return sdkVersion;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy